Count the chips the table is actually playing with #111

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-default-stack-buyin into feat/casino-holdem-waiting-list
Owner

"Starting stack" is how a night opens. The setup panel offers it and says what it means — "seats without their own stack start here" — and everything a dealer looks at reads it: the puck, the action bar, what a player is allowed to bet.

The money side didn't. The bank check and the standings read seat.stack directly, which is null for exactly those seats.

Three-handed table, $200 starting stack, nobody's own stack typed in Before After
What the felt plays for $600 $600
Bank check: chips in play $0 $600
Bank check verdict "Balanced" "$600 more in chips than cash taken. Ann, Ben and Cal are holding chips with no buy-in written down."
Standings — the list a dealer settles from empty all three, holding $200 each

Three players, six hundred dollars, and the tool's own accounting said the table was empty and everything was fine.

Both now ask the same question the felt asks. Empty chairs are excluded, or the starting stack would make every one of them look like somebody holding $200 — a ten-seat table would have opened with $2,000 of imaginary chips.

Being told is only half of it

The verdict names the seats instead of saying "somebody's rebuy probably wasn't recorded", because the dealer's next move is to go to a particular chair and the tool knows which one.

And the seats holding the table's starting stack — the dealer's own instruction, said once in the setup panel — can be written down in one tap instead of six trips through Add chips: "Take $600 from 3 players", behind a confirm that lists them and says "only do this if the cash is actually in the box". Only those seats: what somebody's forgotten rebuy was is a question only the dealer can answer, and guessing it would be the tool inventing money — which is the fault this round is about.

Validated

  • Walked through the browser from a cleared table: set the starting stack, name three seats → panel reads "$600 more in chips than cash taken" with the three names and the button; tap it, confirm, and it's balanced with the buy-ins recorded and Undo offered.
  • 182 audits across 13 viewports, mouse and thumb, in both the owing and settled states plus every overlay: clean, no console errors.
  • 14 new tests, suite at 555, 0 failures. The stack source and the empty-chair test were broken on purpose to confirm the tests catch both — the second one matters, since without it the fix would have invented $2,000 at an empty table.
**"Starting stack" is how a night opens.** The setup panel offers it and says what it means — *"seats without their own stack start here"* — and everything a dealer looks at reads it: the puck, the action bar, what a player is allowed to bet. The money side didn't. The bank check and the standings read `seat.stack` directly, which is **null for exactly those seats**. | Three-handed table, $200 starting stack, nobody's own stack typed in | Before | After | |---|---|---| | What the felt plays for | $600 | $600 | | Bank check: chips in play | **$0** | $600 | | Bank check verdict | **"Balanced"** | *"$600 more in chips than cash taken. Ann, Ben and Cal are holding chips with no buy-in written down."* | | Standings — the list a dealer settles from | **empty** | all three, holding $200 each | Three players, six hundred dollars, and the tool's own accounting said the table was empty and everything was fine. Both now ask the same question the felt asks. **Empty chairs are excluded**, or the starting stack would make every one of them look like somebody holding $200 — a ten-seat table would have opened with $2,000 of imaginary chips. ### Being told is only half of it The verdict **names the seats** instead of saying "somebody's rebuy probably wasn't recorded", because the dealer's next move is to go to a particular chair and the tool knows which one. And the seats holding the table's starting stack — the dealer's own instruction, said once in the setup panel — can be written down in **one tap** instead of six trips through Add chips: *"Take $600 from 3 players"*, behind a confirm that lists them and says "only do this if the cash is actually in the box". Only those seats: what somebody's forgotten rebuy was is a question only the dealer can answer, and guessing it would be the tool inventing money — which is the fault this round is about. ### Validated - Walked through the browser from a cleared table: set the starting stack, name three seats → panel reads *"$600 more in chips than cash taken"* with the three names and the button; tap it, confirm, and it's balanced with the buy-ins recorded and Undo offered. - **182 audits** across 13 viewports, mouse and thumb, in both the owing and settled states plus every overlay: clean, no console errors. - 14 new tests, suite at **555, 0 failures**. The stack source and the empty-chair test were broken on purpose to confirm the tests catch both — the second one matters, since without it the fix would have invented $2,000 at an empty table.
jheaps added 1 commit 2026-09-02 08:53:28 -06:00
"Starting stack" is how a night opens. The setup panel offers it and says what it
means — "seats without their own stack start here" — and everything a dealer
looks at reads it: the puck, the action bar, what a player is allowed to bet.

The money side didn't. The bank check and the standings read `seat.stack`
directly, which is null for exactly those seats. Measured on a three-handed table
with a $200 starting stack and nobody's own stack typed in: the felt played for
$600, the bank check reported no chips in play and pronounced itself balanced,
and the standings — the list a dealer settles the night from — listed nobody at
all. Three players, six hundred dollars, and the tool's own accounting said the
table was empty.

Both now ask the same question the felt asks. The check reports $600 in play
against nothing taken, which is the truth: those chips have not been paid for.
Empty chairs are excluded, or the starting stack would make every one of them
look like somebody holding two hundred dollars — a ten-seat table would have
opened with $2,000 of imaginary chips.

Being told is only half of it. The verdict names the seats rather than saying
"somebody's rebuy probably wasn't recorded", because the dealer's next move is to
go to a particular chair and the tool knows which. And the seats holding the
table's starting stack — the dealer's own instruction, said once in the setup
panel — can be written down in one tap instead of six trips through Add chips.
Only those: what somebody's forgotten rebuy was is a question only the dealer can
answer, and guessing it would be the tool inventing money, which is the fault
this round is about.

14 new tests, with the stack source and the empty-chair test broken on purpose to
confirm they fail. Walked through in the browser from a cleared table: set the
starting stack, name three seats, and the panel goes from "balanced, no chips" to
"$600 more in chips than cash taken. Ann, Ben and Cal are holding chips with no
buy-in written down" — then to balanced, with the buy-ins recorded and undoable.

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:58:08 -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#111