Take the chips the pot was priced with, not just pay them out #113

Closed
jheaps wants to merge 1 commits from fix/casino-holdem-contribution-rule into fix/casino-holdem-one-stack-rule
Owner

Two rounds of asking where the tool disagrees with itself, and here is the last of it — the one that was actually creating money.

There are two ways a contribution gets in. Tapping the action moves chips: the bet leaves the stack, sits in front of the player, and is swept into their hand total. The other is the "without live betting" panel — a base pot amount, or chips counted out on a seat — for a dealer recording a hand they're watching rather than driving. Nothing leaves anybody's stack there.

The pot wizard prices both the same way, and awarding it credits the winner. So in the second mode the table simply grew:

Three-handed, $50 base pot Before After (old) After (now)
Stacks 200 / 200 / 200 350 / 200 / 200 300 / 150 / 150
Chips on the table $600 $750 $600
Bank check balanced "$150 more in chips than cash taken" balanced

Six hundred dollars of chips became seven hundred and fifty, and the bank check — newly able to see it after #111 — blamed a rebuy nobody had made.

So before the pot is pushed, whatever was assumed rather than taken comes off the stacks that assumed it, recorded where a swept bet lives. Chips already committed or swept are left alone: they have been paid once, and taking them twice is the same bug the other way round. A base pot on top of a live bet collects only the difference. Nobody is charged more than they're holding, and an empty chair or a seat sitting out is charged nothing.

Validated

  • Walked through the UI in base-pot mode: pot badge $150, wizard pricing three seats at "up to $50" each, and afterwards stacks 300 / 150 / 150 with chips on the table still $600 and the bank balanced. The hand log reads pot 150 → Ann 150.
  • The bank check is balanced before, during and after — the chips move to the middle rather than vanishing.
  • A live-betting hand is untouched by any of this, which is pinned by its own test.
  • 40 audits across 10 viewports, mouse and thumb, including the pot wizard: clean, no console errors.
  • 13 new tests, suite at 578, 0 failures. The already-paid check was disabled on purpose; five tests catch the resulting double charge.
Two rounds of asking where the tool disagrees with itself, and here is the last of it — the one that was actually **creating money**. There are two ways a contribution gets in. Tapping the action moves chips: the bet leaves the stack, sits in front of the player, and is swept into their hand total. The other is the **"without live betting"** panel — a base pot amount, or chips counted out on a seat — for a dealer recording a hand they're watching rather than driving. Nothing leaves anybody's stack there. The pot wizard prices both the same way, and awarding it credits the winner. So in the second mode **the table simply grew**: | Three-handed, $50 base pot | Before | After (old) | After (now) | |---|---|---|---| | Stacks | 200 / 200 / 200 | **350 / 200 / 200** | 300 / 150 / 150 | | Chips on the table | $600 | **$750** | $600 | | Bank check | balanced | *"$150 more in chips than cash taken"* | balanced | Six hundred dollars of chips became seven hundred and fifty, and the bank check — newly able to see it after #111 — blamed a rebuy nobody had made. **So before the pot is pushed, whatever was assumed rather than taken comes off the stacks that assumed it**, recorded where a swept bet lives. Chips already committed or swept are left alone: they have been paid once, and taking them twice is the same bug the other way round. A base pot on top of a live bet collects only the difference. Nobody is charged more than they're holding, and an empty chair or a seat sitting out is charged nothing. ### Validated - Walked through the UI in base-pot mode: pot badge **$150**, wizard pricing three seats at *"up to $50"* each, and afterwards stacks **300 / 150 / 150** with chips on the table still **$600** and the bank balanced. The hand log reads pot 150 → Ann 150. - The bank check is balanced **before, during and after** — the chips move to the middle rather than vanishing. - A live-betting hand is untouched by any of this, which is pinned by its own test. - 40 audits across 10 viewports, mouse and thumb, including the pot wizard: clean, no console errors. - 13 new tests, suite at **578, 0 failures**. The already-paid check was disabled on purpose; five tests catch the resulting double charge.
jheaps added 1 commit 2026-09-02 09:21:49 -06:00
Two rounds of asking where the tool disagrees with itself, and here is the last
of it — the one that was actually creating money.

There are two ways a contribution gets in. Tapping the action moves chips: the
bet leaves the stack, sits in front of the player, and is swept into their hand
total. The other is the "without live betting" panel — a base pot amount, or
chips counted out on a seat — for a dealer recording a hand they are watching
rather than driving. Nothing leaves anybody's stack there.

The pot wizard prices both the same way, and awarding it credits the winner. So
in the second mode the table simply grew. Measured at a three-handed table with a
$50 base pot: stacks 200, 200, 200 before, pot priced at $150, and afterwards
350, 200, 200 — six hundred dollars of chips became seven hundred and fifty, and
the bank check, newly able to see it, blamed a rebuy nobody had made.

So before the pot is pushed, whatever was assumed rather than taken comes off the
stacks that assumed it, and is recorded where a swept bet lives. Chips already
committed or swept are left alone — they have been paid once, and taking them
twice is the same bug the other way round. A base pot on top of a live bet
collects only the difference. Nobody is charged more than they are holding, and
an empty chair or a seat sitting out is charged nothing at all.

The same hand now ends 300, 150, 150: the table has the six hundred it started
with, and the bank check is balanced before, during and after.

13 new tests, with the already-paid test disabled on purpose to confirm five of
them catch the double charge. Walked through the UI in base-pot mode: pot badge
$150, wizard pricing three seats at $50 each, and afterwards the felt holding
exactly what it held before.

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:09 -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#113