FAILURE MAP
← Case archive

FA-25351 / Filter interfaces / Open access

Only an unescaped leading minus selects exclusion · case 01

Only an unescaped leading minus selects exclusion is violated by the widget projection.

Verified by executionVariant 1 · 10 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The polarity-prefix decision uses `d['text'].startswith('-')` instead of the stipulated token-filter-composer projection.

VERIFIED REPAIR

Implement the declared polarity-prefix projection: `d['text'].startswith('-') and not d['escaped']`.

Unsuccessful approach: The attempted correction `'-' in d['text'] and not d['escaped']` 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: Only an unescaped leading minus selects exclusion.

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('-')), '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': 'a-b', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': True, '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': 'a-b', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', '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': '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': '-', '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': 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})], 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': 'a-b', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', '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': 'a-b', 'escaped': False, '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': '--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 fixtureActualExpectedOutcome
contract fixture 0{'commit-gate': True, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '-', 'polarity-prefix': True, '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': True, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''}{'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'a-b', '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': True, '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': ''}Passed
contract fixture 7{'commit-gate': False, 'delimiter-active': False, 'empty-exclusion': False, 'operand-strip': '--x', 'polarity-prefix': True, '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 / d8c5324b23b58dd1c4cfbb2252c878c4fc377538537216c7cafe8578ddbe4f88

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':('-' in d['text'] 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': 'a-b', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': True, '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': 'a-b', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', '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': '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': '-', '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': 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})], 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': 'a-b', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', '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': 'a-b', 'escaped': False, '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': '--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 fixtureActualExpectedOutcome
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': True, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': True, 'quote-feedback': ''}{'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'a-b', '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'}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': True, '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': '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 / 815e3643022578d434f4e974b9745fa216bd73f4a17aa91a7a3ce5ca6b9297d9

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': 'a-b', 'escaped': False, 'quote_open': False, 'composing': True, 'delimiter': True}, {'polarity-prefix': False, 'operand-strip': 'a-b', 'commit-gate': False, 'delimiter-active': True, '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': 'a-b', 'escaped': False, 'quote_open': True, 'composing': True, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', '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': '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': '-', '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': 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})], 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': 'a-b', 'escaped': False, 'quote_open': True, 'composing': False, 'delimiter': False}, {'polarity-prefix': False, 'operand-strip': 'a-b', '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': 'a-b', 'escaped': False, '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': '--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 fixtureActualExpectedOutcome
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': True, 'empty-exclusion': False, 'operand-strip': 'a-b', 'polarity-prefix': False, 'quote-feedback': ''}{'commit-gate': False, 'delimiter-active': True, 'empty-exclusion': False, 'operand-strip': 'a-b', '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 / 6e401aa2b26a6ad914dac465ff9bfe76532cb7cebea5792aa0116a5f4b16e2f7

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.843852+00:00.

Case digest / f2348b196bbdde039e0fb39b21a7307765282daaa9d1e5625787b0f33890b46f