Let the banker check the cash box against the chips on the table #50
Closed
jheaps
wants to merge 1 commits from
feature/casino-holdem-bank-audit into feature/casino-holdem-fewer-taps
pull from: feature/casino-holdem-bank-audit
merge into: :feature/casino-holdem-fewer-taps
:master
:feature/socialism
:polish/holdem-seats-one-size
:fix/holdem-dealer-chip-eats-its-seat
:polish/holdem-game-night-ready
:polish/holdem-round-next
:polish/holdem-seat-collisions
:polish/holdem-offline-and-render
:fix/naming-a-blind-deals-the-hand
:release/casino-holdem-polish
:fix/casino-holdem-phone-look
:fix/casino-holdem-sidebar-crowding
:fix/casino-holdem-contribution-rule
:fix/casino-holdem-one-stack-rule
:fix/casino-holdem-default-stack-buyin
:feat/casino-holdem-waiting-list
:feat/casino-holdem-misdeal
:feat/casino-holdem-cash-out
:feat/casino-holdem-clock
:feat/casino-holdem-rake
:fix/casino-holdem-stadium-ring
:fix/casino-holdem-phone-felt-shape
:fix/casino-holdem-audit-runs-everything
:feat/casino-holdem-straddle
:fix/casino-holdem-landscape-ring
:feat/casino-holdem-table-file
:fix/casino-holdem-touch-targets
:fix/casino-holdem-audit-modal-blindspot
:fix/casino-holdem-quicksplit-chop
:fix/casino-holdem-buildable-bet-sizes
:fix/casino-holdem-pot-sized-raise
:fix/casino-holdem-chips-to-count-out
:fix/casino-holdem-first-buy-in
:fix/casino-holdem-seating-a-table
:fix/casino-holdem-showdown-order
:fix/casino-holdem-hand-log-filter
:fix/casino-holdem-posting-in
:fix/casino-holdem-dead-button
:fix/casino-holdem-discarded-pot
:fix/casino-holdem-honest-tank-clock
:fix/casino-holdem-export-the-notes
:fix/casino-holdem-stacks-in-chips
:fix/casino-holdem-close-audit-blind-spots
:fix/casino-holdem-readable-dim-states
:fix/casino-holdem-drop-broken-watermark
:fix/casino-holdem-two-tabs
:fix/casino-holdem-unreadable-save
:fix/casino-holdem-say-when-not-saving
:fix/casino-holdem-shortcut-discovery
:fix/casino-holdem-rulings-index-compact
:fix/casino-holdem-rulings-index
:fix/casino-holdem-payout-in-chips
:fix/casino-holdem-move-seat-on-touch
:fix/casino-holdem-amount-fields-select
:fix/casino-holdem-touch-targets-by-pointer
:fix/casino-holdem-button-box-model
:fix/casino-holdem-blind-badge-placement
:fix/casino-holdem-buyin-deals-in
:fix/casino-holdem-bet-vs-raise
:fix/casino-holdem-deal-around-broke
:fix/casino-holdem-settle-up
:fix/casino-holdem-allin-and-bar
:fix/casino-holdem-one-dealer-button
:fix/casino-holdem-manual-deal
:fix/casino-holdem-less-guessing
:feature/casino-holdem-seat-editor
:fix/casino-holdem-landscape-table
:feature/casino-holdem-acting-seat
:feature/casino-holdem-raise-guard
:feature/casino-holdem-first-run
:feature/casino-holdem-contrast-audit
:feature/casino-holdem-layout-audit
:feature/casino-holdem-blind-fairness
:feature/casino-holdem-rulings-depth
:feature/casino-holdem-bank-audit
:feature/casino-holdem-fewer-taps
:feature/casino-holdem-render-perf
:feature/casino-holdem-keyboard-focus
:feature/casino-holdem-resilience
:feature/casino-holdem-messy-tables
:feature/casino-holdem-touch-mobile
:chore/casino-holdem-tech-debt
:feature/casino-holdem-dealer-batch
:feature/casino-holdem-seat-count-safety
:feature/casino-holdem-odd-chip
:feature/casino-holdem-button-moves
:feature/casino-holdem-allin-runout
:feature/casino-holdem-heads-up
:feature/casino-holdem-contrast
:feature/casino-holdem-touch-audit
:feature/casino-holdem-wizard-polish
:feature/casino-quicksplit-side-pots
:feature/casino-holdem-rebuys
:feature/casino-holdem-rulings
:feature/casino-holdem-sidebar-polish
:feature/casino-holdem-keyboard
:feature/casino-holdem-action-undo
:feature/casino-holdem-pace
:feature/casino-holdem-side-pot-breakdown
:feature/casino-holdem-gestures
:feature/casino-holdem-card-picker
:feature/casino-holdem-live-betting
:feature/casino-holdem-bet-chips
:feature/casino-holdem-seat-legibility
:feature/casino-holdem-undo-toasts
:feature/casino-holdem-quick-split
:feature/casino-holdem-mobile-table
:feature/casino-holdem-hand-history
:feature/casino-texas-holdem
:feature/casino-holdem-dealer-mode-polish
:feature/fractional-learned-weights
:fix/stockfish-dispose-hang
:fix/blog-cache-staleness
:fix/workflows
:gitea/workflows
:echo-acoustic-ranging
:chess-ui-overhaul
:feature/customChessEngine
:feature/blog
:AddProject
:feature/generalUpdate
:tech-debt/chess-cleanup
:tests/CreatePlaywrightTests
:UpdateParticleSimulatorButton
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
I'd run out of things I could find by auditing the UI, so I took the prompt's suggestion and read what people who actually run home games complain about. The recurring problem isn't a dealing mistake, it's a banking one:
Every chip on the table is a promise to pay cash for it later. Nothing in here checked that the promise could be kept — and you can't notice by eye. It's always a rebuy nobody wrote down, or chips taken without paying, and it stays silent until the box is empty and two people are still holding chips. Stacked on #49.
The books now add up, or say why not
HoldemState.bankReconciliationcompares cash taken in against every chip that could be handed back — stacks, chips in front of players, and the pot waiting to be won. The sidebar shows both numbers and what they mean:Money in the middle counts as chips in play, so an open pot isn't reported as a shortfall — otherwise it would cry wolf during almost every hand.
Players who had bought in were missing from the settle-up
sessionStandingswas built from the hand log, so anybody not yet in a recorded hand didn't appear at all. Somebody hands over $200, sits down, folds a few — and the banker's own record doesn't mention them. Then they turn up at cash-out holding chips the list never accounted for.Anyone with money in the game is in the list now, whether or not they've played a logged hand, and their row reads as level rather than as a loss.
The settle-up number was already computed and hidden
cashPosition— chips in front of them less the cash they handed over — was calculated for every player and written to the CSV, but never shown on screen. It's the number you read while counting out cash at the end of the night, so it's a column now.Validation
15 new tests (127 total, all passing): a buy-in with no hands played appears and reads as level; empty chairs stay out; a player who cashed out shows what they took; both directions of imbalance are caught; an open pot is not a discrepancy; six played-and-settled hands never knock the books out; a proper rebuy balances while a chip grab doesn't; float dust isn't an alarm.
Playwright through real play — seated → blinds posted → pot open → hand settled → $100 rebuy — balanced at every step, plus the three seeded verdicts above and a fresh table where the panel stays hidden. No console errors.
Scope note
This adds nothing to configure and no new panel to manage — it surfaces data the model already computed and fixes a gap in who gets counted. It passes the test I've been applying to anything feature-shaped: does it shorten the path to an answer while running the game? Settling up at 2am is exactly that moment.
Sources: How to Run a Poker Home Game, How to Handle Poker Buy-Ins With Friends
Ran out of things I could find by auditing the UI, so I went and read what people who run home games actually complain about. The recurring one isn't a dealing mistake, it's a banking one: "the last two guys go to cash out at the end of some all-night game and there isn't enough cash to cover the chips they have." Every chip on the table is a promise to pay cash for it later. Nothing in here checked that the promise could be kept, and there's no way to notice by eye — it's always a rebuy nobody wrote down, or chips taken without paying, and it stays silent until the box is empty and two people are still holding chips. The books now add up, or say why not HoldemState.bankReconciliation compares the cash taken in against every chip that could be handed back — stacks, chips in front of players, and the pot waiting to be won. The sidebar shows both numbers and what they mean: Balanced — the cash covers every chip on the table. $160 more in chips than cash taken. Someone's rebuy probably wasn't recorded — the box will be short at cash-out. $150 more cash than chips in play. Someone has paid for chips they haven't been given. Money in the middle counts as chips in play, so an open pot isn't reported as a shortfall — otherwise it would cry wolf during almost every hand. Players who had bought in were missing from the settle-up sessionStandings was built from the hand log, so anybody who hadn't yet been in a recorded hand didn't appear at all. Somebody hands over $200, sits down, folds a few, and the banker's own record doesn't mention them — then they turn up at cash-out holding chips the list never accounted for. Anyone with money in the game is in the list now, whether or not they've played a logged hand. The settle-up number was already being computed and hidden cashPosition — chips in front of them less the cash they handed over — was calculated for every player and written to the CSV, but never shown on screen. It's the number you read while counting out cash at the end of the night, so it's a column now. 15 tests (127 total): a buy-in with no hands played still appears and reads as level rather than a loss, empty chairs stay out, a player who cashed out shows what they took, both directions of imbalance are caught, an open pot is not a discrepancy, six played-and-settled hands never knock the books out, a proper rebuy balances while a chip grab doesn't, and float dust isn't an alarm. Validated with Playwright through real play — seated, blinds posted, pot open, hand settled, rebuy — balanced at every step, plus the three seeded verdicts and a fresh table where the panel stays hidden. Sources: pokerlistings.com/blog/how-to-run-a-home-poker-game, chipsoffury.com/learn/how-to-handle-poker-buy-ins-with-friends/ Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgbPull request closed