Skip to content

rummy: a take-down plays its bottom card in the same move - #1617

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

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

Conversation

@aaylward

@aaylward aaylward commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Play-test feedback: you shouldn't be able to take the discard pile down without actually playing the bottom card, and the table shouldn't tell you which cards qualify.

  • New move takeDown{card, cards | meldIndex}: take every card from the top of the pile down to card, and play card in the same move. Either meld it with cards from the hand (only cards held before the draw count), or lay it off onto table meld meldIndex. The other cards taken go to the hand. Engine: takeDownAndMeld / takeDownAndLayOff, built on the existing meld / layOff checks.
  • Only a card taken alone is barred from going straight back. The top card of a take-down may be discarded at once.
  • drawDiscard takes the top card only. Naming any other card is refused and points to takeDown. The turn and stage checks come first, so an off-turn seat still gets "not your turn".
  • Removed:
    • mustPlay (with the reset on leave and the check that the owed card stays playable)
    • discardTakeable
    • playable and faceOf
  • lastMove: a take-down is recorded as takeDown, with the cards it took and the meld its bottom card went to.

Deploy and rollback:

Rule tweaks as first-class table options, including a take-down that may meld with cards from the stack it took: #1616.

Verified:

  • The rummy lib and games_hub suites pass locally with Postgres.
  • Mutation checks, all killed:
    • the hand-only meld check
    • the TakeDown kind on the recorded move
    • the not-in-pile refusal
    • refusing a deeper card on a plain draw
    • requiring exactly one of meld or lay-off
    • the stale-hand offset
  • Review panel ran: rules, wire and compatibility, UI. The test-adequacy review is still running.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MXWdcUNjGezMzyuCkaMMLg

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 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 40419b2 Commit Preview URL

Branch Preview URL
Sep 29 2026, 08:19 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 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 40419b2 Commit Preview URL

Branch Preview URL
Sep 29 2026, 08:19 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 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 40419b2 Commit Preview URL

Branch Preview URL
Sep 29 2026, 08:20 PM

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MXWdcUNjGezMzyuCkaMMLg
@cursor

cursor Bot commented Sep 29, 2026

Copy link
Copy Markdown

Review panel — #1617 @ 146e6728

Four lenses + Bugbot on the take-down tip (incl. one-card reload twin). Engine, hub dispatch, discard-bar change, serde forgiveness of mustPlay, and the wire pins for meld take-down / deeper-draw refuse / turn-first look sound. Bugbot clean. Resource-safety lens clean. Altitude: takeDown over mustPlay, hint drop, and #1616 deferral are the right cuts.

Requested fold-ins

  1. rummy.smithy RummyTakeDown opens with “But in gin:” — polarity is inverted. Hub README and the gin step (nullptr → “not a move in gin”) say take-down is outside gin. Leftover from the old drawDiscard sentence; as written it teaches the wrong variant. (line comment)

  2. libs/cards/rummy/README.md rules paragraph still describes deferred play — “down into it, which binds the seat to play the deepest card taken.” Hub README and game_state.h already state same-move take-down; this file’s arrange-corpus edit left the rules summary on the old obligation model. Not in the active diff hunk for the rules lines — fold the sentence to match game_state.h while the file is already open for the UI note.

  3. Wire never succeeds a take-down lay-off. Engine has LaysTheBottomCardOffOntoATableMeld; ATakeDownNamesItsPlay only refuses lay-off (no such meld / XOR). Happy-path wire is meld-only. Pin one successful takeDown{card, meldIndex} across the hub the way the meld golden does. (line comment)

Mild / optional

  • Arrange-corpus commit (f562f269) is a second item (UI no longer replays the corpus). Fine to keep; name it in the body rather than treating it as take-down proof. Pairing it with the rules-paragraph fix above closes the altitude nit.

Checked and not raised

Hand-only meld, takenDiscard null after multi-card take (top may go back), alone-draw still barred, drawDiscard deeper → takeDown with turn first, mustPlay read-past, #1614 multi-card drawDiscard lastMove still loads, gin boundary via nullptr step, counters for takeDown.

CI: build-and-test / sanitize were still in flight when this posted — will recheck on completion / fold-ins.

Comment thread domains/games/apis/games_hub/rummy_wire_test.cc
Comment thread domains/games/apis/games_hub/model/rummy.smithy Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MXWdcUNjGezMzyuCkaMMLg
@cursor

cursor Bot commented Sep 29, 2026

Copy link
Copy Markdown

Recheck @ 40419b2: all three fold-ins land.

  • Smithy: “Not in gin.” — polarity fixed.
  • Lib README rules paragraph now matches same-move take-down.
  • Wire: TakingThePileDownMeldsItsDeepestCardAtOnce continues through player-2’s lay-off take-down; grown meld + lastMove (takeDown, meldIndex) pinned.

Nothing further from the panel. Watching CI on this tip.

@github-actions github-actions Bot added the service:games_hub Changes the games_hub image label Sep 29, 2026
@aaylward
aaylward merged commit 5d5efe5 into main Sep 29, 2026
24 checks passed
@aaylward
aaylward deleted the claude/rummy-game-backend-ui-fvxk0l branch September 29, 2026 21:04
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants