Skip to content

games_hub: go round robins - #1680

Merged
aaylward merged 3 commits into
mainfrom
claude/hopeful-ramanujan-uwueor
Oct 19, 2026
Merged

aaylward merged 3 commits into
mainfrom
claude/hopeful-ramanujan-uwueor

Conversation

@aaylward

@aaylward aaylward commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

#1668 phase 3.

  • Go opts into kRoundRobins: createRoundRobin (entrants + GoStartGame terms, refused when no game could open on them), and chess's withdraw, forfeit, roundRobins and playRoundRobin shapes.
  • A pairing's table waits on the round robin's terms (go takes challenges), starts when the opponent sits, and opens with the pairing's Black on move: go::Table::open takes a black_seat.
  • Its one game, off the table's own score sheet as pong's is, decides the pairing: winner, or a draw on an even count. Results are scored by the existing rules.
  • Wire: GoRoundRobin is chess's round robin with go's terms. It reuses ChessPairing and ChessStanding, and chess's view builder now serves both. GoView.roundRobinId names a pairing's table.
  • Stored body: {"game":"go","terms":{"size","komi","initialMs","incrementMs"},...}, pinned both ways beside chess's and pong's.

Rollback: a pre-change binary skips stored go round robins (logged, untouched, back on roll-forward). Their waiting pairing tables lose the pair gate and the pairing's colours until then.

Tests: go_round_robin_e2e_test, written first:

  • create, and refuse bad terms;
  • a pairing's table starts on the round robin's terms with its Black, and scores a resignation;
  • an even count draws for half a point each;
  • leaving a pairing's game loses it;
  • forfeit and withdraw;
  • one game per table;
  • go's envelope refuses a chess round robin.

Also: engine black_seat, body round trip and refusals, the stored-body pin, the wire builder. //domains/games/... green with Postgres. scripts/mutation-check kills the pairing's Black, the terms check, the terms the table starts on, TableGame, the body read, forfeit and withdraw.

Review panel ran; fixups in f2f886c (forfeit/withdraw/leave tests, docs that named only chess and pong). Not taken: sharing the three adapters' near-identical round-robin decode and event hooks, until a fourth game has round robins.

UI follows in muchq/muchq.github.io once muchq/muchq.github.io#461 merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xae1QBa2qHX32DPVGSq19F

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
iili 82f562c Commit Preview URL

Branch Preview URL
Oct 19 2026, 09:03 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ast-lol 82f562c Commit Preview URL

Branch Preview URL
Oct 19 2026, 09:03 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
1d4-web 82f562c Commit Preview URL

Branch Preview URL
Oct 19 2026, 09:02 PM

@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review: f2f886c5

Verdict: Approve

Phase 3 of #1668: go opts into kRoundRobins on chess's rules and pong's table-game scoring path. Tip includes the panel fixup (forfeit/withdraw/leave e2e, docs that now name go).

What lands

  • kRoundRobins + create/withdraw/forfeit/roundRobins/playRoundRobin on go's envelope; bad terms refused via go::CheckRules at create, same gate as challenges.
  • Pairing tables wait on the RR's terms (RoundRobinStart from table_terms, chess's pattern), open with the pairing's Black (Table::open(..., black_seat)), play one game, score off the sheet (TableGame → empty winner is draw).
  • Wire: GoRoundRobin shares chess pairings/standings via ColouredRoundRobinOf; body {"game":"go","terms":{...}} pinned both ways; each envelope still refuses another game's RR.
  • Engine: black_seat default 0 keeps non-RR opens; next game still swaps.

Checked

  • Open finds Black from pairing->black in roster; invalid seat fails CheckSetup (0|1). View lists Black first by color, so the e2e colour asserts bite.
  • Draw path: even area score → sheet winner absent → EventGame.winnernullopt → EffectivePairings draw / 0.5 — covered by AnEvenCountDrawsThePairing.
  • Leave / forfeit / withdraw / one-game refusal / chess-RR cross-envelope refusal covered in go_round_robin_e2e_test (fixup).
  • Stored-body pin and RoundRobinBody round-trip / refusal of size 10 sit beside chess and pong.
  • Rollback note matches the named-body skip pattern.

Not blocking

  • Sharing the three adapters' near-identical RR decode/event hooks — agreed, wait for a fourth.

CI already green on this tip (24/24, sanitizers included). Approve.

@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review: 82f562cf

Verdict: Approve (unchanged)

Takes the deferred share: RoundRobinMove for withdraw/forfeit/roundRobins/playRoundRobin, and RoundRobinWire + shared wrap in adapters.cc for the list/single events. createRoundRobin stays per-game (terms). Concept and EveryRoundRobinGameDecodesTheSharedMovesAlike pin all three.

Net deletion, behaviour unchanged. Waiting on CI for this tip.

@github-actions github-actions Bot added the service:unknown Impacted services could not be computed label Oct 19, 2026
@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

CI: 82f562cf

All 24 checks green (build-and-test, asan, ubsan, tsan included). Approve unchanged.

@aaylward
aaylward merged commit dd88ccc into main Oct 19, 2026
24 checks passed
@aaylward
aaylward deleted the claude/hopeful-ramanujan-uwueor branch October 19, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

service:games_hub Changes the games_hub image service:one_d4_worker Changes the one_d4_worker image service:unknown Impacted services could not be computed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants