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

N = 1
observations = []
def solve(d):
    return {'operator-options':([x for x in d['operators'] if x in d['supported']]), 'retain-operator':(d['op'] if d['op'] in d['supported'] else d['default']), 'operand-reset':(d['value'] if d['old_type']==d['new_type'] else None), 'unknown-field':(d['field'] not in d['fields']), 'nullable-op':('missing' in d['supported'] and d['nullable']), 'row-complete':(d['field'] in d['fields'] and d['value'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': True}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False})], 2: [({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': True})], 3: [({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': True})], 4: [({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': True}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': True}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False})], 5: [({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': True}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': 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 {'operator-options':([x for x in d['operators'] if x in d['supported']]), 'retain-operator':(d['op'] if d['op'] in d['supported'] else d['default']), 'operand-reset':(d['value'] if d['old_type']==d['new_type'] else None), 'unknown-field':(d['field'] not in d['fields']), 'nullable-op':('missing' in d['supported'] and d['nullable']), 'row-complete':(d['op'] in d['supported'] and (d['op']=='missing' or d['value'] is not None))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': True}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False})], 2: [({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': True})], 3: [({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': True})], 4: [({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': True}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': True}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False})], 5: [({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': True, 'nullable-op': True, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['missing', 'in'], 'op': 'missing', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'text', 'field': 'a', 'fields': ['a'], 'nullable': False}, {'operator-options': ['missing'], 'retain-operator': 'missing', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': True}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'number', 'field': 'a', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': False, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': None, 'old_type': 'number', 'new_type': 'text', 'field': 'z', 'fields': ['a'], 'nullable': False}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': None, 'unknown-field': True, 'nullable-op': False, 'row-complete': False}), ({'operators': ['eq', 'missing'], 'supported': ['eq'], 'op': 'eq', 'default': 'eq', 'value': 0, 'old_type': 'number', 'new_type': 'number', 'field': 'z', 'fields': ['a'], 'nullable': True}, {'operator-options': ['eq'], 'retain-operator': 'eq', 'operand-reset': 0, 'unknown-field': True, 'nullable-op': False, 'row-complete': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A complete row requires a known field, supported operator and appropriate operand is violated by the widget projection.

A filter-builder row uses schema capability lists to determine available operators and reset incompatible operands when its field changes. This example checks: A complete row requires a known field, supported operator and appropriate operand.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'count-prefix':(''), 'count-text':('?' if d['mode']=='unknown' else str(d['count'])), 'zero-disable':(d['mode']=='exact' and d['count']==0 and not d['selected']), 'total-source':(d['total']), 'approximate-badge':(d['mode']=='lower'), 'count-sort-ready':(d['mode']=='exact' and not d['loading'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 2: [({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 3: [({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 4: [({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True})], 5: [({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(d):
    return {'count-prefix':('≥' if d['mode']!='exact' else ''), 'count-text':('?' if d['mode']=='unknown' else str(d['count'])), 'zero-disable':(d['mode']=='exact' and d['count']==0 and not d['selected']), 'total-source':(d['total']), 'approximate-badge':(d['mode']=='lower'), 'count-sort-ready':(d['mode']=='exact' and not d['loading'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 2: [({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 3: [({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 4: [({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True})], 5: [({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': 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:
Lower-bound and unknown facet count modes have distinct prefixes is violated by the widget projection.

Facet count presentations use exact, lower-bound or unknown modes; selected zero-count values remain represented and total counts are never inferred by adding overlapping facet buckets. This example checks: Lower-bound and unknown facet count modes have distinct prefixes.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'count-prefix':('≥' if d['mode']=='lower' else ('?' if d['mode']=='unknown' else '')), 'count-text':(str(d['count'])), 'zero-disable':(d['mode']=='exact' and d['count']==0 and not d['selected']), 'total-source':(d['total']), 'approximate-badge':(d['mode']=='lower'), 'count-sort-ready':(d['mode']=='exact' and not d['loading'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 2: [({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 3: [({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 4: [({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True})], 5: [({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': 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 {'count-prefix':('≥' if d['mode']=='lower' else ('?' if d['mode']=='unknown' else '')), 'count-text':('?' if not d['count'] else str(d['count'])), 'zero-disable':(d['mode']=='exact' and d['count']==0 and not d['selected']), 'total-source':(d['total']), 'approximate-badge':(d['mode']=='lower'), 'count-sort-ready':(d['mode']=='exact' and not d['loading'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 2: [({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 3: [({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False})], 4: [({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '≥', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': True})], 5: [({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [3, 4], 'loading': False}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'lower', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '≥', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': True, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'unknown', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '?', 'count-text': '?', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': True, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 0, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '0', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': False, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': False}), ({'mode': 'exact', 'count': 4, 'selected': True, 'total': 5, 'buckets': [1], 'loading': True}, {'count-prefix': '', 'count-text': '4', 'zero-disable': False, 'total-source': 5, 'approximate-badge': False, 'count-sort-ready': 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:
Unknown mode suppresses the cached numeric count without hiding exact zero is violated by the widget projection.

Facet count presentations use exact, lower-bound or unknown modes; selected zero-count values remain represented and total counts are never inferred by adding overlapping facet buckets. This example checks: Unknown mode suppresses the cached numeric count without hiding exact zero.

split: open-access