Files
pokerfreak/docs/VERTRAG.md
T
mmintel af711eafd1 vertrag: PLO4/PLO6/SHORT_DECK als variant, Short-Deck-Rangfolge, AOF-Overlay
variant nennt die fehlenden Kernnamen (PLO4, PLO6, SHORT_DECK samt 6+-Alias). Vermerkt: Short Deck
bedeutet die umgedrehte Rangfolge (Flush schlaegt Full House), der Kern kann das schon; AOF ist
eine binaere Ueberlagerung ueber der Basisart (nur FOLD/RAISE, legalActions massgeblich).
2026-11-03 18:26:28 +01:00

68 lines
2.7 KiB
Markdown

# Contract: Offline Poker Decision Core
Purpose: a **pure decision engine**. One JSON in, one JSON out - it knows no table, no clock,
no window. Nothing else needs to be known.
## Interface
* **stdin**: one JSON object per line — one decision request.
* **stdout**: one JSON object per line — the decision.
* No prompts, no logging on stdout, **no external dependencies** (standard library only).
* Language: your choice — Python or Rust preferred. The JSON contract is what counts.
## Request (exact field names)
```json
{
"variant": "NLHE",
"bigBlind": 0.1,
"seats": 6,
"heroSeat": 5,
"heroCards": [{"rank": "A", "suit": "HEARTS"}, {"rank": "5", "suit": "HEARTS"}],
"board": {"FLOP": [{"rank": "A", "suit": "CLUBS"}], "TURN": null, "RIVER": null},
"street": "FLOP",
"pot": 1.25,
"toCall": 0.2,
"heroStack": 2.4,
"minRaiseTo": 0.5,
"maxRaiseTo": 20.0,
"legalActions": ["FOLD", "CALL", "RAISE"],
"allowedSizes": [0.5, 1.15, 4.6],
"villains": [{"seat": 2, "stack": 10.4, "folded": false}]
}
```
* `rank` values: `TWO … TEN, JACK, QUEEN, KING, ACE`; `suit` values: `CLUBS, DIAMONDS, HEARTS, SPADES`.
* `board` streets are `null` or a list of cards.
* `legalActions` is authoritative — nothing outside it may be returned.
* `allowedSizes` is optional (given by the client in some formats); when present, a raise size
must be one of these values.
* `variant` values: `NLHE`, `PLO4`, `PLO5`, `PLO6`, `SHORT_DECK` (alias `6+`), `K_POKER`, `AOF`.
* `SHORT_DECK` (Texas Six Plus): a 36-card deck, sixes and ace low — so the ranking is upside
down, a **flush beats a full house**; the core already ranks it that way.
* `AOF` (All-in or Fold) is a binary overlay, not a base game: keep the base variant (`NLHE` or
`PLO4`) and restrict `legalActions` to `FOLD` and `RAISE` (the raise is the whole stack). The
field is authoritative, so this needs no separate variant.
## Response
```json
{"action": "CALL", "size": null, "confidence": 0.72, "reason": "top pair, good price"}
```
* `action`: `FOLD`, `CHECK`, `CALL`, `RAISE` or **`ABSTAIN`**.
* `size`: the total amount for a raise, otherwise `null`.
* `confidence`: `0..1`.
* `ABSTAIN` means: the engine is not sure — the caller decides what to do.
## Requirements
1. Pure functions only; stdlib only.
2. Never return an action outside `legalActions`.
3. Preflop: chart-based, by position and action sequence.
4. Postflop: equity (Monte-Carlo is fine), pot odds, expected value per legal action.
5. `K_POKER`: if `allowedSizes` is present, pick from it and never invent a size.
6. `AOF`: binary decision only.
7. Include a test suite that runs offline, plus one CLI entry point.
8. Only maths. It knows no table, no window, no clock - nothing else needs to be known.