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

N = 1
observations = []
def solve(d):
    return {'literal-preview':(d['text']), 'trim-policy':(d['text'].strip() if d['trim'] else d['text']), 'case-policy':(d['text'].casefold() if d['fold'] else d['text']), 'mode-caption':({'eq':'is exactly','prefix':'starts with','contains':'contains'}[d['mode']]), 'empty-permitted':(d['text']!='' or d['mode']=='eq'), 'case-serialization':({'case_sensitive':d['fold']})}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': '', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'starts with', 'empty-permitted': False, 'case-serialization': {'case_sensitive': True}}), ({'text': ' Ab ', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' Ab ', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': ' Ab ', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' ab ', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': ' Ab ', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': ' Ab ', 'trim-policy': 'Ab', 'case-policy': ' ab ', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': True, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': False, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': True, 'fold': False, 'mode': 'eq'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}})], 2: [({'text': '', 'trim': False, 'fold': False, 'mode': 'prefix'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'starts with', 'empty-permitted': False, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': True, 'fold': False, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': ' Ab ', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' Ab ', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': ' Ab ', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': ' Ab ', 'trim-policy': 'Ab', 'case-policy': ' Ab ', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a*b', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a*b', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': True, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'Straße', 'trim': False, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}})], 3: [({'text': '', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'contains', 'empty-permitted': False, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': True, 'fold': True, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': ' Ab ', 'trim': True, 'fold': True, 'mode': 'eq'}, {'literal-preview': ' Ab ', 'trim-policy': 'Ab', 'case-policy': ' ab ', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a*b', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'Straße', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'strasse', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'Straße', 'trim': True, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}})], 4: [({'text': '', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': ' Ab ', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' Ab ', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a*b', 'trim': False, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': True, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'Straße', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'Straße', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'strasse', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'Straße', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'strasse', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': '', 'trim': True, 'fold': False, 'mode': 'contains'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'contains', 'empty-permitted': False, 'case-serialization': {'case_sensitive': True}})], 5: [({'text': '', 'trim': False, 'fold': True, 'mode': 'prefix'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'starts with', 'empty-permitted': False, 'case-serialization': {'case_sensitive': False}}), ({'text': ' Ab ', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' ab ', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': True, 'fold': True, 'mode': 'contains'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': False, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': True, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'Straße', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'Straße', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'contains', 'empty-permitted': False, 'case-serialization': {'case_sensitive': False}}), ({'text': '', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'starts with', 'empty-permitted': False, 'case-serialization': {'case_sensitive': 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 {'literal-preview':(d['text']), 'trim-policy':(d['text'].strip() if d['trim'] else d['text']), 'case-policy':(d['text'].casefold() if d['fold'] else d['text']), 'mode-caption':({'eq':'is exactly','prefix':'starts with','contains':'contains'}[d['mode']]), 'empty-permitted':(d['text']!='' or d['mode']=='eq'), 'case-serialization':({})}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'text': '', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': '', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'starts with', 'empty-permitted': False, 'case-serialization': {'case_sensitive': True}}), ({'text': ' Ab ', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' Ab ', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': ' Ab ', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' ab ', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': ' Ab ', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': ' Ab ', 'trim-policy': 'Ab', 'case-policy': ' ab ', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': True, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': False, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': True, 'fold': False, 'mode': 'eq'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}})], 2: [({'text': '', 'trim': False, 'fold': False, 'mode': 'prefix'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'starts with', 'empty-permitted': False, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': True, 'fold': False, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': ' Ab ', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' Ab ', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': ' Ab ', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': ' Ab ', 'trim-policy': 'Ab', 'case-policy': ' Ab ', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a*b', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a*b', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': True, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'Straße', 'trim': False, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}})], 3: [({'text': '', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'contains', 'empty-permitted': False, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': True, 'fold': True, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': ' Ab ', 'trim': True, 'fold': True, 'mode': 'eq'}, {'literal-preview': ' Ab ', 'trim-policy': 'Ab', 'case-policy': ' ab ', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a*b', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'Straße', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'strasse', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'Straße', 'trim': True, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}})], 4: [({'text': '', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': ' Ab ', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' Ab ', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a*b', 'trim': False, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': True, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'a%b', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'Straße', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'Straße', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'strasse', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'Straße', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'strasse', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': '', 'trim': True, 'fold': False, 'mode': 'contains'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'contains', 'empty-permitted': False, 'case-serialization': {'case_sensitive': True}})], 5: [({'text': '', 'trim': False, 'fold': True, 'mode': 'prefix'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'starts with', 'empty-permitted': False, 'case-serialization': {'case_sensitive': False}}), ({'text': ' Ab ', 'trim': False, 'fold': True, 'mode': 'eq'}, {'literal-preview': ' Ab ', 'trim-policy': ' Ab ', 'case-policy': ' ab ', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a*b', 'trim': True, 'fold': True, 'mode': 'contains'}, {'literal-preview': 'a*b', 'trim-policy': 'a*b', 'case-policy': 'a*b', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': False, 'fold': True, 'mode': 'prefix'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'a%b', 'trim': True, 'fold': True, 'mode': 'eq'}, {'literal-preview': 'a%b', 'trim-policy': 'a%b', 'case-policy': 'a%b', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': False}}), ({'text': 'Straße', 'trim': False, 'fold': False, 'mode': 'contains'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'contains', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': 'Straße', 'trim': True, 'fold': False, 'mode': 'prefix'}, {'literal-preview': 'Straße', 'trim-policy': 'Straße', 'case-policy': 'Straße', 'mode-caption': 'starts with', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': False, 'fold': False, 'mode': 'eq'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'is exactly', 'empty-permitted': True, 'case-serialization': {'case_sensitive': True}}), ({'text': '', 'trim': False, 'fold': True, 'mode': 'contains'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'contains', 'empty-permitted': False, 'case-serialization': {'case_sensitive': False}}), ({'text': '', 'trim': True, 'fold': True, 'mode': 'prefix'}, {'literal-preview': '', 'trim-policy': '', 'case-policy': '', 'mode-caption': 'starts with', 'empty-permitted': False, 'case-serialization': {'case_sensitive': 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:
Serialized case policy uses positive case-sensitive polarity is violated by the widget projection.

Text filters distinguish exact, prefix and contains modes; literal punctuation remains literal, and trimming and case policy are explicit editor options. This example checks: Serialized case policy uses positive case-sensitive polarity.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'null-label':('(no value)' if not d['value'] else d['value']), 'null-operand':({'is_null':True} if d['kind']=='null' else {'eq':d['value']}), 'missing-distinction':(d['kind']=='missing'), 'empty-caption':('(empty text)' if d['kind']=='text' and d['value']=='' else d['value']), 'identity-tag':([d['kind'],d['value']]), 'count-key':('@null' if d['kind']=='null' else ('@missing' if d['kind']=='missing' else 'text:'+d['value']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'})], 2: [({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'})], 3: [({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'})], 4: [({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'})], 5: [({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text: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)

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 {'null-label':('(no value)' if d['value']=='null' else d['value']), 'null-operand':({'is_null':True} if d['kind']=='null' else {'eq':d['value']}), 'missing-distinction':(d['kind']=='missing'), 'empty-caption':('(empty text)' if d['kind']=='text' and d['value']=='' else d['value']), 'identity-tag':([d['kind'],d['value']]), 'count-key':('@null' if d['kind']=='null' else ('@missing' if d['kind']=='missing' else 'text:'+d['value']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'})], 2: [({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'})], 3: [({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'})], 4: [({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'})], 5: [({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text: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:
Null labels are selected by semantic kind rather than falsy captions is violated by the widget projection.

The null facet uses a reserved sentinel separate from empty string, missing field and literal null text; its label and serialization retain that distinction. This example checks: Null labels are selected by semantic kind rather than falsy captions.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'null-label':('(no value)' if d['kind']=='null' else d['value']), 'null-operand':({'eq':d['value']}), 'missing-distinction':(d['kind']=='missing'), 'empty-caption':('(empty text)' if d['kind']=='text' and d['value']=='' else d['value']), 'identity-tag':([d['kind'],d['value']]), 'count-key':('@null' if d['kind']=='null' else ('@missing' if d['kind']=='missing' else 'text:'+d['value']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'})], 2: [({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'})], 3: [({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'})], 4: [({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'})], 5: [({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text: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 {'null-label':('(no value)' if d['kind']=='null' else d['value']), 'null-operand':({'is_null':True} if not d['value'] else {'eq':d['value']}), 'missing-distinction':(d['kind']=='missing'), 'empty-caption':('(empty text)' if d['kind']=='text' and d['value']=='' else d['value']), 'identity-tag':([d['kind'],d['value']]), 'count-key':('@null' if d['kind']=='null' else ('@missing' if d['kind']=='missing' else 'text:'+d['value']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'})], 2: [({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'})], 3: [({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'})], 4: [({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'})], 5: [({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text: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:
A null facet serializes a null predicate instead of text equality is violated by the widget projection.

The null facet uses a reserved sentinel separate from empty string, missing field and literal null text; its label and serialization retain that distinction. This example checks: A null facet serializes a null predicate instead of text equality.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'null-label':('(no value)' if d['kind']=='null' else d['value']), 'null-operand':({'is_null':True} if d['kind']=='null' else {'eq':d['value']}), 'missing-distinction':(d['kind'] in ('null','missing')), 'empty-caption':('(empty text)' if d['kind']=='text' and d['value']=='' else d['value']), 'identity-tag':([d['kind'],d['value']]), 'count-key':('@null' if d['kind']=='null' else ('@missing' if d['kind']=='missing' else 'text:'+d['value']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'})], 2: [({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'})], 3: [({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'})], 4: [({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'})], 5: [({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text: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 {'null-label':('(no value)' if d['kind']=='null' else d['value']), 'null-operand':({'is_null':True} if d['kind']=='null' else {'eq':d['value']}), 'missing-distinction':(d['value']==''), 'empty-caption':('(empty text)' if d['kind']=='text' and d['value']=='' else d['value']), 'identity-tag':([d['kind'],d['value']]), 'count-key':('@null' if d['kind']=='null' else ('@missing' if d['kind']=='missing' else 'text:'+d['value']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'})], 2: [({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'})], 3: [({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'})], 4: [({'kind': 'null', 'value': '0'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['null', '0'], 'count-key': '@null'}), ({'kind': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text:0'}), ({'kind': 'text', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['text', 'None'], 'count-key': 'text:None'}), ({'kind': 'null', 'value': 'null'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['null', 'null'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'x'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['null', 'x'], 'count-key': '@null'}), ({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'})], 5: [({'kind': 'null', 'value': 'None'}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': 'None', 'identity-tag': ['null', 'None'], 'count-key': '@null'}), ({'kind': 'missing', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': True, 'empty-caption': '0', 'identity-tag': ['missing', '0'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'kind': 'missing', 'value': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], 'count-key': '@missing'}), ({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'text', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': False, 'empty-caption': 'null', 'identity-tag': ['text', 'null'], 'count-key': 'text:null'}), ({'kind': 'text', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': False, 'empty-caption': 'x', 'identity-tag': ['text', 'x'], 'count-key': 'text:x'}), ({'kind': 'text', 'value': '0'}, {'null-label': '0', 'null-operand': {'eq': '0'}, 'missing-distinction': False, 'empty-caption': '0', 'identity-tag': ['text', '0'], 'count-key': 'text: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:
Missing-field indicators do not collapse null or empty-string options is violated by the widget projection.

The null facet uses a reserved sentinel separate from empty string, missing field and literal null text; its label and serialization retain that distinction. This example checks: Missing-field indicators do not collapse null or empty-string options.

split: open-access