broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'trim-draft':(d['text'].strip()), 'complete-integer':(bool(d['text'].strip()) and d['text'].strip().lstrip('+-').isascii() and d['text'].strip().lstrip('+-').isdigit() and d['text'].strip().count('+')+d['text'].strip().count('-')<=1), 'incomplete-sign':(d['text'].strip() in ('+','-')), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':(d['text'].strip().endswith('.0')), 'exponent-rejection':('e' in d['text'].lower())}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False})], 2: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '0'}, {'trim-draft': '0', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' 2 '}, {'trim-draft': '2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 3: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False})], 4: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '0'}, {'trim-draft': '0', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' 2 '}, {'trim-draft': '2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': 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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'trim-draft':(d['text'].strip()), 'complete-integer':(bool(d['text'].strip()) and d['text'].strip().lstrip('+-').isascii() and d['text'].strip().lstrip('+-').isdigit() and d['text'].strip().count('+')+d['text'].strip().count('-')<=1), 'incomplete-sign':(d['text'].strip() in ('+','-')), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':(not d['text'].strip().isdigit()), 'exponent-rejection':('e' in d['text'].lower())}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False})], 2: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '0'}, {'trim-draft': '0', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' 2 '}, {'trim-draft': '2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 3: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False})], 4: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '0'}, {'trim-draft': '0', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' 2 '}, {'trim-draft': '2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': 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)

prompt:
Integer-only facet inputs flag all decimal points specifically is violated by the widget projection.

This bounded numeric editor accepts ASCII signed integers with surrounding spaces, preserving incomplete drafts and disallowing exponent, decimal and non-ASCII forms. This example checks: Integer-only facet inputs flag all decimal points specifically.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'trim-draft':(d['text'].strip()), 'complete-integer':(bool(d['text'].strip()) and d['text'].strip().lstrip('+-').isascii() and d['text'].strip().lstrip('+-').isdigit() and d['text'].strip().count('+')+d['text'].strip().count('-')<=1), 'incomplete-sign':(d['text'].strip() in ('+','-')), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':('.' in d['text'].strip()), 'exponent-rejection':('e' in d['text'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False})], 2: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '0'}, {'trim-draft': '0', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' 2 '}, {'trim-draft': '2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 3: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False})], 4: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '0'}, {'trim-draft': '0', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' 2 '}, {'trim-draft': '2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': 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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    return {'trim-draft':(d['text'].strip()), 'complete-integer':(bool(d['text'].strip()) and d['text'].strip().lstrip('+-').isascii() and d['text'].strip().lstrip('+-').isdigit() and d['text'].strip().count('+')+d['text'].strip().count('-')<=1), 'incomplete-sign':(d['text'].strip() in ('+','-')), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':('.' in d['text'].strip()), 'exponent-rejection':(d['text'].lower().endswith('e'))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False})], 2: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '0'}, {'trim-draft': '0', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' 2 '}, {'trim-draft': '2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 3: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False})], 4: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ''}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '0'}, {'trim-draft': '0', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' 2 '}, {'trim-draft': '2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'text': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '+2'}, {'trim-draft': '+2', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '1.0'}, {'trim-draft': '1.0', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1.5'}, {'trim-draft': '1.5', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': True, 'exponent-rejection': False}), ({'text': '1e2'}, {'trim-draft': '1e2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True}), ({'text': '++2'}, {'trim-draft': '++2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False}), ({'text': '٢'}, {'trim-draft': '٢', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': 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)

prompt:
Exponent syntax is rejected even with uppercase exponent markers is violated by the widget projection.

This bounded numeric editor accepts ASCII signed integers with surrounding spaces, preserving incomplete drafts and disallowing exponent, decimal and non-ASCII forms. This example checks: Exponent syntax is rejected even with uppercase exponent markers.

split: open-access


broken_source:
"""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)

source:
"""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)

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

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.

split: open-access


broken_source:
"""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)

source:
"""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)

prompt:
Polarity removal consumes one unescaped prefix only is violated by the widget projection.

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.

split: open-access