FA-25336 / Filter interfaces / Open access
Whitespace-only bounds become open while zero remains a bound · case 01
Whitespace-only bounds become open while zero remains a bound is violated by the widget projection.
ROOT CAUSE
The blank-open decision uses `not d['text']` instead of the stipulated numeric-text-editor projection.
VERIFIED REPAIR
Implement the declared blank-open projection: `d['text'].strip()==''`.
Unsuccessful approach: The attempted correction `d['text'].strip() in ('','0')` still violates the explicit contract fixtures.
Case contract
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.
Why this case matters
Filter-widget state and serialization must preserve user constraints while the view changes.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': ''} | {'blank-open': True, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': ''} | Failed |
| contract fixture 1 | {'blank-open': False, 'complete-integer': True, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '0'} | {'blank-open': False, 'complete-integer': True, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '0'} | Passed |
| contract fixture 2 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '+'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '+'} | Passed |
| contract fixture 3 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '-'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '-'} | Passed |
| contract fixture 4 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.0'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.0'} | Passed |
| contract fixture 5 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.5'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.5'} | Passed |
| contract fixture 6 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1e2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1e2'} | Passed |
| contract fixture 7 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1E2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1E2'} | Passed |
| contract fixture 8 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '++2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '++2'} | Passed |
| contract fixture 9 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '٢'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '٢'} | Passed |
SHA-256 / 00fe569a7e99f1b95ff0aa515bb8aa876624a6d433429a7e31f2dd47c8d15a9e
2 / The unsuccessful fix
Exit 1"""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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'blank-open': True, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': ''} | {'blank-open': True, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': ''} | Passed |
| contract fixture 1 | {'blank-open': True, 'complete-integer': True, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '0'} | {'blank-open': False, 'complete-integer': True, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '0'} | Failed |
| contract fixture 2 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '+'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '+'} | Passed |
| contract fixture 3 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '-'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '-'} | Passed |
| contract fixture 4 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.0'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.0'} | Passed |
| contract fixture 5 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.5'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.5'} | Passed |
| contract fixture 6 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1e2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1e2'} | Passed |
| contract fixture 7 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1E2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1E2'} | Passed |
| contract fixture 8 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '++2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '++2'} | Passed |
| contract fixture 9 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '٢'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '٢'} | Passed |
SHA-256 / 323767d853bd66226ab4db04b760f2d771166414bf4eb6f17c87dfe400fa29b0
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
return {'trim-draft':(d['text'].strip()), 'complete-integer':(bool(d['text'].strip()) and d['text'].strip().lstrip('+-').isascii() and d['text'].strip().lstrip('+-').isdigit() and d['text'].strip().count('+')+d['text'].strip().count('-')<=1), 'incomplete-sign':(d['text'].strip() in ('+','-')), 'blank-open':(d['text'].strip()==''), 'fraction-rejection':('.' in d['text'].strip()), 'exponent-rejection':('e' in d['text'].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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'blank-open': True, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': ''} | {'blank-open': True, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': ''} | Passed |
| contract fixture 1 | {'blank-open': False, 'complete-integer': True, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '0'} | {'blank-open': False, 'complete-integer': True, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '0'} | Passed |
| contract fixture 2 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '+'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '+'} | Passed |
| contract fixture 3 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '-'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': True, 'trim-draft': '-'} | Passed |
| contract fixture 4 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.0'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.0'} | Passed |
| contract fixture 5 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.5'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': True, 'incomplete-sign': False, 'trim-draft': '1.5'} | Passed |
| contract fixture 6 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1e2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1e2'} | Passed |
| contract fixture 7 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1E2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': True, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '1E2'} | Passed |
| contract fixture 8 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '++2'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '++2'} | Passed |
| contract fixture 9 | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '٢'} | {'blank-open': False, 'complete-integer': False, 'exponent-rejection': False, 'fraction-rejection': False, 'incomplete-sign': False, 'trim-draft': '٢'} | Passed |
SHA-256 / f2e5aa33df33985ba3a887a23f579040abe17b0b71a6a6523d2213c1a9e79668
Verification & scope
Deterministic bounded UI-state model only; no browser, query engine, network, or production-standard conformance is claimed. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:41:05.748142+00:00.
Case digest / b7f735746da6da7cb61d62961e8ef780af4d49df24145a80af7caab13d38eb6d