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

N = 1
observations = []
def solve(d):
    return {'retired-visible':(d['current']), 'add-permission':(d['current'] and not d['blocked']), 'remove-permission':(d['selected'] and not d['locked']), 'label-fallback':(d['label'] if d['label'] is not None else d['id']), 'retired-badge':(d['selected'] and not d['current']), 'serialize-identity':(d['id'] if d['selected'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'})], 2: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'})], 3: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 4: [({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 5: [({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'})]}
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 {'retired-visible':(d['selected']), 'add-permission':(d['current'] and not d['blocked']), 'remove-permission':(d['selected'] and not d['locked']), 'label-fallback':(d['label'] if d['label'] is not None else d['id']), 'retired-badge':(d['selected'] and not d['current']), 'serialize-identity':(d['id'] if d['selected'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'})], 2: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'})], 3: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 4: [({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 5: [({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'})]}
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:
Retired selected enums remain visible for inspection is violated by the widget projection.

An enum filter may retain a retired selected value but cannot add it again. Captions come from current labels with a stable-ID fallback. This example checks: Retired selected enums remain visible for inspection.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'retired-visible':(d['current'] or d['selected']), 'add-permission':(not d['blocked']), 'remove-permission':(d['selected'] and not d['locked']), 'label-fallback':(d['label'] if d['label'] is not None else d['id']), 'retired-badge':(d['selected'] and not d['current']), 'serialize-identity':(d['id'] if d['selected'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 2: [({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'})], 3: [({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 4: [({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 5: [({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'})]}
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 {'retired-visible':(d['current'] or d['selected']), 'add-permission':(d['current']), 'remove-permission':(d['selected'] and not d['locked']), 'label-fallback':(d['label'] if d['label'] is not None else d['id']), 'retired-badge':(d['selected'] and not d['current']), 'serialize-identity':(d['id'] if d['selected'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 2: [({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'})], 3: [({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 4: [({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 5: [({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'})]}
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:
New enum additions require an active unblocked option is violated by the widget projection.

An enum filter may retain a retired selected value but cannot add it again. Captions come from current labels with a stable-ID fallback. This example checks: New enum additions require an active unblocked option.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'retired-visible':(d['current'] or d['selected']), 'add-permission':(d['current'] and not d['blocked']), 'remove-permission':(d['selected'] and d['current']), 'label-fallback':(d['label'] if d['label'] is not None else d['id']), 'retired-badge':(d['selected'] and not d['current']), 'serialize-identity':(d['id'] if d['selected'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 2: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'})], 3: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 4: [({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 5: [({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'})]}
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 {'retired-visible':(d['current'] or d['selected']), 'add-permission':(d['current'] and not d['blocked']), 'remove-permission':(d['selected']), 'label-fallback':(d['label'] if d['label'] is not None else d['id']), 'retired-badge':(d['selected'] and not d['current']), 'serialize-identity':(d['id'] if d['selected'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 2: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'})], 3: [({'current': False, 'selected': True, 'blocked': False, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 4: [({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': True, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': False, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None})], 5: [({'current': False, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': True, 'blocked': True, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': True, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': True, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': True, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': True, 'selected': True, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': 'stable-id'}), ({'current': False, 'selected': False, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': False, 'label': '', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': '', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': False, 'blocked': True, 'locked': True, 'label': 'Caption', 'id': 'stable-id'}, {'retired-visible': False, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'Caption', 'retired-badge': False, 'serialize-identity': None}), ({'current': False, 'selected': True, 'blocked': False, 'locked': True, 'label': None, 'id': 'stable-id'}, {'retired-visible': True, 'add-permission': False, 'remove-permission': False, 'label-fallback': 'stable-id', 'retired-badge': True, 'serialize-identity': 'stable-id'})]}
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 retired selection remains removable unless the criterion is locked is violated by the widget projection.

An enum filter may retain a retired selected value but cannot add it again. Captions come from current labels with a stable-ID fallback. This example checks: A retired selection remains removable unless the criterion is locked.

split: open-access