Skip to content

games_hub: rummy (#245) - #1608

Merged
aaylward merged 4 commits into
mainfrom
claude/rummy-game-backend-ui-fvxk0l
Sep 28, 2026
Merged

aaylward merged 4 commits into
mainfrom
claude/rummy-game-backend-ui-fvxk0l

Conversation

@aaylward

@aaylward aaylward commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #245. UI: muchq/muchq.github.io PR on branch claude/rummy-game-backend-ui-fvxk0l.

Basic rummy as the hub's third game, on castle's terms:

  • Engine libs/cards/rummy: 10 cards at 2 seats, 7 at 3–4; draw stock or discard; melds (sets, runs, ace low or high, no wrap) and lay-offs onto anyone's meld; discard ends the turn; the card taken from the discard can't go straight back unless it's the last in hand; an empty stock is the discard turned over under its top; first empty hand wins and scores the others' deadwood. Versioned serde for the games row.
  • Wire model/rummy.smithy: rummy envelope member; moves name cards (castle: the wire should name cards, not the engine's slots #1505). The view redacts other hands and the stock, and a stock draw's lastMove names no card.
  • Hub: castle's move loop generalised to TableEngineMove<Engine> / LifecycleMove<Move>; castle behaviour unchanged (castle_e2e green). Rummy points ride gameEnded and stay out of the room's running total (golf's lower-is-better scale).
  • Vocabulary: stats hubVariants, deja VARIANTS, otel_contract pin, prom_proxy Rummy tiles.

Tests:

  • engine, meld and serde unit tests (frozen payloads, hostile rows)
  • rummy_e2e_test: whole games against an engine mirror at 2/3/4 seats; also redaction, refusals, refill, abandonment, resume
  • rummy_wire_test: raw-byte goldens
  • model/counter pins in hub_e2e_test
  • Postgres-gated: pg_hub_store_test and pg_hub_e2e_test (restart mid-turn). Ran locally against Postgres 16.

Locally: bazel test //domains/games/... with Postgres, stats/otel_contract/deja/prom_proxy tests, --runs_per_test=10 on the rummy stream suites, and a mutation-check over hub redaction and engine rules. The only surviving mutant is equivalent.

The review panel ran against the first commit; its survivors are the second commit. Cursor's panel fold-ins are the last.

Rummy variants are planned separately (#1609–#1611).


Generated by Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 28, 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 7a71af6 Commit Preview URL

Branch Preview URL
Sep 28 2026, 08:05 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 28, 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 7a71af6 Commit Preview URL

Branch Preview URL
Sep 28 2026, 08:05 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 28, 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 7a71af6 Commit Preview URL

Branch Preview URL
Sep 28 2026, 08:06 PM

…kend-ui-fvxk0l

# Conflicts:
#	domains/games/apis/games_hub/BUILD.bazel
@github-actions github-actions Bot added service:deja Changes the deja image service:games_hub Changes the games_hub image service:stats Changes the stats image labels Sep 28, 2026
@cursor

cursor Bot commented Sep 28, 2026

Copy link
Copy Markdown

Review panel + Bugbot (bbbbfc07)

Four lenses + Bugbot. CI green. Bugbot found no bugs. Correctness and resource-safety clean — author-panel fold-ins in 06b13b6d (serde lastMove shape, stuck-row reject, turn-before-stale-card) still hold. Altitude is right: rummy-on-castle-terms, TableEngineMove/LifecycleMove earn their keep at N=2, points stay off golf’s running total.

Verdict: LGTM with small fold-ins. Engine/wire/e2e/PG/vocab look solid; leftovers are docs drift and a soft dashboard ask.

Survivors (verified):

  1. Docs — cards/rummy/README.md drops the last-card discard exception. It says the taken discard “may not go straight back,” full stop. game_state.h, rummy.smithy (RummyDrawDiscard), and Discard.TheTakenCardMayGoBackWhenItIsTheLastInTheHand allow the exception. The README claims to restate the GameState contract.

  2. Docs — game_events.h still says variant is "golf" or "castle". FinishedOf / GameKindName include rummy; dedicated rummy finished tests exist. Fold the comment.

  3. Tests — EveryEventsLineIsTextWithNothingToEscape still asserts variant == golf|castle. The test name claims “every ending of every game”; rummy endings are covered elsewhere, but that loop never names "rummy". Add the third variant (and a GameStartedLine golden if those stay variant-specific).

  4. Altitude (soft) — prom_proxy tiles. Day-one rummy_commands/rummy_events are declared and vocabulary-pinned, but registry.go still selects only golf_|castle_|lobby_. Castle’s tenant landing (games_hub: castle joins the room stream (#77 phase 2) #1492) shipped tiles with the series. Equating this to voice_* undersells it — voice is room-layer, not a GameKind. Fold the Castle-sized tiles/selector, or a same-day follow-up; not a playability blocker.

Thin (won’t hold LGTM): hub e2e never asserts "that card does not fit that meld" (unit only) or the empty-stock-with-nothing-under-top refusal (WithNothingUnderTheDiscardTopThereIsNoStock). Refill and "no such meld" are covered.

Line comment below. Panel complete.

Comment thread domains/games/libs/cards/rummy/README.md Outdated
@cursor

cursor Bot commented Sep 28, 2026

Copy link
Copy Markdown

Recheck at 7a71af62

Closed:

  1. README — last-card exception restored.
  2. game_events.h — "golf", "castle" or "rummy".
  3. EveryEventsLineIsTextWithNothingToEscape — rummy started + completed/abandoned endings in the loop; variant assert includes "rummy".
  4. prom_proxy — Rummy tiles, selector rummy_, allowlist, handler tests.

Thin e2e refusals staying at unit level is fine.

LGTM.

@github-actions github-actions Bot added the service:unknown Impacted services could not be computed label Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

sanitize (tsan) on 7a71af6 died fetching opal_cpp before any test ran: Unknown host: github.com (runner DNS). Not this PR's; the same job passed on bbbbfc0, and 7a71af6 only touches docs, a test and prom_proxy. I can't re-run it (403) — needs a manual "Re-run failed jobs".


Generated by Claude Code

@cursor

cursor Bot commented Sep 28, 2026

Copy link
Copy Markdown

CI note (7a71af62)

sanitize (tsan) failed before any test ran: Bazel Unknown host: github.com fetching opal_cpp (exit 37). Sibling asan/ubsan on the same tip passed — infra/DNS flake, not a rummy race. LGTM still holds; rerun that job when convenient.

@aaylward
aaylward merged commit 308593d into main Sep 28, 2026
38 of 39 checks passed
@aaylward
aaylward deleted the claude/rummy-game-backend-ui-fvxk0l branch September 28, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rummy backend

2 participants