diff --git a/generate/intent.py b/generate/intent.py index 3a682642..f83d08f8 100644 --- a/generate/intent.py +++ b/generate/intent.py @@ -210,7 +210,7 @@ _RULES: tuple[tuple[re.Pattern[str], IntentTag], ...] = ( (re.compile(r"how\s+(?:do|can|should|would)\s+(?:I|we|you)\s+", re.IGNORECASE), IntentTag.PROCEDURE), (re.compile(r"(?:is|are|does|do|can|could|would|should|was|were|has|have|will)\s+.+\??\s*$", re.IGNORECASE), IntentTag.VERIFICATION), (re.compile(r"(?:no|that'?s\s+(?:not|wrong)|incorrect|actually|correction)", re.IGNORECASE), IntentTag.CORRECTION), - (re.compile(r"remember\s+", re.IGNORECASE), IntentTag.RECALL), + (re.compile(r"(?:remember|recall)\s+", re.IGNORECASE), IntentTag.RECALL), ) diff --git a/tests/test_intent_subject_extraction.py b/tests/test_intent_subject_extraction.py index beec39f3..1f347479 100644 --- a/tests/test_intent_subject_extraction.py +++ b/tests/test_intent_subject_extraction.py @@ -108,6 +108,16 @@ def test_verification_extracts_head_noun(prompt: str, expected_subject: str) -> ("Remember light", "light"), ("Remember the truth", "truth"), ("Remember a procedure", "procedure"), + # ``recall`` is a synonym imperative of ``remember`` and must + # route identically. The articulation breadth benchmark probe + # ``"Recall truth."`` was misclassified as UNKNOWN until the + # trigger pattern in ``_RULES`` was widened to ``(?:remember| + # recall)\s+`` — without this case the regression silently + # returns. + ("Recall light", "light"), + ("Recall the truth", "truth"), + ("Recall a procedure", "procedure"), + ("Recall truth.", "truth"), ], ) def test_recall_strips_articles(prompt: str, expected_subject: str) -> None: