Repository navigation
games_hub: each game owns its terms and their serde - #1678
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ast-lol | 1d9f58e | Commit Preview URL Branch Preview URL |
Oct 19 2026, 02:07 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
1d4-web | 1d9f58e | Commit Preview URL Branch Preview URL |
Oct 19 2026, 02:05 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
iili | 1d9f58e | Commit Preview URL Branch Preview URL |
Oct 19 2026, 02:06 PM |
CI:
|
Review: each game owns its terms and their serdeVerdict: Approve. Right phase-1 cut for #1668 against the #1677 pins: What worksOwnership. Kind from terms. Stored bytes. Chess waiting-state and RR body goldens unchanged (write + load→rewrite). Pong RR body is now Tests. Unit coverage for body round-trip, malformed refusals (named-body / float clock / missing terms), pairing-terms rule, lobby line. Panel fixups in Non-blocking / ops
Tip |
#1668 phase 1, terms. Built against the pins from #1677.
HostedTerms = variant<ChessTerms, PongTerms>besideHostedState. The hub, rows andTableContextcarry it without reading it.Termsand owns its serde:TermsJson/TermsFromJson/TermsLine(kChallenges),RoundRobinBody(terms)/FromRoundRobinBody(body)(kRoundRobins). Chess's serde moved out ofpg_hub_store.cc; its lobby line moved out ofhub.cc.ChessEventRow.pong_variantand.kindare gone: a round robin's terms say which game it is (RoundRobinKind). A static_assert holds everyHostedTermsalternative to exactly one game'sTerms.RoundRobinTermshook is gone.Stored bytes: chess unchanged (pins green unedited). Pong's round robin body no longer writes chess's unused zeroed
terms; bodies stored with them still load and rewrite in the new form (new pin). Rollback cost: a pre-change binary can't read pong round robins created, or updated, after this deploys, and drops them with a log line. Chess is unaffected.Go's terms are not here: they have no reader until Go takes challenges (phase 2), so they land there.
Tests:
//domains/games/...225/225 with Postgres, no skips. The new pong pin was red before the change. Body refusals, waiting terms and the lobby line now have Postgres-free unit tests inadapters_test; mutation-check kills the named-body,"game"type, kChallenges and chess-missing-terms mutants. Breaking terms ownership fails the build.Review panel ran; fixups in 1d9f58e (derived kind, pairing-terms rule, unit tests, comment drift). Not taken: folding the body hooks into
TermsJson(adds an override mechanism to save Go a two-line wrapper).🤖 Generated with Claude Code
https://claude.ai/code/session_01Xae1QBa2qHX32DPVGSq19F