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

N = 1
observations = []
def solve(d):
    return {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':(str(d['count'] or 0)), 'hide-empty':(not d['hide'] or d['selected'] or d['count']!=0), 'busy-marker':(d['loading'] and d['count'] is None), 'empty-message':(d['count']==0 and not d['loading']), 'stale-count':(d['loading'] and d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False})], 4: [({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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 {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':(str(d['count']) if d['count'] else '?'), 'hide-empty':(not d['hide'] or d['selected'] or d['count']!=0), 'busy-marker':(d['loading'] and d['count'] is None), 'empty-message':(d['count']==0 and not d['loading']), 'stale-count':(d['loading'] and d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False})], 4: [({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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 facet counts are distinct from zero is violated by the widget projection.

Facet choices remain removable when selected even at zero matches; counts distinguish unknown loading state from a known empty result. This example checks: Unknown facet counts are distinct from zero.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':('?' if d['count'] is None else str(d['count'])), 'hide-empty':(not d['hide'] or d['count']!=0), 'busy-marker':(d['loading'] and d['count'] is None), 'empty-message':(d['count']==0 and not d['loading']), 'stale-count':(d['loading'] and d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False})], 4: [({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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 {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':('?' if d['count'] is None else str(d['count'])), 'hide-empty':(not d['hide'] or d['selected']), 'busy-marker':(d['loading'] and d['count'] is None), 'empty-message':(d['count']==0 and not d['loading']), 'stale-count':(d['loading'] and d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False})], 4: [({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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:
Hide-empty retains selected values and unknown counts is violated by the widget projection.

Facet choices remain removable when selected even at zero matches; counts distinguish unknown loading state from a known empty result. This example checks: Hide-empty retains selected values and unknown counts.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':('?' if d['count'] is None else str(d['count'])), 'hide-empty':(not d['hide'] or d['selected'] or d['count']!=0), 'busy-marker':(d['loading']), 'empty-message':(d['count']==0 and not d['loading']), 'stale-count':(d['loading'] and d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False})], 4: [({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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 {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':('?' if d['count'] is None else str(d['count'])), 'hide-empty':(not d['hide'] or d['selected'] or d['count']!=0), 'busy-marker':(d['count'] is None), 'empty-message':(d['count']==0 and not d['loading']), 'stale-count':(d['loading'] and d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False})], 4: [({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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:
Skeleton indicators require loading with no cached count is violated by the widget projection.

Facet choices remain removable when selected even at zero matches; counts distinguish unknown loading state from a known empty result. This example checks: Skeleton indicators require loading with no cached count.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':('?' if d['count'] is None else str(d['count'])), 'hide-empty':(not d['hide'] or d['selected'] or d['count']!=0), 'busy-marker':(d['loading'] and d['count'] is None), 'empty-message':(d['count']==0), 'stale-count':(d['loading'] and d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 4: [({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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 {'zero-selected':(d['selected'] or d['count'] is None or d['count']>0), 'unknown-badge':('?' if d['count'] is None else str(d['count'])), 'hide-empty':(not d['hide'] or d['selected'] or d['count']!=0), 'busy-marker':(d['loading'] and d['count'] is None), 'empty-message':(not d['count'] and not d['loading']), 'stale-count':(d['loading'] and d['count'] is not None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 2: [({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 3: [({'selected': True, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True})], 4: [({'selected': True, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': None, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': 7, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': False, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': False}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': True, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 1, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 7, 'hide': False, 'loading': False}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False})], 5: [({'selected': False, 'count': 0, 'hide': False, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': True, 'loading': False}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': False, 'count': 0, 'hide': True, 'loading': True}, {'zero-selected': False, 'unknown-badge': '0', 'hide-empty': False, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 1, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '1', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': False, 'count': 7, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '7', 'hide-empty': True, 'busy-marker': False, 'empty-message': False, 'stale-count': True}), ({'selected': True, 'count': None, 'hide': False, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': False}), ({'selected': True, 'count': None, 'hide': True, 'loading': True}, {'zero-selected': True, 'unknown-badge': '?', 'hide-empty': True, 'busy-marker': True, 'empty-message': False, 'stale-count': 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:
Empty messages wait for a known settled zero count is violated by the widget projection.

Facet choices remain removable when selected even at zero matches; counts distinguish unknown loading state from a known empty result. This example checks: Empty messages wait for a known settled zero count.

split: open-access