Remember the pots the dealer throws away, so the bank check stops blaming them #86

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-discarded-pot into fix/casino-holdem-honest-tank-clock
Owner

Starting the next hand with money still in the middle destroys it. The tool asks first, and says afterwards how much went. Nothing wrote it down, though, so when the bank check came round at cash-out it saw only that chips were gone:

$5 more cash than chips in play. Someone has paid for chips they haven't been given.

and settle-up told the dealer to fix that before anyone cashed out. Both were accusing the dealer of a miscount for money the tool itself had removed, at the dealer's instruction, minutes earlier — the one kind of shortfall that isn't a mistake, reported as the one kind that is. On a real night that sends someone counting the rack twice looking for chips that were never lost.

What changed

  • Discards are recorded on the table as they happen, inside the same undoable step as Next Hand, so undo takes the record back with the pot.
  • bankReconciliation counts them alongside the chips: chipsInPlay + discarded against cashIn.
  • The Session panel gains a Taken off the table line, shown only when there is one, so the number is visible rather than silently subtracted — and the balanced verdict says so: "Balanced — the cash covers every chip on the table, once the $5 taken off it is counted."
  • Settle-up's note names the discard instead of instructing the dealer to fix it.
  • Old saves migrate to 0; a negative or non-numeric value can't move the answer.

A genuine shortfall on top of a discard still reports, at its true size — verified in the browser: $800 cash, $750 in chips, $5 discarded reads "$45 more cash than chips in play", and settle-up says $5 of the $50 is accounted for.

Verification — 7 new tests in tests/holdem/discardedPot.test.js; suite at 290 tests, 0 failures. Playwright MCP: dealt, called, threw the pot away, read the panel (row + reworded verdict), pressed undo (row hidden, discarded back to 0, verdict plain), then re-checked with a real shortfall layered on. Layout/contrast audit clean, no console errors.

Stacked on fix/casino-holdem-honest-tank-clock.

🤖 Generated with Claude Code

https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb

Starting the next hand with money still in the middle destroys it. The tool asks first, and says afterwards how much went. Nothing wrote it down, though, so when the bank check came round at cash-out it saw only that chips were gone: > $5 more cash than chips in play. Someone has paid for chips they haven't been given. and settle-up told the dealer to fix that before anyone cashed out. Both were accusing the dealer of a miscount for money the tool itself had removed, at the dealer's instruction, minutes earlier — the one kind of shortfall that isn't a mistake, reported as the one kind that is. On a real night that sends someone counting the rack twice looking for chips that were never lost. **What changed** - Discards are recorded on the table as they happen, inside the same undoable step as Next Hand, so undo takes the record back with the pot. - `bankReconciliation` counts them alongside the chips: `chipsInPlay + discarded` against `cashIn`. - The Session panel gains a **Taken off the table** line, shown only when there is one, so the number is visible rather than silently subtracted — and the balanced verdict says so: *"Balanced — the cash covers every chip on the table, once the $5 taken off it is counted."* - Settle-up's note names the discard instead of instructing the dealer to fix it. - Old saves migrate to `0`; a negative or non-numeric value can't move the answer. A genuine shortfall on top of a discard still reports, at its true size — verified in the browser: $800 cash, $750 in chips, $5 discarded reads *"$45 more cash than chips in play"*, and settle-up says $5 of the $50 is accounted for. **Verification** — 7 new tests in `tests/holdem/discardedPot.test.js`; suite at 290 tests, 0 failures. Playwright MCP: dealt, called, threw the pot away, read the panel (row + reworded verdict), pressed undo (row hidden, `discarded` back to 0, verdict plain), then re-checked with a real shortfall layered on. Layout/contrast audit clean, no console errors. Stacked on `fix/casino-holdem-honest-tank-clock`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps added 1 commit 2026-09-01 20:28:17 -06:00
Starting the next hand with money still in the middle destroys it. The tool asks
first, and says afterwards how much went. Nothing wrote it down, though, so when
the bank check came round at cash-out it saw only that chips were gone:

    $5 more cash than chips in play. Someone has paid for chips they haven't
    been given.

and settle-up told the dealer to fix it before anyone cashed out. Both were
accusing the dealer of a miscount for money the tool itself had removed, at the
dealer's instruction, minutes earlier — the one kind of shortfall that isn't a
mistake, reported as the one kind that is.

Discards are now recorded on the table as they happen (undoably, with the rest
of the Next Hand step), the reconciliation counts them alongside the chips, and
the panel shows a "Taken off the table" line so the number is visible rather
than merely subtracted. A genuine shortfall on top of a discard still reports,
at its true size — the discard accounts for its own $5 and not a cent more.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps closed this pull request 2026-09-02 09:57:58 -06:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jheaps/JoshHeaps.Net#86