diff --git a/docs/notizen/PLAN-weltklasse.md b/docs/notizen/PLAN-weltklasse.md index 1c29c5a5..bbe3a9de 100644 --- a/docs/notizen/PLAN-weltklasse.md +++ b/docs/notizen/PLAN-weltklasse.md @@ -49,6 +49,7 @@ gegen 21,5 %. Sie mit dünnen echten Zahlen zu eichen, ersetzt eine Annahme durc | Darf eine Ausnutzung live? | Gewinn gegen den Typ, den sie liest, und LBR-Anstieg ≤ 5 bb/100 | nur der Typ, den sie selbst annimmt; liegt der Read falsch, kostet es höchstens das Budget | | Gewinnt sie echtes Geld? | Live bb/100 mit All-in-EV und AIVAT (Glückskorrektur je Hand) | keine: echte Hände | | Spielt sie echte Spots richtig? | Live-Fixture: geloggte Turn/River-Spots plus nachgebaute Flop-Spots (`lesen/rueckbau.py`), als Spec festgehalten (`tests/live_lecks_spec.py`) | keine: echte Spots; sagt, welche Entscheidung sich ändert, nicht ob sie gewinnt | +| Spielt sie bekannte Fehler nicht wieder? (**Torbedingung**, Owner 16.11.) | Pflichtfälle: eindeutige echte Fehlentscheidungen mit Soll-Aktion (`tests/live_fixture/pflicht.jsonl`, keine Cooler), geprüft mit `werkzeuge/pflichtfaelle.py --arm ""` (Kern-Kopie, Idle, ein Prozess) | keine: echte Spots, Soll von Hand begründet. **Harter Verlierer**, wenn der Kandidat einen Fall schlechter spielt als der Live-Stand oder die Soll-Aktion verfehlt; `toleriert` (z. B. Turn-Call, wenn der River foldet) ist kein Fehler | | Ist etwas kaputt? | Sim-Leiter, gepaart | Regressionstest: fängt Abstürze, Unsinn, Rückschritte; ein Leiterverlust ist ein Warnsignal, kein Urteil | Grenze: LBR gibt es nur, wo die Grundstrategie gerechnet ist (Button gegen Big Blind, einfach erhöhter @@ -219,7 +220,8 @@ sich also die Zeit. Live hat Vorrang. ## 7. Regeln 1. Nie einen gemessenen Verlierer ausliefern. Verlierer heißt (Messregel 1a): LBR steigt über das Budget, oder - die Live-Obergrenze liegt unter 0, oder die Leiter zeigt einen Absturz. Ein kleiner Leiterverlust allein + die Live-Obergrenze liegt unter 0, oder die Leiter zeigt einen Absturz, oder der Kandidat besteht die + Pflichtfälle nicht (Messregel 1a, `werkzeuge/pflichtfaelle.py`, Ausgang ≠ 0). Ein kleiner Leiterverlust allein gegen einen synthetischen Gegner ist ein Warnsignal, das am LBR geprüft wird. 2. Jeder Schritt hat genau ein Tor. Nach einem sauberen, gescheiterten Versuch wird gestoppt. 3. Ergebnisse gehen in `STAND-weltklasse.md`, in Zahlen, auch die schlechten — **im selben Arbeitsschritt**, diff --git a/tests/live_fixture/pflicht.jsonl b/tests/live_fixture/pflicht.jsonl new file mode 100644 index 00000000..084cd693 --- /dev/null +++ b/tests/live_fixture/pflicht.jsonl @@ -0,0 +1,14 @@ +{"id": "773f841033aab2bd", "hand": "178593300919", "datum": "2026-11-16", "street": "TURN", "spot": "9d9h | 4h7d8s Jc | TURN toCall 0.66 Pot 1.32", "live_aktion": "CALL", "live_grund": "middle pair with gutshot on dry board: equity 0.40 vs break-even 0.35, EV call +0.08", "soll": ["FOLD"], "toleriert": ["CALL"], "warum": "99 im gesqueezten Pot (BB callt 3-Bet), Squeezer setzt Flop und Turn Pot; 99 ist auf 478J nur Mittelpaar. Fold am Turn; Call nur toleriert, wenn der River foldet.", "netto_bb": -93.0, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 6, "heroSeat": 1, "heroCards": [{"rank": "NINE", "suit": "DIAMONDS"}, {"rank": "NINE", "suit": "HEARTS"}], "board": {"FLOP": [{"rank": "FOUR", "suit": "HEARTS"}, {"rank": "SEVEN", "suit": "DIAMONDS"}, {"rank": "EIGHT", "suit": "SPADES"}], "TURN": [{"rank": "JACK", "suit": "CLUBS"}]}, "street": "TURN", "pot": 1.32, "toCall": 0.66, "heroStack": 1.55, "minRaiseTo": 1.32, "maxRaiseTo": 1.55, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 2, "stack": 2.71, "folded": true, "profile": {"vpip": 0.3, "pfr": 0.21, "foldToBet": 0.71, "cbet": 0.54, "foldToCbet": 0.27, "threeBet": 0.1, "foldToThreeBet": 0.66, "steal": 0.37, "checkRaise": 0.02, "wtsd": 0.34, "wsd": 0.53, "hands": 24}}, {"seat": 3, "stack": 1.76, "folded": true, "profile": {"vpip": 0.26, "pfr": 0.2, "foldToBet": 0.75, "cbet": 0.59, "foldToCbet": 0.28, "threeBet": 0.1, "foldToThreeBet": 0.65, "steal": 0.39, "checkRaise": 0.07, "wtsd": 0.34, "wsd": 0.59, "hands": 27, "reads": {"raiseToBet": {"n": 2, "k": 0}}}}, {"seat": 4, "stack": 2.0, "folded": true, "profile": {"vpip": 0.23, "pfr": 0.14, "foldToBet": 0.32, "cbet": 0.41, "foldToCbet": 0.51, "threeBet": 0.03, "foldToThreeBet": 0.45, "steal": 0.3, "checkRaise": 0.01, "wtsd": 0.33, "wsd": 0.65, "hands": 29, "reads": {"raiseToBet": {"n": 6, "k": 0}}}}, {"seat": 5, "stack": 3.55, "folded": true, "profile": {"vpip": 0.39, "pfr": 0.2, "foldToBet": 0.54, "cbet": 0.52, "foldToCbet": 0.4, "threeBet": 0.06, "foldToThreeBet": 0.23, "steal": 0.38, "checkRaise": 0.05, "wtsd": 0.32, "wsd": 0.48, "hands": 24, "reads": {"raiseToBet": {"n": 2, "k": 0}}}}, {"seat": 6, "stack": 1.02, "folded": false, "profile": {"vpip": 0.39, "pfr": 0.2, "foldToBet": 0.61, "cbet": 0.56, "foldToCbet": 0.3, "threeBet": 0.04, "foldToThreeBet": 0.31, "steal": 0.37, "checkRaise": 0.05, "wtsd": 0.3, "wsd": 0.41, "hands": 25, "reads": {"raiseToBet": {"n": 10, "k": 2}, "reraiseToRaise": {"n": 2, "k": 0}}}}], "history": [{"street": "PREFLOP", "seat": 6, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 1, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 2, "action": "FOLD"}, {"street": "PREFLOP", "seat": 3, "action": "RAISE", "amount": 0.04}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 6, "action": "RAISE", "amount": 0.09}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.09}, {"street": "PREFLOP", "seat": 3, "action": "FOLD"}, {"street": "FLOP", "seat": 6, "action": "BET", "amount": 0.22}, {"street": "FLOP", "seat": 1, "action": "CALL", "amount": 0.22}, {"street": "TURN", "seat": 6, "action": "BET", "amount": 0.66}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6}}} +{"id": "739f6402451ae555", "hand": "178593300919", "datum": "2026-11-16", "street": "RIVER", "spot": "9d9h | 4h7d8s Jc 7h | RIVER toCall 0.89 Pot 3.0", "live_aktion": "CALL", "live_grund": "two pair on medium board: equity 0.35 vs break-even 0.24, EV call +0.39", "soll": ["FOLD"], "toleriert": [], "warum": "Dritter Pot-Einsatz (All-in) des Squeezers auf 478J7: die Zwei Paare sind nur das Brett-Paar, geschlagen von jeder Value-Hand. Spaetestens hier Fold.", "netto_bb": -93.0, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 6, "heroSeat": 1, "heroCards": [{"rank": "NINE", "suit": "DIAMONDS"}, {"rank": "NINE", "suit": "HEARTS"}], "board": {"FLOP": [{"rank": "FOUR", "suit": "HEARTS"}, {"rank": "SEVEN", "suit": "DIAMONDS"}, {"rank": "EIGHT", "suit": "SPADES"}], "TURN": [{"rank": "JACK", "suit": "CLUBS"}], "RIVER": [{"rank": "SEVEN", "suit": "HEARTS"}]}, "street": "RIVER", "pot": 3.0, "toCall": 0.89, "heroStack": 0.89, "legalActions": ["FOLD", "CALL"], "villains": [{"seat": 2, "stack": 2.71, "folded": true, "profile": {"vpip": 0.3, "pfr": 0.21, "foldToBet": 0.71, "cbet": 0.54, "foldToCbet": 0.27, "threeBet": 0.1, "foldToThreeBet": 0.66, "steal": 0.37, "checkRaise": 0.02, "wtsd": 0.34, "wsd": 0.53, "hands": 23}}, {"seat": 3, "stack": 1.76, "folded": true, "profile": {"vpip": 0.26, "pfr": 0.2, "foldToBet": 0.75, "cbet": 0.59, "foldToCbet": 0.28, "threeBet": 0.1, "foldToThreeBet": 0.65, "steal": 0.39, "checkRaise": 0.07, "wtsd": 0.34, "wsd": 0.59, "hands": 26, "reads": {"raiseToBet": {"n": 2, "k": 0}}}}, {"seat": 4, "stack": 2.0, "folded": true, "profile": {"vpip": 0.23, "pfr": 0.14, "foldToBet": 0.32, "cbet": 0.41, "foldToCbet": 0.51, "threeBet": 0.03, "foldToThreeBet": 0.45, "steal": 0.3, "checkRaise": 0.01, "wtsd": 0.33, "wsd": 0.65, "hands": 28, "reads": {"raiseToBet": {"n": 6, "k": 0}}}}, {"seat": 5, "stack": 3.55, "folded": true, "profile": {"vpip": 0.39, "pfr": 0.2, "foldToBet": 0.54, "cbet": 0.52, "foldToCbet": 0.4, "threeBet": 0.06, "foldToThreeBet": 0.23, "steal": 0.38, "checkRaise": 0.05, "wtsd": 0.32, "wsd": 0.48, "hands": 24, "reads": {"raiseToBet": {"n": 2, "k": 0}}}}, {"seat": 6, "stack": 0.0, "folded": false, "profile": {"vpip": 0.39, "pfr": 0.2, "foldToBet": 0.61, "cbet": 0.56, "foldToCbet": 0.3, "threeBet": 0.04, "foldToThreeBet": 0.31, "steal": 0.37, "checkRaise": 0.05, "wtsd": 0.3, "wsd": 0.41, "hands": 25, "reads": {"raiseToBet": {"n": 10, "k": 2}, "reraiseToRaise": {"n": 2, "k": 0}}}}], "history": [{"street": "PREFLOP", "seat": 6, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 1, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 2, "action": "FOLD"}, {"street": "PREFLOP", "seat": 3, "action": "RAISE", "amount": 0.04}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 6, "action": "RAISE", "amount": 0.09}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.09}, {"street": "PREFLOP", "seat": 3, "action": "FOLD"}, {"street": "FLOP", "seat": 6, "action": "BET", "amount": 0.22}, {"street": "FLOP", "seat": 1, "action": "CALL", "amount": 0.22}, {"street": "TURN", "seat": 6, "action": "BET", "amount": 0.66}, {"street": "TURN", "seat": 1, "action": "CALL", "amount": 0.66}, {"street": "RIVER", "seat": 6, "action": "ALL_IN", "amount": 1.02}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6}}} +{"id": "ef4a16236c1d388b", "hand": "177599200076", "datum": "2026-11-14", "street": "RIVER", "spot": "7cTh | 4c2d7s 6h Js | RIVER toCall 0.39 Pot 1.88", "live_aktion": "CALL", "live_grund": "MDF-Boden: Made-Hand verteidigt - Modell-Fold uebersteuert (break-even 0.17)", "soll": ["FOLD"], "toleriert": [], "warum": "MDF-Boden uebersteuert den Modell-Fold gegen einen ungelesenen Micro-Gegner: Equity 0.091 gegen Break-even 0.17. Micro-Gegner bluffen den River nicht genug.", "netto_bb": -55.5, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 6, "heroSeat": 2, "heroCards": [{"rank": "SEVEN", "suit": "CLUBS"}, {"rank": "TEN", "suit": "HEARTS"}], "board": {"FLOP": [{"rank": "FOUR", "suit": "CLUBS"}, {"rank": "TWO", "suit": "DIAMONDS"}, {"rank": "SEVEN", "suit": "SPADES"}], "TURN": [{"rank": "SIX", "suit": "HEARTS"}], "RIVER": [{"rank": "JACK", "suit": "SPADES"}]}, "street": "RIVER", "pot": 1.88, "toCall": 0.39, "heroStack": 1.45, "legalActions": ["FOLD", "CALL"], "villains": [{"seat": 1, "stack": 1.37, "folded": true, "profile": {"vpip": 0.38, "pfr": 0.25, "foldToBet": 0.68, "cbet": 0.45, "foldToCbet": 0.29, "threeBet": 0.1, "foldToThreeBet": 0.14, "steal": 0.45, "checkRaise": 0.07, "wtsd": 0.46, "wsd": 0.51, "hands": 22, "aggression": 0.3333333333333333, "aggressionActions": 3, "turnAggression": 1.0, "turnAggressionActions": 1, "flopFoldToBet": 1.0, "flopFacingBet": 1}}, {"seat": 3, "stack": 2.08, "folded": true, "profile": {"vpip": 0.2, "pfr": 0.15, "foldToBet": 0.8, "cbet": 0.53, "foldToCbet": 0.15, "threeBet": 0.02, "foldToThreeBet": 0.67, "steal": 0.35, "checkRaise": 0.09, "wtsd": 0.36, "wsd": 0.55, "hands": 23}}, {"seat": 4, "stack": 1.97, "folded": true, "profile": {"vpip": 0.36, "pfr": 0.2, "foldToBet": 0.29, "cbet": 0.51, "foldToCbet": 0.27, "threeBet": 0.09, "foldToThreeBet": 0.27, "steal": 0.44, "checkRaise": 0.18, "wtsd": 0.35, "wsd": 0.41, "hands": 23}}, {"seat": 5, "stack": 0.0, "folded": false, "profile": {"vpip": 0.2, "pfr": 0.1, "foldToBet": 0.55, "cbet": 0.67, "foldToCbet": 0.5, "threeBet": 0.03, "foldToThreeBet": 0.67, "steal": 0.27, "checkRaise": 0.05, "wtsd": 0.29, "wsd": 0.65, "hands": 28, "aggression": 0.75, "aggressionActions": 4, "turnAggression": 1.0, "turnAggressionActions": 1, "riverAggression": 1.0, "riverAggressionActions": 1, "turnFoldToBet": 1.0, "turnFacingBet": 1}}, {"seat": 6, "stack": 13.98, "folded": true, "profile": {"vpip": 0.29, "pfr": 0.16, "foldToBet": 0.59, "cbet": 0.91, "foldToCbet": 0.26, "threeBet": 0.07, "foldToThreeBet": 0.17, "steal": 0.36, "checkRaise": 0.11, "wtsd": 0.3, "wsd": 0.48, "hands": 31}}], "history": [{"street": "PREFLOP", "seat": 1, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 2, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 3, "action": "FOLD"}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "RAISE", "amount": 0.05}, {"street": "PREFLOP", "seat": 6, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.05}, {"street": "PREFLOP", "seat": 2, "action": "CALL", "amount": 0.05}, {"street": "FLOP", "seat": 1, "action": "CHECK"}, {"street": "FLOP", "seat": 2, "action": "CHECK"}, {"street": "FLOP", "seat": 5, "action": "BET", "amount": 0.15}, {"street": "FLOP", "seat": 1, "action": "FOLD"}, {"street": "FLOP", "seat": 2, "action": "CALL", "amount": 0.15}, {"street": "TURN", "seat": 2, "action": "BET", "amount": 0.15}, {"street": "TURN", "seat": 5, "action": "RAISE", "amount": 0.52}, {"street": "TURN", "seat": 2, "action": "CALL", "amount": 0.52}, {"street": "RIVER", "seat": 2, "action": "CHECK"}, {"street": "RIVER", "seat": 5, "action": "ALL_IN", "amount": 0.39}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6}}} +{"id": "f3c5ef9a7465370b", "hand": "177536500401", "datum": "2026-11-14", "street": "RIVER", "spot": "6c6d | 7dTdJc Qh 8s | RIVER toCall 0.2 Pot 0.61", "live_aktion": "CALL", "live_grund": "MDF-Boden: Made-Hand verteidigt - Modell-Fold uebersteuert (break-even 0.25)", "soll": ["FOLD"], "toleriert": [], "warum": "MDF-Boden uebersteuert den Modell-Fold gegen einen ungelesenen Micro-Gegner: Equity 0.004 gegen Break-even 0.25. Micro-Gegner bluffen den River nicht genug.", "netto_bb": -20.0, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 5, "heroSeat": 1, "heroCards": [{"rank": "SIX", "suit": "CLUBS"}, {"rank": "SIX", "suit": "DIAMONDS"}], "board": {"FLOP": [{"rank": "SEVEN", "suit": "DIAMONDS"}, {"rank": "TEN", "suit": "DIAMONDS"}, {"rank": "JACK", "suit": "CLUBS"}], "TURN": [{"rank": "QUEEN", "suit": "HEARTS"}], "RIVER": [{"rank": "EIGHT", "suit": "SPADES"}]}, "street": "RIVER", "pot": 0.61, "toCall": 0.2, "heroStack": 1.85, "minRaiseTo": 0.4, "maxRaiseTo": 1.85, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 2, "stack": 1.0, "folded": true}, {"seat": 3, "stack": 3.19, "folded": false, "profile": {"vpip": 0.36, "pfr": 0.25, "foldToBet": 0.62, "cbet": 0.64, "foldToCbet": 0.31, "threeBet": 0.11, "foldToThreeBet": 0.49, "steal": 0.45, "checkRaise": 0.06, "wtsd": 0.34, "wsd": 0.54, "hands": 23}}, {"seat": 4, "stack": 8.7, "folded": true, "profile": {"vpip": 0.37, "pfr": 0.19, "foldToBet": 0.7, "cbet": 0.69, "foldToCbet": 0.3, "threeBet": 0.09, "foldToThreeBet": 0.24, "steal": 0.4, "checkRaise": 0.17, "wtsd": 0.35, "wsd": 0.54, "hands": 28}}, {"seat": 5, "stack": 2.0, "folded": true, "profile": {"vpip": 0.24, "pfr": 0.19, "foldToBet": 0.68, "cbet": 0.6, "foldToCbet": 0.32, "threeBet": 0.08, "foldToThreeBet": 0.53, "steal": 0.38, "checkRaise": 0.07, "wtsd": 0.33, "wsd": 0.56, "hands": 29}}], "history": [{"street": "PREFLOP", "seat": 2, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 3, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "RAISE", "amount": 0.05}, {"street": "PREFLOP", "seat": 2, "action": "FOLD"}, {"street": "PREFLOP", "seat": 3, "action": "RAISE", "amount": 0.12}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.12}, {"street": "FLOP", "seat": 3, "action": "BET", "amount": 0.08}, {"street": "FLOP", "seat": 1, "action": "CALL", "amount": 0.08}, {"street": "TURN", "seat": 3, "action": "CHECK"}, {"street": "TURN", "seat": 1, "action": "CHECK"}, {"street": "RIVER", "seat": 3, "action": "BET", "amount": 0.2}], "_sitze": {"1": 2, "2": 3, "3": 4, "4": 5, "5": 6}}} +{"id": "eb04c6dcc70ce028", "hand": "177536500403", "datum": "2026-11-14", "street": "RIVER", "spot": "7c7d | Ts3dKc 4s 2h | RIVER toCall 0.38 Pot 1.13", "live_aktion": "CALL", "live_grund": "MDF-Boden: Made-Hand verteidigt - Modell-Fold uebersteuert (break-even 0.25)", "soll": ["FOLD"], "toleriert": [], "warum": "MDF-Boden uebersteuert den Modell-Fold gegen einen ungelesenen Micro-Gegner: Equity 0.107 gegen Break-even 0.25. Micro-Gegner bluffen den River nicht genug.", "netto_bb": -37.0, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 5, "heroSeat": 2, "heroCards": [{"rank": "SEVEN", "suit": "CLUBS"}, {"rank": "SEVEN", "suit": "DIAMONDS"}], "board": {"FLOP": [{"rank": "TEN", "suit": "SPADES"}, {"rank": "THREE", "suit": "DIAMONDS"}, {"rank": "KING", "suit": "CLUBS"}], "TURN": [{"rank": "FOUR", "suit": "SPADES"}], "RIVER": [{"rank": "TWO", "suit": "HEARTS"}]}, "street": "RIVER", "pot": 1.13, "toCall": 0.38, "heroStack": 1.29, "minRaiseTo": 0.76, "maxRaiseTo": 1.29, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 1, "stack": 1.98, "folded": true, "profile": {"vpip": 0.23, "pfr": 0.19, "foldToBet": 0.76, "cbet": 0.64, "foldToCbet": 0.31, "threeBet": 0.07, "foldToThreeBet": 0.62, "steal": 0.4, "checkRaise": 0.06, "wtsd": 0.3, "wsd": 0.6, "hands": 24}}, {"seat": 3, "stack": 3.25, "folded": false, "profile": {"vpip": 0.36, "pfr": 0.25, "foldToBet": 0.62, "cbet": 0.64, "foldToCbet": 0.31, "threeBet": 0.11, "foldToThreeBet": 0.49, "steal": 0.45, "checkRaise": 0.06, "wtsd": 0.34, "wsd": 0.54, "hands": 23, "aggression": 0.6666666666666666, "aggressionActions": 3, "turnAggression": 0.0, "turnAggressionActions": 1, "riverAggression": 1.0, "riverAggressionActions": 1}}, {"seat": 4, "stack": 8.69, "folded": true, "profile": {"vpip": 0.36, "pfr": 0.19, "foldToBet": 0.71, "cbet": 0.69, "foldToCbet": 0.3, "threeBet": 0.09, "foldToThreeBet": 0.24, "steal": 0.41, "checkRaise": 0.17, "wtsd": 0.36, "wsd": 0.53, "hands": 26}}, {"seat": 5, "stack": 1.99, "folded": true, "profile": {"vpip": 0.24, "pfr": 0.19, "foldToBet": 0.68, "cbet": 0.6, "foldToCbet": 0.32, "threeBet": 0.08, "foldToThreeBet": 0.53, "steal": 0.38, "checkRaise": 0.07, "wtsd": 0.33, "wsd": 0.56, "hands": 26}}], "history": [{"street": "PREFLOP", "seat": 5, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 1, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 2, "action": "RAISE", "amount": 0.05}, {"street": "PREFLOP", "seat": 3, "action": "RAISE", "amount": 0.12}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "FOLD"}, {"street": "PREFLOP", "seat": 2, "action": "CALL", "amount": 0.12}, {"street": "FLOP", "seat": 2, "action": "CHECK"}, {"street": "FLOP", "seat": 3, "action": "BET", "amount": 0.09}, {"street": "FLOP", "seat": 2, "action": "CALL", "amount": 0.09}, {"street": "TURN", "seat": 2, "action": "CHECK"}, {"street": "TURN", "seat": 3, "action": "BET", "amount": 0.15}, {"street": "TURN", "seat": 2, "action": "CALL", "amount": 0.15}, {"street": "RIVER", "seat": 2, "action": "CHECK"}, {"street": "RIVER", "seat": 3, "action": "BET", "amount": 0.38}], "_sitze": {"1": 1, "2": 2, "3": 4, "4": 5, "5": 6}}} +{"id": "91eab35857ab4e77", "hand": "177536500421", "datum": "2026-11-14", "street": "RIVER", "spot": "8h6c | JdKd2h 8d As | RIVER toCall 0.12 Pot 0.35", "live_aktion": "CALL", "live_grund": "MDF-Boden: Made-Hand verteidigt - Modell-Fold uebersteuert (break-even 0.26)", "soll": ["FOLD"], "toleriert": [], "warum": "MDF-Boden uebersteuert den Modell-Fold gegen einen ungelesenen Micro-Gegner: Equity 0.043 gegen Break-even 0.26. Micro-Gegner bluffen den River nicht genug.", "netto_bb": -11.5, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 6, "heroSeat": 2, "heroCards": [{"rank": "EIGHT", "suit": "HEARTS"}, {"rank": "SIX", "suit": "CLUBS"}], "board": {"FLOP": [{"rank": "JACK", "suit": "DIAMONDS"}, {"rank": "KING", "suit": "DIAMONDS"}, {"rank": "TWO", "suit": "HEARTS"}], "TURN": [{"rank": "EIGHT", "suit": "DIAMONDS"}], "RIVER": [{"rank": "ACE", "suit": "SPADES"}]}, "street": "RIVER", "pot": 0.35, "toCall": 0.12, "heroStack": 0.79, "minRaiseTo": 0.24, "maxRaiseTo": 0.79, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 1, "stack": 1.99, "folded": true, "profile": {"vpip": 0.23, "pfr": 0.19, "foldToBet": 0.76, "cbet": 0.64, "foldToCbet": 0.31, "threeBet": 0.07, "foldToThreeBet": 0.62, "steal": 0.4, "checkRaise": 0.06, "wtsd": 0.3, "wsd": 0.6, "hands": 31}}, {"seat": 3, "stack": 1.74, "folded": false, "profile": {"vpip": 0.25, "pfr": 0.16, "foldToBet": 0.67, "cbet": 0.53, "foldToCbet": 0.4, "threeBet": 0.07, "foldToThreeBet": 0.24, "steal": 0.3, "checkRaise": 0.03, "wtsd": 0.36, "wsd": 0.51, "hands": 24}}, {"seat": 4, "stack": 4.46, "folded": true, "profile": {"vpip": 0.36, "pfr": 0.25, "foldToBet": 0.62, "cbet": 0.64, "foldToCbet": 0.31, "threeBet": 0.11, "foldToThreeBet": 0.49, "steal": 0.45, "checkRaise": 0.06, "wtsd": 0.34, "wsd": 0.54, "hands": 24}}, {"seat": 5, "stack": 9.29, "folded": true, "profile": {"vpip": 0.36, "pfr": 0.19, "foldToBet": 0.72, "cbet": 0.69, "foldToCbet": 0.29, "threeBet": 0.08, "foldToThreeBet": 0.24, "steal": 0.4, "checkRaise": 0.17, "wtsd": 0.36, "wsd": 0.53, "hands": 28, "flopFoldToBet": 1.0, "flopFacingBet": 1}}, {"seat": 6, "stack": 2.0, "folded": true, "profile": {"vpip": 0.24, "pfr": 0.19, "foldToBet": 0.68, "cbet": 0.6, "foldToCbet": 0.32, "threeBet": 0.08, "foldToThreeBet": 0.53, "steal": 0.38, "checkRaise": 0.07, "wtsd": 0.32, "wsd": 0.55, "hands": 29}}], "history": [{"street": "PREFLOP", "seat": 1, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 2, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 3, "action": "RAISE", "amount": 0.04}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 6, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "FOLD"}, {"street": "PREFLOP", "seat": 2, "action": "CALL", "amount": 0.04}, {"street": "FLOP", "seat": 2, "action": "CHECK"}, {"street": "FLOP", "seat": 3, "action": "CHECK"}, {"street": "TURN", "seat": 2, "action": "CHECK"}, {"street": "TURN", "seat": 3, "action": "BET", "amount": 0.07}, {"street": "TURN", "seat": 2, "action": "CALL", "amount": 0.07}, {"street": "RIVER", "seat": 2, "action": "CHECK"}, {"street": "RIVER", "seat": 3, "action": "BET", "amount": 0.12}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6}}} +{"id": "6e190738baa2ac4e", "hand": "177613400152", "datum": "2026-11-14", "street": "RIVER", "spot": "Qs4h | JdKhQc 7d Ah | RIVER toCall 0.19 Pot 0.43", "live_aktion": "CALL", "live_grund": "MDF-Boden: Made-Hand verteidigt - Modell-Fold uebersteuert (break-even 0.31)", "soll": ["FOLD"], "toleriert": [], "warum": "MDF-Boden uebersteuert den Modell-Fold gegen einen ungelesenen Micro-Gegner: Equity 0.078 gegen Break-even 0.31. Micro-Gegner bluffen den River nicht genug.", "netto_bb": -15.5, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 5, "heroSeat": 2, "heroCards": [{"rank": "QUEEN", "suit": "SPADES"}, {"rank": "FOUR", "suit": "HEARTS"}], "board": {"FLOP": [{"rank": "JACK", "suit": "DIAMONDS"}, {"rank": "KING", "suit": "HEARTS"}, {"rank": "QUEEN", "suit": "CLUBS"}], "TURN": [{"rank": "SEVEN", "suit": "DIAMONDS"}], "RIVER": [{"rank": "ACE", "suit": "HEARTS"}]}, "street": "RIVER", "pot": 0.43, "toCall": 0.19, "heroStack": 1.32, "minRaiseTo": 0.38, "maxRaiseTo": 1.32, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 1, "stack": 3.97, "folded": false, "profile": {"vpip": 0.27, "pfr": 0.21, "foldToBet": 0.69, "cbet": 0.83, "foldToCbet": 0.28, "threeBet": 0.08, "foldToThreeBet": 0.58, "steal": 0.39, "checkRaise": 0.07, "wtsd": 0.27, "wsd": 0.49, "hands": 24}}, {"seat": 3, "stack": 2.43, "folded": true, "profile": {"vpip": 0.22, "pfr": 0.16, "foldToBet": 0.69, "cbet": 0.53, "foldToCbet": 0.39, "threeBet": 0.07, "foldToThreeBet": 0.56, "steal": 0.31, "checkRaise": 0.04, "wtsd": 0.29, "wsd": 0.64, "hands": 23}}, {"seat": 4, "stack": 1.93, "folded": true, "profile": {"vpip": 0.28, "pfr": 0.17, "foldToBet": 0.62, "cbet": 0.56, "foldToCbet": 0.39, "threeBet": 0.06, "foldToThreeBet": 0.29, "steal": 0.36, "checkRaise": 0.05, "wtsd": 0.41, "wsd": 0.52, "hands": 22}}, {"seat": 5, "stack": 1.0, "folded": true}], "history": [{"street": "PREFLOP", "seat": 1, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 2, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 3, "action": "FOLD"}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "RAISE", "amount": 0.06}, {"street": "PREFLOP", "seat": 2, "action": "CALL", "amount": 0.06}, {"street": "FLOP", "seat": 1, "action": "CHECK"}, {"street": "FLOP", "seat": 2, "action": "CHECK"}, {"street": "TURN", "seat": 1, "action": "BET", "amount": 0.06}, {"street": "TURN", "seat": 2, "action": "CALL", "amount": 0.06}, {"street": "RIVER", "seat": 1, "action": "BET", "amount": 0.19}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 5, "5": 6}}} +{"id": "9e0d9409872d0adb", "hand": "177619300146", "datum": "2026-11-14", "street": "RIVER", "spot": "Ad7s | 7dQcTs 8h Jh | RIVER toCall 1.1 Pot 2.02", "live_aktion": "CALL", "live_grund": "MDF-Boden: Made-Hand verteidigt - Modell-Fold uebersteuert (break-even 0.35)", "soll": ["FOLD"], "toleriert": [], "warum": "MDF-Boden uebersteuert den Modell-Fold gegen einen ungelesenen Micro-Gegner: Equity 0.027 gegen Break-even 0.35. Micro-Gegner bluffen den River nicht genug.", "netto_bb": -78.0, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 3, "heroSeat": 2, "heroCards": [{"rank": "ACE", "suit": "DIAMONDS"}, {"rank": "SEVEN", "suit": "SPADES"}], "board": {"FLOP": [{"rank": "SEVEN", "suit": "DIAMONDS"}, {"rank": "QUEEN", "suit": "CLUBS"}, {"rank": "TEN", "suit": "SPADES"}], "TURN": [{"rank": "EIGHT", "suit": "HEARTS"}], "RIVER": [{"rank": "JACK", "suit": "HEARTS"}]}, "street": "RIVER", "pot": 2.02, "toCall": 1.1, "heroStack": 2.55, "legalActions": ["FOLD", "CALL"], "villains": [{"seat": 1, "stack": 0.0, "folded": false, "profile": {"vpip": 0.38, "pfr": 0.16, "foldToBet": 0.49, "cbet": 0.5, "foldToCbet": 0.53, "threeBet": 0.04, "foldToThreeBet": 0.42, "steal": 0.37, "checkRaise": 0.01, "wtsd": 0.26, "wsd": 0.51, "hands": 22, "aggression": 0.3333333333333333, "aggressionActions": 3, "turnAggression": 0.0, "turnAggressionActions": 1, "riverAggression": 0.0, "riverAggressionActions": 1}}, {"seat": 3, "stack": 5.96, "folded": true, "profile": {"vpip": 0.36, "pfr": 0.23, "foldToBet": 0.69, "cbet": 0.78, "foldToCbet": 0.23, "threeBet": 0.08, "foldToThreeBet": 0.42, "steal": 0.44, "checkRaise": 0.03, "wtsd": 0.32, "wsd": 0.46, "hands": 24, "aggression": 0.0, "aggressionActions": 4, "turnAggression": 0.0, "turnAggressionActions": 1, "riverAggression": 0.0, "riverAggressionActions": 1, "flopFoldToBet": 0.0, "flopFacingBet": 1}}], "history": [{"street": "PREFLOP", "seat": 1, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 2, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 3, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "RAISE", "amount": 0.05}, {"street": "PREFLOP", "seat": 2, "action": "RAISE", "amount": 0.09}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.09}, {"street": "FLOP", "seat": 1, "action": "BET", "amount": 0.14}, {"street": "FLOP", "seat": 2, "action": "CALL", "amount": 0.14}, {"street": "TURN", "seat": 1, "action": "BET", "amount": 0.23}, {"street": "TURN", "seat": 2, "action": "CALL", "amount": 0.23}, {"street": "RIVER", "seat": 1, "action": "ALL_IN", "amount": 1.1}], "_sitze": {"1": 2, "2": 3, "3": 5}}} +{"id": "9e50e4ab2f0dd912", "hand": "177600300575", "datum": "2026-11-14", "street": "RIVER", "spot": "Tc6c | Ts9sKs 3s 2h | RIVER toCall 0.4 Pot 0.75", "live_aktion": "CALL", "live_grund": "MDF-Boden: Made-Hand verteidigt - Modell-Fold uebersteuert (break-even 0.35)", "soll": ["FOLD"], "toleriert": [], "warum": "MDF-Boden uebersteuert den Modell-Fold gegen einen ungelesenen Micro-Gegner: Equity 0.181 gegen Break-even 0.35. Micro-Gegner bluffen den River nicht genug.", "netto_bb": -28.5, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 6, "heroSeat": 1, "heroCards": [{"rank": "TEN", "suit": "CLUBS"}, {"rank": "SIX", "suit": "CLUBS"}], "board": {"FLOP": [{"rank": "TEN", "suit": "SPADES"}, {"rank": "NINE", "suit": "SPADES"}, {"rank": "KING", "suit": "SPADES"}], "TURN": [{"rank": "THREE", "suit": "SPADES"}], "RIVER": [{"rank": "TWO", "suit": "HEARTS"}]}, "street": "RIVER", "pot": 0.75, "toCall": 0.4, "heroStack": 2.13, "minRaiseTo": 0.8, "maxRaiseTo": 2.13, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 2, "stack": 2.08, "folded": true, "profile": {"vpip": 0.2, "pfr": 0.17, "foldToBet": 0.76, "cbet": 0.48, "foldToCbet": 0.39, "threeBet": 0.08, "foldToThreeBet": 0.56, "steal": 0.33, "checkRaise": 0.04, "wtsd": 0.34, "wsd": 0.6, "hands": 28}}, {"seat": 3, "stack": 1.43, "folded": false, "profile": {"vpip": 0.24, "pfr": 0.2, "foldToBet": 0.59, "cbet": 0.83, "foldToCbet": 0.17, "threeBet": 0.12, "foldToThreeBet": 0.41, "steal": 0.35, "checkRaise": 0.09, "wtsd": 0.33, "wsd": 0.52, "hands": 23}}, {"seat": 4, "stack": 3.16, "folded": true, "profile": {"vpip": 0.27, "pfr": 0.2, "foldToBet": 0.72, "cbet": 0.47, "foldToCbet": 0.31, "threeBet": 0.05, "foldToThreeBet": 0.66, "steal": 0.46, "checkRaise": 0.1, "wtsd": 0.4, "wsd": 0.61, "hands": 22}}, {"seat": 5, "stack": 2.13, "folded": true, "profile": {"vpip": 0.31, "pfr": 0.26, "foldToBet": 0.61, "cbet": 0.76, "foldToCbet": 0.27, "threeBet": 0.14, "foldToThreeBet": 0.51, "steal": 0.51, "checkRaise": 0.11, "wtsd": 0.3, "wsd": 0.52, "hands": 23}}, {"seat": 6, "stack": 2.1, "folded": true, "profile": {"vpip": 0.24, "pfr": 0.18, "foldToBet": 0.54, "cbet": 0.54, "foldToCbet": 0.28, "threeBet": 0.06, "foldToThreeBet": 0.43, "steal": 0.35, "checkRaise": 0.09, "wtsd": 0.36, "wsd": 0.53, "hands": 25}}], "history": [{"street": "PREFLOP", "seat": 6, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 1, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 2, "action": "FOLD"}, {"street": "PREFLOP", "seat": 3, "action": "RAISE", "amount": 0.06}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 6, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.06}, {"street": "FLOP", "seat": 1, "action": "CHECK"}, {"street": "FLOP", "seat": 3, "action": "BET", "amount": 0.04}, {"street": "FLOP", "seat": 1, "action": "CALL", "amount": 0.04}, {"street": "TURN", "seat": 1, "action": "CHECK"}, {"street": "TURN", "seat": 3, "action": "BET", "amount": 0.07}, {"street": "TURN", "seat": 1, "action": "CALL", "amount": 0.07}, {"street": "RIVER", "seat": 1, "action": "CHECK"}, {"street": "RIVER", "seat": 3, "action": "BET", "amount": 0.4}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6}}} +{"id": "8a261dc1b2f121c3", "hand": "177599200076", "datum": "2026-11-14", "street": "TURN", "spot": "7cTh | 4c2d7s 6h | TURN toCall 0.37 Pot 1.12", "live_aktion": "CALL", "live_grund": "top pair weak kicker on dry board: equity 0.39 vs break-even 0.25, EV call +0.20", "soll": ["FOLD"], "toleriert": [], "warum": "T7 (Top Pair, schwacher Kicker) auf 4267 setzt den Turn und wird vom Flop-Setzer erhoeht: gegen eine Micro-Turn-Erhoehung (Straße mit 3/5/85) Fold.", "netto_bb": -55.5, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 6, "heroSeat": 2, "heroCards": [{"rank": "SEVEN", "suit": "CLUBS"}, {"rank": "TEN", "suit": "HEARTS"}], "board": {"FLOP": [{"rank": "FOUR", "suit": "CLUBS"}, {"rank": "TWO", "suit": "DIAMONDS"}, {"rank": "SEVEN", "suit": "SPADES"}], "TURN": [{"rank": "SIX", "suit": "HEARTS"}]}, "street": "TURN", "pot": 1.12, "toCall": 0.37, "heroStack": 1.82, "minRaiseTo": 0.89, "maxRaiseTo": 1.97, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 1, "stack": 1.37, "folded": true, "profile": {"vpip": 0.38, "pfr": 0.25, "foldToBet": 0.68, "cbet": 0.45, "foldToCbet": 0.29, "threeBet": 0.1, "foldToThreeBet": 0.14, "steal": 0.45, "checkRaise": 0.07, "wtsd": 0.46, "wsd": 0.51, "hands": 22, "aggression": 0.5, "aggressionActions": 2, "turnAggression": 1.0, "turnAggressionActions": 1}}, {"seat": 3, "stack": 2.08, "folded": true, "profile": {"vpip": 0.2, "pfr": 0.15, "foldToBet": 0.8, "cbet": 0.53, "foldToCbet": 0.15, "threeBet": 0.02, "foldToThreeBet": 0.67, "steal": 0.35, "checkRaise": 0.09, "wtsd": 0.36, "wsd": 0.55, "hands": 23}}, {"seat": 4, "stack": 1.97, "folded": true, "profile": {"vpip": 0.36, "pfr": 0.2, "foldToBet": 0.29, "cbet": 0.51, "foldToCbet": 0.27, "threeBet": 0.09, "foldToThreeBet": 0.27, "steal": 0.44, "checkRaise": 0.18, "wtsd": 0.35, "wsd": 0.41, "hands": 23}}, {"seat": 5, "stack": 0.39, "folded": false, "profile": {"vpip": 0.2, "pfr": 0.1, "foldToBet": 0.55, "cbet": 0.67, "foldToCbet": 0.5, "threeBet": 0.03, "foldToThreeBet": 0.67, "steal": 0.27, "checkRaise": 0.05, "wtsd": 0.29, "wsd": 0.65, "hands": 27, "aggression": 0.5, "aggressionActions": 2, "riverAggression": 1.0, "riverAggressionActions": 1, "turnFoldToBet": 1.0, "turnFacingBet": 1}}, {"seat": 6, "stack": 13.98, "folded": true, "profile": {"vpip": 0.29, "pfr": 0.16, "foldToBet": 0.59, "cbet": 0.91, "foldToCbet": 0.26, "threeBet": 0.07, "foldToThreeBet": 0.17, "steal": 0.36, "checkRaise": 0.11, "wtsd": 0.3, "wsd": 0.48, "hands": 30}}], "history": [{"street": "PREFLOP", "seat": 1, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 2, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 3, "action": "FOLD"}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "RAISE", "amount": 0.05}, {"street": "PREFLOP", "seat": 6, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.05}, {"street": "PREFLOP", "seat": 2, "action": "CALL", "amount": 0.05}, {"street": "FLOP", "seat": 1, "action": "CHECK"}, {"street": "FLOP", "seat": 2, "action": "CHECK"}, {"street": "FLOP", "seat": 5, "action": "BET", "amount": 0.15}, {"street": "FLOP", "seat": 1, "action": "FOLD"}, {"street": "FLOP", "seat": 2, "action": "CALL", "amount": 0.15}, {"street": "TURN", "seat": 2, "action": "BET", "amount": 0.15}, {"street": "TURN", "seat": 5, "action": "RAISE", "amount": 0.52}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6}}} +{"id": "b0da7546916df7d7", "hand": "177718400199", "datum": "2026-11-14", "street": "TURN", "spot": "TdTs | Jh5hKh 8d | TURN toCall 0.41 Pot 0.96", "live_aktion": "CALL", "live_grund": "middle pair on medium board: equity 0.49 vs break-even 0.30, EV call +0.26", "soll": ["FOLD"], "toleriert": [], "warum": "TT (Mittelpaar) auf Jh5hKh 8d setzt den Turn und wird erhoeht: unter zwei Overcards auf Monoton-Brett gegen eine Erhoehung Fold.", "netto_bb": -34.0, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 6, "heroSeat": 6, "heroCards": [{"rank": "TEN", "suit": "DIAMONDS"}, {"rank": "TEN", "suit": "SPADES"}], "board": {"FLOP": [{"rank": "JACK", "suit": "HEARTS"}, {"rank": "FIVE", "suit": "HEARTS"}, {"rank": "KING", "suit": "HEARTS"}], "TURN": [{"rank": "EIGHT", "suit": "DIAMONDS"}]}, "street": "TURN", "pot": 0.96, "toCall": 0.41, "heroStack": 2.43, "minRaiseTo": 0.93, "maxRaiseTo": 2.54, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 1, "stack": 1.32, "folded": false, "profile": {"vpip": 0.28, "pfr": 0.2, "foldToBet": 0.61, "cbet": 0.63, "foldToCbet": 0.37, "threeBet": 0.1, "foldToThreeBet": 0.41, "steal": 0.36, "checkRaise": 0.02, "wtsd": 0.34, "wsd": 0.52, "hands": 22}}, {"seat": 2, "stack": 3.16, "folded": true, "profile": {"vpip": 0.44, "pfr": 0.32, "foldToBet": 0.63, "cbet": 0.61, "foldToCbet": 0.2, "threeBet": 0.18, "foldToThreeBet": 0.36, "steal": 0.55, "checkRaise": 0.26, "wtsd": 0.34, "wsd": 0.5, "hands": 23}}, {"seat": 3, "stack": 0.69, "folded": true, "profile": {"vpip": 0.3, "pfr": 0.21, "foldToBet": 0.33, "cbet": 0.92, "foldToCbet": 0.26, "threeBet": 0.07, "foldToThreeBet": 0.83, "steal": 0.47, "checkRaise": 0.06, "wtsd": 0.31, "wsd": 0.53, "hands": 22}}, {"seat": 4, "stack": 2.12, "folded": true, "profile": {"vpip": 0.26, "pfr": 0.18, "foldToBet": 0.3, "cbet": 0.67, "foldToCbet": 0.24, "threeBet": 0.08, "foldToThreeBet": 0.37, "steal": 0.33, "checkRaise": 0.09, "wtsd": 0.41, "wsd": 0.49, "hands": 22, "aggression": 1.0, "aggressionActions": 1}}, {"seat": 5, "stack": 4.22, "folded": true, "profile": {"vpip": 0.15, "pfr": 0.12, "foldToBet": 0.7, "cbet": 0.42, "foldToCbet": 0.39, "threeBet": 0.05, "foldToThreeBet": 0.5, "steal": 0.24, "checkRaise": 0.02, "wtsd": 0.34, "wsd": 0.65, "hands": 24, "flopFoldToBet": 1.0, "flopFacingBet": 1}}], "history": [{"street": "PREFLOP", "seat": 5, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 6, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 1, "action": "RAISE", "amount": 0.04}, {"street": "PREFLOP", "seat": 2, "action": "FOLD"}, {"street": "PREFLOP", "seat": 3, "action": "FOLD"}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 6, "action": "RAISE", "amount": 0.06}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.06}, {"street": "FLOP", "seat": 6, "action": "CHECK"}, {"street": "FLOP", "seat": 1, "action": "BET", "amount": 0.1}, {"street": "FLOP", "seat": 6, "action": "CALL", "amount": 0.1}, {"street": "TURN", "seat": 6, "action": "BET", "amount": 0.11}, {"street": "TURN", "seat": 1, "action": "RAISE", "amount": 0.52}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6}}} +{"id": "bf4d7c89350e9efa", "hand": "177113201687", "datum": "2026-11-14", "street": "FLOP", "spot": "7h8d | 8h9dJc | FLOP toCall 0.16 Pot 0.37", "live_aktion": "RAISE", "live_grund": "bottom pair with gutshot on dry board: equity 0.50 vs break-even 0.30, EV semibluff raise to 0.69 +0.15", "soll": ["FOLD", "CALL"], "toleriert": [], "warum": "78 (Bottom Pair + Gutshot) auf 89J setzt und wird erhoeht: der Re-Raise (Semibluff) bindet den Stack mit Bottom Pair. Weiter nur Call oder Fold.", "netto_bb": -100.0, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 6, "heroSeat": 3, "heroCards": [{"rank": "SEVEN", "suit": "HEARTS"}, {"rank": "EIGHT", "suit": "DIAMONDS"}], "board": {"FLOP": [{"rank": "EIGHT", "suit": "HEARTS"}, {"rank": "NINE", "suit": "DIAMONDS"}, {"rank": "JACK", "suit": "CLUBS"}]}, "street": "FLOP", "pot": 0.37, "toCall": 0.16, "heroStack": 1.9, "minRaiseTo": 0.36, "maxRaiseTo": 1.94, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 1, "stack": 2.0, "folded": true, "profile": {"vpip": 0.23, "pfr": 0.19, "foldToBet": 0.76, "cbet": 0.64, "foldToCbet": 0.31, "threeBet": 0.07, "foldToThreeBet": 0.62, "steal": 0.4, "checkRaise": 0.06, "wtsd": 0.3, "wsd": 0.6, "hands": 34}}, {"seat": 2, "stack": 4.42, "folded": true, "profile": {"vpip": 0.36, "pfr": 0.23, "foldToBet": 0.69, "cbet": 0.78, "foldToCbet": 0.23, "threeBet": 0.08, "foldToThreeBet": 0.42, "steal": 0.44, "checkRaise": 0.03, "wtsd": 0.32, "wsd": 0.46, "hands": 28}}, {"seat": 4, "stack": 3.8, "folded": false}, {"seat": 5, "stack": 1.96, "folded": true}, {"seat": 6, "stack": 1.74, "folded": true, "profile": {"vpip": 0.27, "pfr": 0.21, "foldToBet": 0.69, "cbet": 0.83, "foldToCbet": 0.28, "threeBet": 0.09, "foldToThreeBet": 0.58, "steal": 0.39, "checkRaise": 0.07, "wtsd": 0.27, "wsd": 0.49, "hands": 24, "aggression": 0.3333333333333333, "aggressionActions": 3, "turnAggression": 0.0, "turnAggressionActions": 1, "riverAggression": 0.0, "riverAggressionActions": 1}}], "history": [{"street": "PREFLOP", "seat": 2, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 3, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 4, "action": "RAISE", "amount": 0.06}, {"street": "PREFLOP", "seat": 5, "action": "FOLD"}, {"street": "PREFLOP", "seat": 6, "action": "FOLD"}, {"street": "PREFLOP", "seat": 1, "action": "FOLD"}, {"street": "PREFLOP", "seat": 2, "action": "FOLD"}, {"street": "PREFLOP", "seat": 3, "action": "CALL", "amount": 0.06}, {"street": "FLOP", "seat": 3, "action": "BET", "amount": 0.04}, {"street": "FLOP", "seat": 4, "action": "RAISE", "amount": 0.2}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6}}} +{"id": "4817f40de20948cc", "hand": "177087901694", "datum": "2026-11-14", "street": "FLOP", "spot": "QsAd | Qh8c9c | FLOP toCall 0.31 Pot 0.62", "live_aktion": "RAISE", "live_grund": "top pair good kicker on medium board: equity 0.75 vs break-even 0.33, EV raise to 1.24 +0.76", "soll": ["FOLD", "CALL"], "toleriert": [], "warum": "AQ (Top Pair) auf Qh8c9c setzt und wird erhoeht: die 3-Bet bindet den Stack gegen eine Micro-Erhoehung, die Top Pair selten unterbietet. Call oder Fold.", "netto_bb": -70.5, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 5, "heroSeat": 5, "heroCards": [{"rank": "QUEEN", "suit": "SPADES"}, {"rank": "ACE", "suit": "DIAMONDS"}], "board": {"FLOP": [{"rank": "QUEEN", "suit": "HEARTS"}, {"rank": "EIGHT", "suit": "CLUBS"}, {"rank": "NINE", "suit": "CLUBS"}]}, "street": "FLOP", "pot": 0.62, "toCall": 0.31, "heroStack": 2.13, "minRaiseTo": 0.71, "maxRaiseTo": 2.22, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 1, "stack": 0.96, "folded": false, "profile": {"vpip": 0.6, "pfr": 0.05, "foldToBet": 0.0, "cbet": 0.0, "foldToCbet": 0.0, "threeBet": 0.0, "foldToThreeBet": 0.0, "steal": 0.5, "checkRaise": 0.0, "wtsd": 0.53, "wsd": 0.25, "hands": 7, "aggression": 0.0, "aggressionActions": 4, "turnAggression": 0.0, "turnAggressionActions": 1, "riverAggression": 0.0, "riverAggressionActions": 1, "flopFoldToBet": 0.0, "flopFacingBet": 2, "turnFoldToBet": 0.5, "turnFacingBet": 2, "riverFoldToBet": 0.0, "riverFacingBet": 1}}, {"seat": 2, "stack": 4.86, "folded": true, "profile": {"vpip": 0.34, "pfr": 0.23, "foldToBet": 0.43, "cbet": 0.72, "foldToCbet": 0.21, "threeBet": 0.12, "foldToThreeBet": 0.32, "steal": 0.42, "checkRaise": 0.05, "wtsd": 0.38, "wsd": 0.46, "hands": 24}}, {"seat": 3, "stack": 1.15, "folded": true, "profile": {"vpip": 0.2, "pfr": 0.08, "foldToBet": 0.57, "cbet": 0.62, "foldToCbet": 0.49, "threeBet": 0.03, "foldToThreeBet": 0.51, "steal": 0.22, "checkRaise": 0.02, "wtsd": 0.32, "wsd": 0.67, "hands": 24}}, {"seat": 4, "stack": 1.98, "folded": true, "profile": {"vpip": 0.0, "pfr": 0.0, "foldToBet": 0.0, "cbet": 0.0, "foldToCbet": 0.0, "threeBet": 0.0, "foldToThreeBet": 0.0, "steal": 0.0, "checkRaise": 0.0, "wtsd": 0.0, "wsd": 0.0, "hands": 4}}], "history": [{"street": "PREFLOP", "seat": 3, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 4, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 5, "action": "RAISE", "amount": 0.05}, {"street": "PREFLOP", "seat": 1, "action": "CALL", "amount": 0.05}, {"street": "PREFLOP", "seat": 2, "action": "FOLD"}, {"street": "PREFLOP", "seat": 3, "action": "FOLD"}, {"street": "PREFLOP", "seat": 4, "action": "FOLD"}, {"street": "FLOP", "seat": 5, "action": "BET", "amount": 0.09}, {"street": "FLOP", "seat": 1, "action": "RAISE", "amount": 0.4}], "_sitze": {"1": 2, "2": 3, "3": 4, "4": 5, "5": 6}}} +{"id": "cd7a650ac22ec5cd", "hand": "177862900036", "datum": "2026-11-14", "street": "TURN", "spot": "5hAd | Qc7dAc 8s | TURN toCall 0.3 Pot 0.6", "live_aktion": "RAISE", "live_grund": "top pair weak kicker on medium board: equity 0.71 vs break-even 0.33, EV raise to 1.20 +0.67", "soll": ["FOLD", "CALL"], "toleriert": [], "warum": "A5 (Top Pair, schwacher Kicker) auf Qc7dAc8s setzt und wird erhoeht: die 3-Bet stellt den Stack gegen Two Pair+. Call oder Fold.", "netto_bb": -100.0, "quelle": "schatten", "anfrage": {"variant": "NLHE", "bigBlind": 0.02, "seats": 5, "heroSeat": 3, "heroCards": [{"rank": "FIVE", "suit": "HEARTS"}, {"rank": "ACE", "suit": "DIAMONDS"}], "board": {"FLOP": [{"rank": "QUEEN", "suit": "CLUBS"}, {"rank": "SEVEN", "suit": "DIAMONDS"}, {"rank": "ACE", "suit": "CLUBS"}], "TURN": [{"rank": "EIGHT", "suit": "SPADES"}]}, "street": "TURN", "pot": 0.6, "toCall": 0.3, "heroStack": 2.49, "minRaiseTo": 0.66, "maxRaiseTo": 2.55, "legalActions": ["FOLD", "CALL", "RAISE"], "villains": [{"seat": 1, "stack": 2.13, "folded": true}, {"seat": 2, "stack": 2.73, "folded": true}, {"seat": 4, "stack": 1.98, "folded": true}, {"seat": 5, "stack": 1.56, "folded": false}], "history": [{"street": "PREFLOP", "seat": 3, "action": "POST_SB", "amount": 0.01}, {"street": "PREFLOP", "seat": 4, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 5, "action": "POST_BB", "amount": 0.02}, {"street": "PREFLOP", "seat": 5, "action": "CHECK"}, {"street": "PREFLOP", "seat": 1, "action": "FOLD"}, {"street": "PREFLOP", "seat": 2, "action": "FOLD"}, {"street": "PREFLOP", "seat": 3, "action": "CALL", "amount": 0.02}, {"street": "PREFLOP", "seat": 4, "action": "CHECK"}, {"street": "FLOP", "seat": 3, "action": "CHECK"}, {"street": "FLOP", "seat": 4, "action": "CHECK"}, {"street": "FLOP", "seat": 5, "action": "BET", "amount": 0.06}, {"street": "FLOP", "seat": 3, "action": "CALL", "amount": 0.06}, {"street": "FLOP", "seat": 4, "action": "FOLD"}, {"street": "TURN", "seat": 3, "action": "BET", "amount": 0.06}, {"street": "TURN", "seat": 5, "action": "RAISE", "amount": 0.36}], "_sitze": {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5}}} diff --git a/tests/pflichtfaelle_spec.py b/tests/pflichtfaelle_spec.py new file mode 100644 index 00000000..5d5e2b7b --- /dev/null +++ b/tests/pflichtfaelle_spec.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python3 +"""Spezifikation werkzeuge/pflichtfaelle.py - echte Fehlentscheidungen als hartes Tor. + +Rein: Schein-Kern (Python-Funktion), Dateien nur in einem Temp-Ordner; dazu eine Formprüfung der +echten Liste tests/live_fixture/pflicht.jsonl (ohne Kern). + + python3 tests/pflichtfaelle_spec.py -v +""" +import json +import os +import shutil +import sys +import tempfile +import unittest + +_w = os.path.dirname(os.path.abspath(__file__)) +while _w != "/" and not os.path.isdir(os.path.join(_w, "werkzeuge")): + _w = os.path.dirname(_w) +sys.path.insert(0, os.path.join(_w, "werkzeuge")) +import pflichtfaelle as pf + + +def anfrage(street="RIVER", to_call=0.5, legal=("FOLD", "CALL", "RAISE"), n=0): + return {"street": street, "toCall": to_call, "pot": 1.0, "heroStack": 2.0, "legalActions": list(legal), + "heroCards": [{"rank": "NINE", "suit": "HEARTS"}, {"rank": "NINE", "suit": "DIAMONDS"}], + "board": {}, "n": n, + "villains": [{"seat": 2, "stack": 1.0, "kennung": "spieler-9", "profile": {"vpip": 0.4, "kennung": "spieler-9"}}]} + + +def fall(soll, toleriert=(), n=0): + return {"id": f"f{n}", "hand": str(100 + n), "street": "RIVER", "spot": f"s{n}", "soll": list(soll), + "toleriert": list(toleriert), "live_aktion": "CALL", "anfrage": {"n": n}} + + +def schein_kern(antworten): + """antworten: {(n, env-Schalter 'K' gesetzt?): aktion}""" + def kern(anfr, env): + return [{"action": antworten[(a["n"], bool(env.get("K")))], "reason": "r"} for a in anfr] + return kern + + +class Urteil(unittest.TestCase): + def test_rang_und_normalform(self): + f = fall(["FOLD", "CALL"], ["CHECK"]) + self.assertEqual((pf.rang(f, "fold"), pf.rang(f, "CHECK"), pf.rang(f, "RAISE")), (2, 1, 0)) + self.assertEqual(pf.rang(fall(["RAISE"]), "ALL_IN"), 2) # Live loggt ALL_IN/BET, Kern RAISE + + def test_schlechter_als_live_ist_verlierer(self): + f = fall(["FOLD"], ["CALL"]) + self.assertEqual(pf.urteil(f, "FOLD", "CALL"), (True, "schlechter als Live")) # Soll -> toleriert + self.assertEqual(pf.urteil(f, "FOLD", "RAISE")[0], True) + self.assertEqual(pf.urteil(f, "CALL", "RAISE", streng=False)[0], True) # auch ohne Pflicht + + def test_verfehlte_soll_ist_pflicht(self): + f = fall(["FOLD"]) + self.assertEqual(pf.urteil(f, "CALL", "CALL"), (True, "verfehlt Soll (wie Live)")) + # nur Rückschritt: derselbe Fehler wie live ist dort kein Verlierer, ein anderer Fehler schon + self.assertEqual(pf.urteil(f, "CALL", "CALL", streng=False)[0], False) + self.assertEqual(pf.urteil(f, "CALL", "RAISE", streng=False)[0], True) + + def test_behoben_und_gleich(self): + f = fall(["FOLD"], ["CALL"]) + self.assertEqual(pf.urteil(f, "RAISE", "FOLD"), (False, "behoben")) + self.assertEqual(pf.urteil(f, "RAISE", "CALL"), (False, "verbessert (toleriert)")) + self.assertEqual(pf.urteil(f, "FOLD", "FOLD"), (False, "Soll")) + self.assertEqual(pf.urteil(f, "CALL", "CALL"), (False, "toleriert")) + + +class Pruefen(unittest.TestCase): + def test_tor_ueber_alle_faelle(self): + fs = [fall(["FOLD"], n=0), fall(["FOLD", "CALL"], n=1), fall(["FOLD"], ["CALL"], n=2)] + kern = schein_kern({(0, False): "CALL", (0, True): "FOLD", # Kandidat behebt Fall 0 + (1, False): "CALL", (1, True): "RAISE", # ... verschlechtert Fall 1 + (2, False): "CALL", (2, True): "CALL"}) # Fall 2 toleriert wie live + r = pf.pruefen(fs, kern, kern, {}, {"K": "1"}) + self.assertFalse(r["bestanden"]) + self.assertEqual(r["verlierer"], 1) + self.assertEqual([z["urteil"] for z in r["zeilen"]], ["behoben", "schlechter als Live", "toleriert"]) + self.assertEqual((r["live_soll"], r["kandidat_soll"]), (1, 1)) + t = pf.pruef_text(r, "K=1") + self.assertIn("HARTER VERLIERER (1 Fälle)", t) + self.assertIn(" X 101", t) + + def test_live_stand_selbst(self): + fs = [fall(["FOLD"], n=0)] + kern = schein_kern({(0, False): "CALL"}) + r = pf.pruefen(fs, kern, kern, {}, {}) + self.assertFalse(r["bestanden"]) # Live verfehlt: Pflicht nicht erfüllt + self.assertTrue(pf.pruefen(fs, kern, kern, {}, {}, streng=False)["bestanden"]) + + def test_kern_muss_je_fall_antworten(self): + with self.assertRaises(RuntimeError): + pf.pruefen([fall(["FOLD"])], lambda a, e: [], lambda a, e: [], {}, {}) + + +class Anlegen(unittest.TestCase): + def setUp(self): + self.d = tempfile.mkdtemp() + + def tearDown(self): + shutil.rmtree(self.d, ignore_errors=True) + + def _wurzel(self, schatten=(), zuege=()): + for rel, zeilen in (("betrieb/scratch/shadow.jsonl", schatten), ("archiv/lauf/zuege.jsonl", zuege), + ("archiv/lauf/haende.jsonl", ())): + p = os.path.join(self.d, *rel.split("/")) + os.makedirs(os.path.dirname(p), exist_ok=True) + with open(p, "w", encoding="utf-8") as fh: + fh.writelines(json.dumps(z) + "\n" for z in zeilen) + return self.d + + def test_findet_spot_im_schatten_dann_in_zugzeile(self): + a_t, a_r = anfrage("TURN", 0.66), anfrage("RIVER", 0.89) + w = self._wurzel( + schatten=[{"pid": 1, "zeit": "2026-11-16 12:22:07", "zug": "R|555|TURN|1.32|0.66|9d9h|()", + "anfrage": a_t, "antwort": {"action": "CALL", "reason": "EV call"}}], + zuege=[{"hand": "555", "street": "RIVER", "aktion": "CALL", "grund": "two pair", "spot": a_r}]) + self.assertEqual(pf.finde_anfrage(w, "555", "TURN", 0.66)[1:], ("CALL", "EV call", "schatten")) + self.assertEqual(pf.finde_anfrage(w, "555", "RIVER", 0.89)[1:], ("CALL", "two pair", "zug")) + self.assertEqual(pf.finde_anfrage(w, "555", "RIVER", 0.5)[0], None) # toCall muss passen + + def test_fall_ohne_kennung_und_dedupliziert(self): + f = pf.fall("555", anfrage(), "ALL_IN", "g", "schatten", ["fold"], ["CALL"], "weil", -93.0, "2026-11-16") + self.assertEqual((f["live_aktion"], f["soll"], f["toleriert"]), ("RAISE", ["FOLD"], ["CALL"])) + p = os.path.join(self.d, "pflicht.jsonl") + self.assertEqual(pf.anhaengen(p, f), 1) + self.assertEqual(pf.anhaengen(p, f), 0) + with open(p, encoding="utf-8") as fh: + roh = fh.read() + self.assertNotIn("kennung", roh) + self.assertNotIn("spieler-9", roh) + self.assertEqual(json.loads(roh)["anfrage"]["villains"][0]["profile"], {"vpip": 0.4}) + + +class EchteListe(unittest.TestCase): + """Form der festen Liste: jeder Fall prüfbar, nichts Privates.""" + + def test_form(self): + with open(pf.PFLICHT, encoding="utf-8") as fh: + roh = fh.read() + self.assertNotIn("kennung", roh) + fs = [json.loads(z) for z in roh.splitlines() if z.strip()] + self.assertGreaterEqual(len(fs), 10) + self.assertEqual(len({f["id"] for f in fs}), len(fs)) + self.assertIn("178593300919", {f["hand"] for f in fs}) + for f in fs: + legal = {pf.norm(a) for a in f["anfrage"]["legalActions"]} + self.assertTrue(f["soll"], f["hand"]) + self.assertTrue(set(f["soll"]) <= legal, f["hand"]) + self.assertEqual(pf.rang(f, f["live_aktion"]) < 2, True, f"{f['hand']}: damals schon Soll?") + self.assertTrue(f["warum"], f["hand"]) + self.assertEqual(f["street"], f["anfrage"]["street"]) + + +if __name__ == "__main__": + unittest.main() diff --git a/werkzeuge/pflichtfaelle.py b/werkzeuge/pflichtfaelle.py new file mode 100644 index 00000000..0d28d372 --- /dev/null +++ b/werkzeuge/pflichtfaelle.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python3 +"""Pflichtfälle: echte Fehlentscheidungen als hartes Tor (Messregel 1a, Owner-Vorgabe 16.11.). + +Die Liste `tests/live_fixture/pflicht.jsonl` hält je Zeile EINE echte Live-Entscheidung, die eindeutig +falsch war (keine Cooler, kein Ergebnis-Urteil): den Spot so, wie der Kern ihn bekam (ohne +Gegnerkennungen), die Live-Aktion von damals, die Soll-Aktion(en) und eine Begründung. + + soll die richtigen Aktionen (z. B. ["FOLD"] oder ["FOLD", "CALL"] gegen einen 3-Bet-Fehler) + toleriert Aktionen, die nicht richtig, aber kein Fehler dieses Falls sind (99 callt den Turn, + wenn der River-Fall foldet: "Fold am Turn oder spätestens am River") + +Prüfen (am Tor, für jeden Kandidaten): + python3 werkzeuge/pflichtfaelle.py --arm "K=V;K=V" [--kern-kandidat PFAD] [--nur-rueckschritt] +spielt jeden Fall durch eine Kern-Kopie (pokerbench-pflicht-live.exe / -kandidat.exe, Priorität Idle, +ein Prozess) mit den Live-Schaltern und mit dem Kandidaten. HARTER VERLIERER, wenn der Kandidat einen +Fall schlechter spielt + - als der Live-Stand (Rang sinkt: soll > toleriert > falsch), oder + - als die Soll-Aktion (Kandidat weder soll noch toleriert). +Die zweite Bedingung ist die Pflicht: solange der Live-Stand einen Fall selbst verfehlt, besteht kein +Kandidat, der ihn nicht behebt. `--nur-rueckschritt` prüft nur die erste (Auskunft, nicht das Tor). +Ausgang 1 bei hartem Verlierer, sonst 0. `--arm ""` zeigt den Live-Stand selbst. + +Anlegen eines Falls (aus Schatten-Log, sonst `spot` der Zugzeile, sonst tests/live_fixture/micro_*): + python3 werkzeuge/pflichtfaelle.py --anlegen HAND STREET TOCALL --soll FOLD [--toleriert CALL] --warum "..." + +Spezifikation: tests/pflichtfaelle_spec.py. +""" +import argparse +import glob +import json +import os +import sys + +_HIER = os.path.dirname(os.path.abspath(__file__)) +BAUM = os.path.dirname(_HIER) +sys.path.insert(0, _HIER) +sys.path.insert(0, os.path.join(BAUM, "lesen")) +import livefaelle # noqa: E402 ohne_kennung, spot_text, schluessel, Kandidaten-Env +import roentgen # noqa: E402 Daten, Kern-Kopie, Kern-Aufruf, Schalter + +PFLICHT = os.path.join(BAUM, "tests", "live_fixture", "pflicht.jsonl") +EXE = ".exe" if sys.platform == "win32" else "" +KERN_LIVE = "pokerbench-pflicht-live" + EXE +KERN_KAND = "pokerbench-pflicht-kandidat" + EXE + +# Live loggt BET/ALL_IN, der Kern antwortet RAISE; CHECK und CALL bei toCall 0 sind derselbe Zug. +_GLEICH = {"BET": "RAISE", "ALL_IN": "RAISE"} + + +def norm(aktion): + a = str(aktion or "").upper() + return _GLEICH.get(a, a) + + +def rang(fall, aktion): + """2 = Soll, 1 = toleriert, 0 = falsch.""" + a = norm(aktion) + if a in {norm(s) for s in fall.get("soll") or []}: + return 2 + if a in {norm(s) for s in fall.get("toleriert") or []}: + return 1 + return 0 + + +def urteil(fall, live, kandidat, streng=True): + """(verlierer: bool, wort) für einen Fall.""" + rl, rk = rang(fall, live), rang(fall, kandidat) + if rk < rl: + return True, "schlechter als Live" + if rk == 0: + neu = norm(kandidat) != norm(live) + wort = "verfehlt Soll" + (" (anders falsch als Live)" if neu else " (wie Live)") + return (streng or neu), wort + if rk > rl: + return False, "behoben" if rk == 2 else "verbessert (toleriert)" + return False, "Soll" if rk == 2 else "toleriert" + + +def pruefen(faelle, kern_live, kern_kand, env_live, env_kand, streng=True): + anfr = [f["anfrage"] for f in faelle] + vor = kern_live(anfr, env_live) + nach = kern_kand(anfr, env_kand) + if len(vor) != len(anfr) or len(nach) != len(anfr): + raise RuntimeError("Kern gab nicht je Anfrage eine Antwort") + zeilen = [] + for f, v, n in zip(faelle, vor, nach): + verl, wort = urteil(f, v.get("action"), n.get("action"), streng) + zeilen.append({"id": f.get("id"), "hand": f["hand"], "street": f.get("street"), "spot": f.get("spot"), + "soll": f.get("soll"), "toleriert": f.get("toleriert") or [], + "damals": f.get("live_aktion"), "live": norm(v.get("action")), + "kandidat": norm(n.get("action")), "verlierer": verl, "urteil": wort, + "grund_kandidat": n.get("reason"), "warum": f.get("warum")}) + verlierer = [z for z in zeilen if z["verlierer"]] + return {"n": len(zeilen), "streng": streng, "zeilen": zeilen, "verlierer": len(verlierer), + "live_soll": sum(rang(f, z["live"]) == 2 for f, z in zip(faelle, zeilen)), + "kandidat_soll": sum(rang(f, z["kandidat"]) == 2 for f, z in zip(faelle, zeilen)), + "bestanden": not verlierer} + + +def pruef_text(r, arm_text): + kopf = "BESTANDEN" if r["bestanden"] else f"HARTER VERLIERER ({r['verlierer']} Fälle)" + z = [f"PFLICHTFÄLLE Kandidat {arm_text or '(Live-Stand)'}: {kopf}" + + ("" if r["streng"] else " [nur Rückschritt geprüft - nicht das Tor]"), + f" Soll getroffen: Live {r['live_soll']} von {r['n']}, Kandidat {r['kandidat_soll']} von {r['n']}"] + for x in r["zeilen"]: + mark = "X" if x["verlierer"] else " " + soll = "/".join(x["soll"]) + ("" if not x["toleriert"] else " (tol. " + "/".join(x["toleriert"]) + ")") + z.append(f" {mark} {x['hand']} {x['street']:<5} Soll {soll:<20} live {x['live']:<5} -> {x['kandidat']:<5} " + f"{x['urteil']} {x['spot']}") + return "\n".join(z) + + +# ---------------------------------------------------------------- Anlegen + +def _passt(a, hand, street, to_call): + return (isinstance(a, dict) and a.get("legalActions") and a.get("street") == street + and abs(float(a.get("toCall") or 0) - float(to_call)) < 1e-6) + + +def finde_anfrage(wurzel, hand, street, to_call): + """(anfrage, damals_aktion, grund, quelle) - Schatten-Log, sonst Zugzeile, sonst Micro-Fixture.""" + hand = str(hand) + for e in roentgen.daten(wurzel)["schatten"]: + if livefaelle._hand_aus_zug(e) != hand: + continue + a = roentgen._als_dict(e.get("anfrage")) + if _passt(a, hand, street, to_call): + ant = roentgen._als_dict(e.get("antwort")) or {} + return a, ant.get("action"), ant.get("reason"), "schatten" + for z in roentgen.jsonl(os.path.join(wurzel, "archiv", "lauf", "zuege.jsonl")): + a = roentgen._als_dict(z.get("spot")) + if str(z.get("hand")) == hand and _passt(a, hand, street, to_call): + return a, z.get("aktion"), z.get("grund"), "zug" + for p in sorted(glob.glob(os.path.join(BAUM, "tests", "live_fixture", "micro_*.jsonl"))): + for x in roentgen.jsonl(p): + if str(x.get("hand")) == hand and _passt(x.get("spot"), hand, street, to_call): + return x["spot"], x.get("live"), x.get("live_grund"), os.path.basename(p) + return None, None, None, None + + +def fall(hand, anfrage, damals, grund, quelle, soll, toleriert=(), warum="", netto_bb=None, datum=None): + a = livefaelle.ohne_kennung(anfrage) + return {"id": livefaelle.schluessel(hand, a), "hand": str(hand), "datum": datum, "street": a.get("street"), + "spot": livefaelle.spot_text(a), "live_aktion": norm(damals), "live_grund": grund, + "soll": [norm(s) for s in soll], "toleriert": [norm(s) for s in toleriert], + "warum": warum, "netto_bb": netto_bb, "quelle": quelle, "anfrage": a} + + +def anhaengen(pfad, f): + alt = {x.get("id") for x in roentgen.jsonl(pfad)} if os.path.exists(pfad) else set() + if f["id"] in alt: + return 0 + os.makedirs(os.path.dirname(pfad), exist_ok=True) + with open(pfad, "a", encoding="utf-8", newline="\n") as fh: + fh.write(json.dumps(livefaelle.ohne_kennung(f), ensure_ascii=False) + "\n") + return 1 + + +def laden(pfad=PFLICHT): + return roentgen.jsonl(pfad) + + +# ---------------------------------------------------------------- CLI + +def main(argv=None): + a = argparse.ArgumentParser(description="Pflichtfälle: echte Fehlentscheidungen als hartes Tor") + a.add_argument("--wurzel", default=os.environ.get("ROENTGEN_WURZEL", BAUM)) + a.add_argument("--datei", default=PFLICHT) + a.add_argument("--arm", help="Kandidat 'K=V;K=V' ('' = Live-Stand selbst)") + a.add_argument("--kern", help="Live-Kern (Vorgabe /target/release/rechner)") + a.add_argument("--kern-kandidat", help="anderes Binary für den Kandidaten") + a.add_argument("--schalter", help="Live-Schalter-Datei (Vorgabe /betrieb/kern_schalter.txt)") + a.add_argument("--nur-rueckschritt", action="store_true", help="nur 'schlechter als Live' (Auskunft)") + a.add_argument("--anlegen", nargs=3, metavar=("HAND", "STREET", "TOCALL")) + a.add_argument("--soll", default="") + a.add_argument("--toleriert", default="") + a.add_argument("--warum", default="") + a.add_argument("--netto", type=float) + a.add_argument("--datum") + a.add_argument("--json", action="store_true") + x = a.parse_args(argv) + if hasattr(sys.stdout, "reconfigure"): + sys.stdout.reconfigure(encoding="utf-8", errors="replace") + if x.anlegen: + hand, street, tc = x.anlegen + anfr, damals, grund, quelle = finde_anfrage(x.wurzel, hand, street.upper(), float(tc)) + if anfr is None: + raise SystemExit(f"keine Kern-Anfrage für {hand} {street} toCall {tc}") + soll = [s for s in x.soll.replace(",", "/").split("/") if s] + if not soll: + raise SystemExit("--soll fehlt") + f = fall(hand, anfr, damals, grund, quelle, soll, + [s for s in x.toleriert.replace(",", "/").split("/") if s], x.warum, x.netto, x.datum) + neu = anhaengen(x.datei, f) + print(f"{'neu' if neu else 'schon da'}: {f['hand']} {f['spot']} damals {f['live_aktion']} Soll {f['soll']} ({quelle})") + return 0 + if x.arm is None: + a.error("--arm oder --anlegen") + fs = laden(x.datei) + if not fs: + raise SystemExit(f"keine Fälle in {x.datei}") + ordner = os.path.join(BAUM, "archiv", "roentgen", "kern") + quelle = x.kern or roentgen.kern_pfad(x.wurzel) + k_live = roentgen.kern_aufruf(roentgen.kern_kopie(quelle, ordner, KERN_LIVE)) + k_kand = k_live if not x.kern_kandidat else roentgen.kern_aufruf( + roentgen.kern_kopie(x.kern_kandidat, ordner, KERN_KAND)) + live = roentgen.lies_schalter(x.schalter or os.path.join(x.wurzel, "betrieb", "kern_schalter.txt")) + env_k = livefaelle.kandidat_env(live, livefaelle.arm_lesen(x.arm)) + r = pruefen(fs, k_live, k_kand, live, env_k, streng=not x.nur_rueckschritt) + r["arm"] = x.arm + print(json.dumps(r, ensure_ascii=False, indent=1) if x.json else pruef_text(r, x.arm)) + return 0 if r["bestanden"] else 1 + + +if __name__ == "__main__": + sys.exit(main())