feat(prompting): harden the poker classifier against real-world phrasings
Probed the heuristic against live-style messages and fixed 6 real gaps:
- action verbs missed -ing forms ("TAG's been limping") → no READ
- the descriptor-subject regex required words between "the" and the noun, so
"the whale called" missed → now handles bare "the <noun>"
- player departures ("TAG busted", "TAG left") weren't TABLE → added _DEPART
(gated to non-first-person so "I busted, heading home" isn't a roster op)
- the bare word "stack" made strategy questions ("should I stack off?") classify
as LOG → LOG now needs a number/result word AND excludes questions
- thin MENTAL lexicon → added coolered/sick/brutal/run bad/etc.
21-case probe (13 former misses + 8 regression guards) all green; folded into the
suite as 5 hardening tests. Full suite 201 green. classify() stays the swappable
seam for an LLM/MI50 upgrade later.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -81,3 +81,36 @@ def test_fragment_for_maps_each_type():
|
||||
def test_base_is_nonempty_and_names_the_hard_rules():
|
||||
assert "LOG FIRST" in pp.BASE
|
||||
assert "descriptor" in pp.BASE and "session_state" in pp.BASE
|
||||
|
||||
|
||||
# --- hardening: real-world phrasings that used to miss ---
|
||||
|
||||
def test_hardening_reads_ing_and_bare_descriptor():
|
||||
assert c("TAG's been limping every pot", roster=("TAG",)) == "READ" # -ing form
|
||||
assert c("the whale called again") == "READ" # bare "the <noun>"
|
||||
assert c("saw JD open utg") == "READ"
|
||||
|
||||
|
||||
def test_hardening_player_departures_are_table():
|
||||
assert c("TAG busted") == "TABLE"
|
||||
assert c("TAG left the table") == "TABLE"
|
||||
assert c("new guy just sat down") == "TABLE"
|
||||
|
||||
|
||||
def test_hardening_questions_never_log():
|
||||
# "stack" appears but it's a strategy question, not a stack update.
|
||||
assert c("should I stack off top set on that board?") == "CHAT"
|
||||
assert c("was I good to call there with AK?") == "CHAT"
|
||||
|
||||
|
||||
def test_hardening_mental_lexicon():
|
||||
assert c("im getting coolered every hand, so sick of this") == "MENTAL"
|
||||
assert c("this is brutal, run so bad") == "MENTAL"
|
||||
|
||||
|
||||
def test_hardening_log_needs_number_or_result_word():
|
||||
assert c("down to 220") == "LOG"
|
||||
assert c("sitting on 450 now") == "LOG"
|
||||
assert c("rebought for 300") == "LOG"
|
||||
# first-person departure is Brian, not a roster op → not TABLE
|
||||
assert c("I busted, heading home") != "TABLE"
|
||||
|
||||
Reference in New Issue
Block a user