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']=='missing'), 'empty-caption':(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': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], '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'}, {'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-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'})], 2: [({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'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': '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'})], 3: [({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'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'}, {'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': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'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': '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'})], 5: [({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'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'}, {'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': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'})]}
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['kind']=='missing'), 'empty-caption':('(empty text)' if not 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': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'kind': 'missing', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': True, 'empty-caption': '', 'identity-tag': ['missing', ''], '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'}, {'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-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'})], 2: [({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'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': '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'})], 3: [({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'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'}, {'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': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'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': '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'})], 5: [({'kind': 'text', 'value': ''}, {'null-label': '', 'null-operand': {'eq': ''}, 'missing-distinction': False, 'empty-caption': '(empty text)', 'identity-tag': ['text', ''], 'count-key': 'text:'}), ({'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'}, {'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': 'null', 'value': ''}, {'null-label': '(no value)', 'null-operand': {'is_null': True}, 'missing-distinction': False, 'empty-caption': '', 'identity-tag': ['null', ''], 'count-key': '@null'})]}
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:
Empty text receives its own display caption 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: Empty text receives its own display caption.

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']=='missing'), 'empty-caption':('(empty text)' if d['kind']=='text' and d['value']=='' else d['value']), 'identity-tag':(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': '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'}), ({'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': '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': '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-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': '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': ''}, {'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'})]}
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['kind']=='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'] or None]), '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': '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'}), ({'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': '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': '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-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': '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': ''}, {'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'})]}
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:
Facet identities preserve both semantic kind and empty-string payload 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: Facet identities preserve both semantic kind and empty-string payload.

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']=='missing'), 'empty-caption':('(empty text)' if d['kind']=='text' and d['value']=='' else d['value']), 'identity-tag':([d['kind'],d['value']]), 'count-key':(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': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'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': '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': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], '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': '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': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'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': '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'})], 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 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']!='text' 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': 'missing', 'value': 'null'}, {'null-label': 'null', 'null-operand': {'eq': 'null'}, 'missing-distinction': True, 'empty-caption': 'null', 'identity-tag': ['missing', 'null'], 'count-key': '@missing'}), ({'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': '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': 'None'}, {'null-label': 'None', 'null-operand': {'eq': 'None'}, 'missing-distinction': True, 'empty-caption': 'None', 'identity-tag': ['missing', 'None'], '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': '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': 'missing', 'value': 'x'}, {'null-label': 'x', 'null-operand': {'eq': 'x'}, 'missing-distinction': True, 'empty-caption': 'x', 'identity-tag': ['missing', 'x'], 'count-key': '@missing'}), ({'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': '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'})], 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:
Count lookup keeps null and missing buckets in separate namespaces 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: Count lookup keeps null and missing buckets in separate namespaces.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'active-false':(d['choice']=='true'), 'typed-operand':(None if d['choice']=='any' else d['choice']=='true'), 'choice-caption':({'any':'Any','true':'Yes','false':'No'}[d['choice']]), 'invert':({'any':'any','true':'false','false':'true'}[d['choice']]), 'hydrate':({'true':'true','false':'false'}.get(d['raw'],'any')), 'false-badge':('negative' if d['choice']=='false' else ('positive' if d['choice']=='true' else 'neutral'))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'choice': 'false', 'raw': ''}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': 'yes'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'yes'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': '0'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'false', 'raw': 'true'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'true', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'false'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'false', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'yes'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': ''}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'})], 2: [({'choice': 'false', 'raw': 'true'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'true', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': 'true'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'true', 'false-badge': 'neutral'}), ({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': ''}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': 'false'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'false', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': 'yes'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': '0'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': ''}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'true'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'true', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'})], 3: [({'choice': 'false', 'raw': 'false'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'false', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': '0'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': 'true'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'true', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'yes'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': '0'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'false', 'raw': ''}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'true'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'true', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'yes'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'})], 4: [({'choice': 'false', 'raw': 'yes'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': 'false'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'false', 'false-badge': 'neutral'}), ({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': ''}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': 'true'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'true', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': 'yes'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': '0'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': ''}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'true'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'true', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'})], 5: [({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': ''}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': ''}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'true'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'true', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'yes'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': '0'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'false', 'raw': ''}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'true'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'true', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'false'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'false', 'false-badge': 'negative'})]}
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 {'active-false':(True), 'typed-operand':(None if d['choice']=='any' else d['choice']=='true'), 'choice-caption':({'any':'Any','true':'Yes','false':'No'}[d['choice']]), 'invert':({'any':'any','true':'false','false':'true'}[d['choice']]), 'hydrate':({'true':'true','false':'false'}.get(d['raw'],'any')), 'false-badge':('negative' if d['choice']=='false' else ('positive' if d['choice']=='true' else 'neutral'))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'choice': 'false', 'raw': ''}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': 'yes'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'yes'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': '0'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'false', 'raw': 'true'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'true', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'false'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'false', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'yes'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': ''}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'})], 2: [({'choice': 'false', 'raw': 'true'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'true', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': 'true'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'true', 'false-badge': 'neutral'}), ({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': ''}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': 'false'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'false', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': 'yes'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': '0'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': ''}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'true'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'true', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'})], 3: [({'choice': 'false', 'raw': 'false'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'false', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': '0'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': 'true'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'true', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'yes'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': '0'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'false', 'raw': ''}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'true'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'true', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'yes'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'})], 4: [({'choice': 'false', 'raw': 'yes'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': 'false'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'false', 'false-badge': 'neutral'}), ({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': ''}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': 'true'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'true', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': 'yes'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'any', 'raw': '0'}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': ''}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'true'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'true', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'})], 5: [({'choice': 'false', 'raw': '0'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'any', 'raw': ''}, {'active-false': False, 'typed-operand': None, 'choice-caption': 'Any', 'invert': 'any', 'hydrate': 'any', 'false-badge': 'neutral'}), ({'choice': 'true', 'raw': ''}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'true'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'true', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'false'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'false', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': 'yes'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'true', 'raw': '0'}, {'active-false': True, 'typed-operand': True, 'choice-caption': 'Yes', 'invert': 'false', 'hydrate': 'any', 'false-badge': 'positive'}), ({'choice': 'false', 'raw': ''}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'any', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'true'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'true', 'false-badge': 'negative'}), ({'choice': 'false', 'raw': 'false'}, {'active-false': True, 'typed-operand': False, 'choice-caption': 'No', 'invert': 'true', 'hydrate': 'false', 'false-badge': 'negative'})]}
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:
False-only filtering remains an active constraint is violated by the widget projection.

A boolean filter has any/true/false states; false is an active constraint, and the UI does not coerce string labels into booleans. This example checks: False-only filtering remains an active constraint.

split: open-access