# holdem-sng-3-v4

## Status and Authority

This is the normative Poker V4 ruleset contract for a three-player no-limit
Texas Hold'em Sit & Go. Available V4 deployments instantiate this immutable
ruleset. Once deployed under this identifier, its gameplay values are
immutable. A rule change requires a new identifier.

The server is the sole authority for shuffling, dealing, legal actions,
deadlines, betting, pots, awards, elimination, and final placement.

## Format

- Exactly three distinct identities start the game.
- Each starts with 500 chips; the table total is 1,500 chips.
- Chips are indivisible non-negative integers.
- There are no rebuys, add-ons, late entries, or voluntary cash-outs.
- The game ends when exactly one participant has chips.
- Positions are first, second, and third. There is no monetary payout in this
  protocol contract.

## Blind Schedule

Levels advance by completed hand number, never elapsed wall time.

| Hands | Small blind | Big blind |
|---|---:|---:|
| 1-10 | 5 | 10 |
| 11-20 | 10 | 20 |
| 21-30 | 20 | 40 |
| 31-40 | 40 | 80 |
| 41-50 | 80 | 160 |
| 51 onward | 160 | 320 |

A blind is capped by the participant's stack and may therefore be all-in.

## Deal and Betting

- A cryptographically secure server shuffle produces one 52-card deck per hand.
- Standard Hold'em streets are `preflop`, `flop`, `turn`, and `river`.
- Standard no-limit actions are `fold`, `check`, `call`, `bet`, `raise`, and
  `all_in`, subject to the server's offered legal actions.
- For `bet` and `raise`, `amount` is the player's target total contribution on
  the current street, not the increment.
- An all-in below a full minimum raise does not reopen betting for a player whose
  action was already complete, according to standard no-limit rules.
- If no further decisions are possible, the server runs out the board.

## Button and Heads-Up

The first button and seats are selected by an unbiased server procedure. The
button advances clockwise to the next participant with chips after each hand.
With two participants, the button posts the small blind, acts first preflop, and
acts last after the flop.

## Pots and Showdown

- Main and side pots are formed from actual committed contributions.
- Folded participants are not eligible to win.
- A participant in persistent auto-fold abandonment is not eligible to win.
- Each eligible player uses the best five-card hand from seven available cards.
- Hand ranking is the standard order: high card, pair, two pair, three of a
  kind, straight, flush, full house, four of a kind, straight flush.
- Tied pots split equally. Odd chips are awarded clockwise beginning with the
  first tied winner left of the button.
- Only cards needed to establish an awarded showdown hand are public after hand
  completion; folded hole cards remain private.

## Clock and Automatic Action

Each game has one immutable `action_clock_ms` derived by the server from its
participants' declared controller types: 15,000 ms for bot-only tables and
45,000 ms whenever a human or agent participates (ADR 0004/0005). V4 has no
measured, client-chosen, or variable clocks. The server records UTC turn start
and deadline with microsecond precision.

- Before the deadline, a valid player action may consume the turn.
- At or after the exact deadline, timeout processing wins.
- First and second consecutive timeout: `check` when legal, otherwise `fold`.
- Third consecutive timeout: set persistent auto-fold and force `fold`, even
  when `check` is legal.
- A valid voluntary action resets consecutive timeouts, not lifetime totals.

The first mutation that observes an expired deadline applies the automatic
action inside its transaction. Concurrent requests cannot apply it twice.

## Abandonment and Recovery

Persistent auto-fold is not elimination. The participant continues posting
blinds and can lose all chips but cannot win a pot while auto-folded.
Authenticated recovery may be requested during a hand; it is queued and takes
effect only at the next boundary between hands. Recovery does not alter the
current actor or deadline, resets consecutive timeouts, and is unavailable at
zero chips.

## Invariants

After every committed transition:

- No card appears twice.
- No stack, contribution, or pot is negative.
- Stacks plus all committed chips equal 1,500.
- Awards equal the pots being awarded.
- At most one participant is the actor.
- A finished game has exactly one participant with chips.
- If simultaneous elimination produces equal final stacks, lower seat number
  receives the better persisted finish position. This deterministic tie-break is
  not a poker pot-award rule.