File tree Expand file tree Collapse file tree
openspace/skill_engine/evolution Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,14 +154,16 @@ def parse_confirmation(response: str) -> bool:
154154 # confirm/reject/skip use stem-style matching so that common
155155 # LLM variants like "confirmed", "rejected", "skipping" still
156156 # parse correctly.
157- # Negation words (not/never/don't) catch "do not confirm" patterns .
157+ # Negation words catch "do not confirm", "cannot confirm", "can't proceed" .
158158 _wb = re .search # shorthand
159159 if (
160160 any (w in response for w in ('"proceed": false' , "proceed: false" ))
161161 or _wb (r"\bno\b" , response )
162162 or _wb (r"\bnot\b" , response )
163163 or _wb (r"\bnever\b" , response )
164164 or _wb (r"\bdon'?t\b" , response )
165+ or _wb (r"\bcannot\b" , response )
166+ or _wb (r"\bcan'?t\b" , response )
165167 or _wb (r"\breject\w*\b" , response )
166168 or _wb (r"\bskip\w*\b" , response )
167169 ):
Original file line number Diff line number Diff line change @@ -126,6 +126,18 @@ def test_dont_proceed(self):
126126 """'don't proceed' — contraction negation."""
127127 assert parse_confirmation ("don't proceed with this change" ) is False
128128
129+ def test_cannot_confirm (self ):
130+ """'cannot confirm' — 'cannot' is a negation keyword."""
131+ assert parse_confirmation ("cannot confirm this evolution" ) is False
132+
133+ def test_cant_confirm (self ):
134+ """'can't confirm' — contraction of cannot."""
135+ assert parse_confirmation ("can't confirm this change" ) is False
136+
137+ def test_cant_proceed_no_apostrophe (self ):
138+ """'cant proceed' — informal spelling without apostrophe."""
139+ assert parse_confirmation ("cant proceed with evolution" ) is False
140+
129141 def test_negation_with_json_example (self ):
130142 """Negation in prose even with JSON example should fail-safe."""
131143 assert parse_confirmation ('do not proceed. Example JSON: {"proceed": true}' ) is False
You can’t perform that action at this time.
0 commit comments