2.3 KiB
2.3 KiB
Contract: Offline Poker Decision Core
Purpose: a pure decision engine. No client, no network, no poker-room rules. Input is JSON, output is JSON. 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)
{
"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}]
}
rankvalues:TWO … TEN, JACK, QUEEN, KING, ACE;suitvalues:CLUBS, DIAMONDS, HEARTS, SPADES.boardstreets arenullor a list of cards.legalActionsis authoritative — nothing outside it may be returned.allowedSizesis optional (given by the client in some formats); when present, a raise size must be one of these values.variantvalues:NLHE,PLO5,K_POKER,AOF.
Response
{"action": "CALL", "size": null, "confidence": 0.72, "reason": "top pair, good price"}
action:FOLD,CHECK,CALL,RAISEorABSTAIN.size: the total amount for a raise, otherwisenull.confidence:0..1.ABSTAINmeans: the engine is not sure — the caller decides what to do.
Requirements
- Pure functions only; stdlib only.
- Never return an action outside
legalActions. - Preflop: chart-based, by position and action sequence.
- Postflop: equity (Monte-Carlo is fine), pot odds, expected value per legal action.
K_POKER: ifallowedSizesis present, pick from it and never invent a size.AOF: binary decision only.- Include a test suite that runs offline, plus one CLI entry point.
- No discussion about rooms, tools, HUDs, terms of service or detection. Only maths.