FA-25356 / Filter interfaces / Open access
Polarity removal consumes one unescaped prefix only · case 01
Polarity removal consumes one unescaped prefix only is violated by the widget projection.
ROOT CAUSE
The operand-strip decision uses `d['text'].lstrip('-')` instead of the stipulated token-filter-composer projection.
VERIFIED REPAIR
Implement the declared operand-strip projection: `d['text'][1:] if d['text'].startswith('-') and not d['escaped'] else d['text']`.
Unsuccessful approach: The attempted correction `d['text'].replace('-','')` still violates the explicit contract fixtures.
Case contract
A token composer recognizes leading minus as exclusion unless escaped, keeps quoted phrases intact, and commits only complete nonblank tokens. This example checks: Polarity removal consumes one unescaped prefix only.
Why this case matters
Filter-widget state and serialization must preserve user constraints while the view changes.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'polarity-prefix':(d['text'].startswith('-') and not d['escaped']), 'operand-strip':(d['text'].lstrip('-')), 'commit-gate':(bool(d['text'].strip()) and not d['quote_open'] and not d['composing']), 'delimiter-active':(d['delimiter'] and not d['quote_open'] and not d['escaped']), 'quote-feedback':('unfinished phrase' if d['quote_open'] else ''), 'empty-exclusion':(d['text']=='-' and not d['escaped'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False})], 2: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 3: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 4: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 5: [({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': ''} | Failed |
| contract fixture 1 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': ''} | Failed |
| contract fixture 2 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 3 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 4 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': True, 'operand-strip': '', 'polarity-prefix': True, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': True, 'operand-strip': '', 'polarity-prefix': True, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 5 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Failed |
| contract fixture 6 | {'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'x', 'polarity-prefix': True, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': '-x', 'polarity-prefix': True, 'quote-feedback': ''} | Failed |
| contract fixture 7 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': 'x', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '--x', 'polarity-prefix': False, 'quote-feedback': ''} | Failed |
| contract fixture 8 | {'commit-gate': True, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | Passed |
| contract fixture 9 | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | Passed |
SHA-256 / 716a98d19b9ca131175bf0e5db8a7ee7ed63740a6c3726f85f07e4b43bf3d136
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'polarity-prefix':(d['text'].startswith('-') and not d['escaped']), 'operand-strip':(d['text'].replace('-','')), 'commit-gate':(bool(d['text'].strip()) and not d['quote_open'] and not d['composing']), 'delimiter-active':(d['delimiter'] and not d['quote_open'] and not d['escaped']), 'quote-feedback':('unfinished phrase' if d['quote_open'] else ''), 'empty-exclusion':(d['text']=='-' and not d['escaped'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False})], 2: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 3: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 4: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 5: [({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': ''} | Failed |
| contract fixture 1 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': ''} | Failed |
| contract fixture 2 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 3 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 4 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': True, 'operand-strip': '', 'polarity-prefix': True, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': True, 'operand-strip': '', 'polarity-prefix': True, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 5 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Failed |
| contract fixture 6 | {'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'x', 'polarity-prefix': True, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': '-x', 'polarity-prefix': True, 'quote-feedback': ''} | Failed |
| contract fixture 7 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': 'x', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '--x', 'polarity-prefix': False, 'quote-feedback': ''} | Failed |
| contract fixture 8 | {'commit-gate': True, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'ab', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | Failed |
| contract fixture 9 | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': 'ab', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | Failed |
SHA-256 / c8059eee997e0c0b745c77dacaca4bf0d7fc191c12298d5c6ff155d8ce1105a3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'polarity-prefix':(d['text'].startswith('-') and not d['escaped']), 'operand-strip':(d['text'][1:] if d['text'].startswith('-') and not d['escaped'] else d['text']), 'commit-gate':(bool(d['text'].strip()) and not d['quote_open'] and not d['composing']), 'delimiter-active':(d['delimiter'] and not d['quote_open'] and not d['escaped']), 'quote-feedback':('unfinished phrase' if d['quote_open'] else ''), 'empty-exclusion':(d['text']=='-' and not d['escaped'])}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False})], 2: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 3: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '-', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': True}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 4: [({'text': '-', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})], 5: [({'text': '-', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '-', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '--x', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': True, 'operand-strip': '-x', 'commit-gate': False, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': '--x', 'escaped': True, 'quote_open': False, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '--x', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': False, 'quote_open': False, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': True, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': False, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': True, 'delimiter-active': False, 'quote-feedback': '', 'empty-exclusion': False}), ({'text': 'a-b', 'escaped': True, 'quote_open': True, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': 'two words', 'escaped': True, 'quote_open': True, 'composing': False, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'two words', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False}), ({'text': '', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': '', 'commit-gate': False, 'delimiter-active': False, 'quote-feedback': 'unfinished phrase', 'empty-exclusion': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': ''} | Passed |
| contract fixture 1 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': ''} | Passed |
| contract fixture 2 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 3 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 4 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': True, 'operand-strip': '', 'polarity-prefix': True, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': True, 'operand-strip': '', 'polarity-prefix': True, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 5 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': False, 'quote-feedback': 'unfinished phrase'} | Passed |
| contract fixture 6 | {'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': '-x', 'polarity-prefix': True, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': '-x', 'polarity-prefix': True, 'quote-feedback': ''} | Passed |
| contract fixture 7 | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '--x', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '--x', 'polarity-prefix': False, 'quote-feedback': ''} | Passed |
| contract fixture 8 | {'commit-gate': True, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | Passed |
| contract fixture 9 | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | {'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''} | Passed |
SHA-256 / 7a81ba03e1bd98977bd2934efc130d21d60e4a6a9b81136f72d04f83d3ad89a6
Verification & scope
Deterministic bounded UI-state model only; no browser, query engine, network, or production-standard conformance is claimed. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:41:05.857978+00:00.
Case digest / 5480b13e6e6469b3d770a2bb0ca74b5708e4ef0216a9fcafc2235113c498de94