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

N = 1
observations = []
def solve(d):
    return {'display-bound':(None if d['base'] is None else d['base']//d['scale']), 'parse-bound':(None if d['text']=='' else int(d['text'])*d['scale']), 'switch-preserve':(d['base']), 'fraction-indicator':(d['base'] is not None and d['base']%d['scale']!=0), 'step-storage':(d['step']*d['scale']), 'open-placeholder':('any' if not d['base'] else str(d['base']//d['scale']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'base': 0, 'scale': 1, 'text': '', 'step': 1}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'}), ({'base': None, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': None, 'parse-bound': 0, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': 'any'}), ({'base': None, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': None, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': None, 'parse-bound': 20, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 3, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 3, 'parse-bound': 0, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '3'}), ({'base': 3, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 3, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 20, 'open-placeholder': '0'})], 2: [({'base': 0, 'scale': 1, 'text': '', 'step': 2}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '0'}), ({'base': None, 'scale': 10, 'text': '', 'step': 1}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 1, 'text': '0', 'step': 1}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '', 'step': 1}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '2', 'step': 1}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 3, 'scale': 1, 'text': '0', 'step': 1}, {'display-bound': 3, 'parse-bound': 0, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '3'}), ({'base': 3, 'scale': 10, 'text': '', 'step': 1}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 3, 'scale': 10, 'text': '2', 'step': 1}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 20, 'scale': 1, 'text': '0', 'step': 1}, {'display-bound': 20, 'parse-bound': 0, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '20'}), ({'base': 20, 'scale': 10, 'text': '', 'step': 1}, {'display-bound': 2, 'parse-bound': None, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': '2'})], 3: [({'base': 0, 'scale': 1, 'text': '0', 'step': 1}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'}), ({'base': None, 'scale': 10, 'text': '0', 'step': 2}, {'display-bound': None, 'parse-bound': 0, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 10, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 3, 'scale': 1, 'text': '', 'step': 2}, {'display-bound': 3, 'parse-bound': None, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '3'}), ({'base': 3, 'scale': 1, 'text': '2', 'step': 2}, {'display-bound': 3, 'parse-bound': 2, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '3'}), ({'base': 3, 'scale': 10, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 20, 'scale': 1, 'text': '', 'step': 2}, {'display-bound': 20, 'parse-bound': None, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '20'}), ({'base': 20, 'scale': 1, 'text': '2', 'step': 2}, {'display-bound': 20, 'parse-bound': 2, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '20'}), ({'base': 20, 'scale': 10, 'text': '0', 'step': 2}, {'display-bound': 2, 'parse-bound': 0, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '2'}), ({'base': None, 'scale': 1, 'text': '', 'step': 2}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': 'any'})], 4: [({'base': 0, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '0'}), ({'base': None, 'scale': 1, 'text': '', 'step': 1}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': 'any'}), ({'base': 3, 'scale': 1, 'text': '2', 'step': 1}, {'display-bound': 3, 'parse-bound': 2, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '3'}), ({'base': 3, 'scale': 10, 'text': '0', 'step': 1}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 20, 'scale': 1, 'text': '', 'step': 1}, {'display-bound': 20, 'parse-bound': None, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '20'}), ({'base': 20, 'scale': 1, 'text': '2', 'step': 1}, {'display-bound': 20, 'parse-bound': 2, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '20'}), ({'base': 20, 'scale': 10, 'text': '0', 'step': 1}, {'display-bound': 2, 'parse-bound': 0, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': '2'}), ({'base': None, 'scale': 1, 'text': '2', 'step': 1}, {'display-bound': None, 'parse-bound': 2, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': 'any'}), ({'base': None, 'scale': 10, 'text': '0', 'step': 1}, {'display-bound': None, 'parse-bound': 0, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 1, 'text': '', 'step': 1}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'})], 5: [({'base': 0, 'scale': 1, 'text': '2', 'step': 1}, {'display-bound': 0, 'parse-bound': 2, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'}), ({'base': None, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': None, 'parse-bound': 0, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': 'any'}), ({'base': 3, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 20, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 20, 'parse-bound': 0, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '20'}), ({'base': 20, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': 2, 'parse-bound': None, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '2'}), ({'base': 20, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': 2, 'parse-bound': 20, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '2'}), ({'base': None, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': None, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': None, 'parse-bound': 20, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '0'})]}
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 {'display-bound':(None if d['base'] is None else d['base']//d['scale']), 'parse-bound':(None if d['text']=='' else int(d['text'])*d['scale']), 'switch-preserve':(d['base']), 'fraction-indicator':(d['base'] is not None and d['base']%d['scale']!=0), 'step-storage':(d['step']*d['scale']), 'open-placeholder':(str((d['base'] or 0)//d['scale']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'base': 0, 'scale': 1, 'text': '', 'step': 1}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'}), ({'base': None, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': None, 'parse-bound': 0, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': 'any'}), ({'base': None, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': None, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': None, 'parse-bound': 20, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 3, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 3, 'parse-bound': 0, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '3'}), ({'base': 3, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 3, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 20, 'open-placeholder': '0'})], 2: [({'base': 0, 'scale': 1, 'text': '', 'step': 2}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '0'}), ({'base': None, 'scale': 10, 'text': '', 'step': 1}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 1, 'text': '0', 'step': 1}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '', 'step': 1}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '2', 'step': 1}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 3, 'scale': 1, 'text': '0', 'step': 1}, {'display-bound': 3, 'parse-bound': 0, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '3'}), ({'base': 3, 'scale': 10, 'text': '', 'step': 1}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 3, 'scale': 10, 'text': '2', 'step': 1}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 20, 'scale': 1, 'text': '0', 'step': 1}, {'display-bound': 20, 'parse-bound': 0, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '20'}), ({'base': 20, 'scale': 10, 'text': '', 'step': 1}, {'display-bound': 2, 'parse-bound': None, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': '2'})], 3: [({'base': 0, 'scale': 1, 'text': '0', 'step': 1}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'}), ({'base': None, 'scale': 10, 'text': '0', 'step': 2}, {'display-bound': None, 'parse-bound': 0, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 10, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 3, 'scale': 1, 'text': '', 'step': 2}, {'display-bound': 3, 'parse-bound': None, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '3'}), ({'base': 3, 'scale': 1, 'text': '2', 'step': 2}, {'display-bound': 3, 'parse-bound': 2, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '3'}), ({'base': 3, 'scale': 10, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 20, 'scale': 1, 'text': '', 'step': 2}, {'display-bound': 20, 'parse-bound': None, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '20'}), ({'base': 20, 'scale': 1, 'text': '2', 'step': 2}, {'display-bound': 20, 'parse-bound': 2, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '20'}), ({'base': 20, 'scale': 10, 'text': '0', 'step': 2}, {'display-bound': 2, 'parse-bound': 0, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '2'}), ({'base': None, 'scale': 1, 'text': '', 'step': 2}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': 'any'})], 4: [({'base': 0, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '0'}), ({'base': None, 'scale': 1, 'text': '', 'step': 1}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': 'any'}), ({'base': 3, 'scale': 1, 'text': '2', 'step': 1}, {'display-bound': 3, 'parse-bound': 2, 'switch-preserve': 3, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '3'}), ({'base': 3, 'scale': 10, 'text': '0', 'step': 1}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 10, 'open-placeholder': '0'}), ({'base': 20, 'scale': 1, 'text': '', 'step': 1}, {'display-bound': 20, 'parse-bound': None, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '20'}), ({'base': 20, 'scale': 1, 'text': '2', 'step': 1}, {'display-bound': 20, 'parse-bound': 2, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '20'}), ({'base': 20, 'scale': 10, 'text': '0', 'step': 1}, {'display-bound': 2, 'parse-bound': 0, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': '2'}), ({'base': None, 'scale': 1, 'text': '2', 'step': 1}, {'display-bound': None, 'parse-bound': 2, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': 'any'}), ({'base': None, 'scale': 10, 'text': '0', 'step': 1}, {'display-bound': None, 'parse-bound': 0, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 10, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 1, 'text': '', 'step': 1}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'})], 5: [({'base': 0, 'scale': 1, 'text': '2', 'step': 1}, {'display-bound': 0, 'parse-bound': 2, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 1, 'open-placeholder': '0'}), ({'base': None, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': None, 'parse-bound': 0, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': 'any'}), ({'base': 3, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': 0, 'parse-bound': 20, 'switch-preserve': 3, 'fraction-indicator': True, 'step-storage': 20, 'open-placeholder': '0'}), ({'base': 20, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 20, 'parse-bound': 0, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '20'}), ({'base': 20, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': 2, 'parse-bound': None, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '2'}), ({'base': 20, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': 2, 'parse-bound': 20, 'switch-preserve': 20, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '2'}), ({'base': None, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': None, 'parse-bound': None, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': None, 'scale': 10, 'text': '2', 'step': 2}, {'display-bound': None, 'parse-bound': 20, 'switch-preserve': None, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': 'any'}), ({'base': 0, 'scale': 1, 'text': '0', 'step': 2}, {'display-bound': 0, 'parse-bound': 0, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 2, 'open-placeholder': '0'}), ({'base': 0, 'scale': 10, 'text': '', 'step': 2}, {'display-bound': 0, 'parse-bound': None, 'switch-preserve': 0, 'fraction-indicator': False, 'step-storage': 20, 'open-placeholder': '0'})]}
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:
Zero bounds display numerically instead of as an open-bound placeholder is violated by the widget projection.

The filter stores canonical integer base units while the editor shows exact scaled integers; a unit switch changes presentation without changing the committed quantity. This example checks: Zero bounds display numerically instead of as an open-bound placeholder.

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']), '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'].lower())}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, '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': ' + '}, {'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': '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})], 2: [({'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': '٢'}, {'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': '-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})], 3: [({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, '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': '-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': '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': '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})], 4: [({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, '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': 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': '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}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'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}), ({'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': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True})]}
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'].replace(' ','')), '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'].lower())}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, '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': ' + '}, {'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': '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})], 2: [({'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': '٢'}, {'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': '-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})], 3: [({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, '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': '-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': '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': '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})], 4: [({'text': ' '}, {'trim-draft': '', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': True, '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': 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': '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}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'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}), ({'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': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True})]}
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:
Outer whitespace is trimmed without joining internal digits 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: Outer whitespace is trimmed without joining internal digits.

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':(d['text'].strip().lstrip('+-').isdigit()), 'incomplete-sign':(d['text'].strip() in ('+','-')), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':('.' in d['text'].strip()), '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': '++2'}, {'trim-draft': '++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': ' + '}, {'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': '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})], 2: [({'text': '٢'}, {'trim-draft': '٢', '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': ''}, {'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': '-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})], 3: [({'text': '++2'}, {'trim-draft': '++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}), ({'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': '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})], 4: [({'text': '٢'}, {'trim-draft': '٢', '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': '++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': 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': '-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})], 5: [({'text': '++2'}, {'trim-draft': '++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}), ({'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': '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': True, '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':(d['text'].strip().isdigit()), 'incomplete-sign':(d['text'].strip() in ('+','-')), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':('.' in d['text'].strip()), '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': '++2'}, {'trim-draft': '++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': ' + '}, {'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': '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})], 2: [({'text': '٢'}, {'trim-draft': '٢', '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': ''}, {'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': '-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})], 3: [({'text': '++2'}, {'trim-draft': '++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}), ({'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': '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})], 4: [({'text': '٢'}, {'trim-draft': '٢', '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': '++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': 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': '-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})], 5: [({'text': '++2'}, {'trim-draft': '++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}), ({'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': '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': True, '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:
Complete numeric drafts allow one ASCII sign and ASCII digits only 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: Complete numeric drafts allow one ASCII sign and ASCII digits only.

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':(not d['text'].strip().isdigit()), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':('.' in d['text'].strip()), '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': ''}, {'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': 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': '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': ' '}, {'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': 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': '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}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 3: [({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, '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': '-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': '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': '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})], 4: [({'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': '++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': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'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': '+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': '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': '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'] in ('+','-')), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':('.' in d['text'].strip()), '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': ''}, {'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': 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': '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': ' '}, {'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': 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': '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}), ({'text': '-'}, {'trim-draft': '-', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 3: [({'text': '1 2'}, {'trim-draft': '1 2', 'complete-integer': False, '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': '-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': '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': '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})], 4: [({'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': '++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': '-3'}, {'trim-draft': '-3', 'complete-integer': True, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'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': '+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': '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': '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:
A lone trimmed sign is an incomplete draft rather than a general invalid value 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: A lone trimmed sign is an incomplete draft rather than a general invalid value.

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':(not d['text']), 'fraction-rejection':('.' in d['text'].strip()), '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': ' '}, {'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': ' + '}, {'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': '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})], 2: [({'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': '٢'}, {'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': ' 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}), ({'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})], 3: [({'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': '-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': '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})], 4: [({'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': 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': ' 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}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'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': '-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': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True})]}
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() in ('','0')), 'fraction-rejection':('.' in d['text'].strip()), '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': ' '}, {'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': ' + '}, {'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': '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})], 2: [({'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': '٢'}, {'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': ' 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}), ({'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})], 3: [({'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': '-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': '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})], 4: [({'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': 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': ' 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}), ({'text': ' + '}, {'trim-draft': '+', 'complete-integer': False, 'incomplete-sign': True, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': False})], 5: [({'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': '-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': '1E2'}, {'trim-draft': '1E2', 'complete-integer': False, 'incomplete-sign': False, 'blank-open': False, 'fraction-rejection': False, 'exponent-rejection': True})]}
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:
Whitespace-only bounds become open while zero remains a bound 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: Whitespace-only bounds become open while zero remains a bound.

split: open-access