Skip to content

games_hub: go takes challenges - #1679

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 2.

  • GoTerms{size, komi, clock} joins HostedTerms; go's adapter Start is now GoTerms, so a startGame and a challenge are one shape.
  • Go opts into kChallenges: challenge: GoStartGame posts terms, the seat that fills the table starts on them, GoView.terms shows them while waiting, and the lobby lists them ("9×9 · komi 5.5 · 1+0").
  • Terms no game could open on are refused as posted, via a new public go::CheckRules (the engine's start check minus the seats). Stored terms that fail it read as malformed.
  • Stored waiting state: {"terms":{"size","komi","initialMs","incrementMs"}}, pinned both ways beside chess's. Go's engine encoding has no top-level terms.
  • ClockLine is shared by chess's and go's lobby lines.

Handicap is not here: the engine has no handicap placement yet.

Rollback: a pre-change binary can't read an open go challenge's row and drops it from the lobby, logged; the row survives and returns on roll-forward.

Tests: //domains/games/... green with Postgres, no skips. Wire goldens pin the challenge command, GoView.terms bytes and the room line, plus in-band bound and rules refusals. The first tests were written with the code, not watched red first. scripts/mutation-check kills every guard instead: capability off, FilledStart, the post-time rules check, the stored-terms check, the view's terms, the lobby line.

Review panel ran; fixups in f97f3d7 (wire goldens, refusal reasons, README and model docs). Kept as is: go's defaults live on GoTerms (chess keeps its defaults in its adapter).

UI: muchq/muchq.github.io#461, to merge after this deploys.

🤖 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 f97f3d7 Commit Preview URL

Branch Preview URL
Oct 19 2026, 06:14 PM

@cloudflare-workers-and-pages

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 f97f3d7 Commit Preview URL

Branch Preview URL
Oct 19 2026, 06:13 PM

@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review: go takes challenges

Verdict: Approve. Clean #1668 phase-2 cut on the #1678 terms spine: GoTerms joins HostedTerms, go opts into kChallenges, startGame and challenge share one shape, illegal terms refused at post via go::CheckRules, waiting state pinned beside chess. Tip f97f3d76.

What works

Shape. Start = GoTerms with defaults on the struct (19 / 6.5 / 10+5). FilledStart starts the joiner on posted terms. Decode: challenge → CheckRules then PostTerms; startGame → StartGame (open still validates). View carries structured terms while waiting; lobby via TermsLine / shared ClockLine ("9×9 · komi 5.5 · 1+0").

Rules. CheckRules extracted from start setup (board / komi / clock); seats stay in CheckSetup. Challenge refuses at post; TermsFromJson rejects the same set as malformed. Smithy bounds (size 9–19, clock ranges) plus in-band rules (size 10, komi 6.25) both pinned on the wire.

Stored bytes. {"terms":{"size","komi","initialMs","incrementMs"}} write + load→rewrite beside chess; engine encoding still has no top-level terms. TermsLineUp still holds with three alternatives.

Tests. E2e: post shows in room+view, join starts on terms, defaults, rules refusals. Wire goldens for command / view terms / room line (panel f97f3d76). Unit: round-trip + malformed, lobby line, CheckRules. Mutation-check claim covers the guards.

Non-blocking / ops

  • Handicap deferred (engine), as stated.
  • Rollback: pre-change binary drops open go challenge rows from the lobby (logged); row survives for roll-forward.
  • UI Go: a lone seat posts a challenge muchq.github.io#461 after this deploys.
  • First tests not watched red (disclosed); mutation-check substitutes.

Tip f97f3d76. Part of #1668.

@github-actions github-actions Bot added service:games_hub Changes the games_hub image service:one_d4_worker Changes the one_d4_worker image labels Oct 19, 2026
@cloudflare-workers-and-pages

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 f97f3d7 Commit Preview URL

Branch Preview URL
Oct 19 2026, 06:15 PM

@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

CI: f97f3d76

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

@aaylward
aaylward merged commit 31ddf37 into main Oct 19, 2026
24 checks passed
@aaylward
aaylward deleted the claude/hopeful-ramanujan-uwueor branch October 19, 2026 19:18
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants