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

N = 1
observations = []
def solve(d):
    return {'active-projection':(d['operand'] if d['enabled'] else None), 'saved-projection':({'operand':d['operand']} if d['enabled'] else None), 'edit-permission':(not d['locked']), 'toggle-permission':(not d['locked'] and not d['mandatory']), 'strike-caption':(not d['enabled']), 'invalid-active':(d['enabled'] and not d['valid'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 2: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 3: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 4: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 5: [({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': 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 {'active-projection':(d['operand'] if d['enabled'] else None), 'saved-projection':({'operand':d['operand'],'enabled':True}), 'edit-permission':(not d['locked']), 'toggle-permission':(not d['locked'] and not d['mandatory']), 'strike-caption':(not d['enabled']), 'invalid-active':(d['enabled'] and not d['valid'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 2: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 3: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 4: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 5: [({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': 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:
Saved filters retain disabled operands and their enabled flag is violated by the widget projection.

A disabled filter criterion remains editable and serialized in saved configuration but is omitted from the active query projection; locked criteria differ from disabled ones. This example checks: Saved filters retain disabled operands and their enabled flag.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'active-projection':(d['operand'] if d['enabled'] else None), 'saved-projection':({'operand':d['operand'],'enabled':d['enabled']}), 'edit-permission':(d['enabled'] and not d['locked']), 'toggle-permission':(not d['locked'] and not d['mandatory']), 'strike-caption':(not d['enabled']), 'invalid-active':(d['enabled'] and not d['valid'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 2: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 3: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 4: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 5: [({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': 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 {'active-projection':(d['operand'] if d['enabled'] else None), 'saved-projection':({'operand':d['operand'],'enabled':d['enabled']}), 'edit-permission':(not d['enabled']), 'toggle-permission':(not d['locked'] and not d['mandatory']), 'strike-caption':(not d['enabled']), 'invalid-active':(d['enabled'] and not d['valid'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 2: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 3: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 4: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 5: [({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': 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:
Disabled but unlocked criteria remain editable is violated by the widget projection.

A disabled filter criterion remains editable and serialized in saved configuration but is omitted from the active query projection; locked criteria differ from disabled ones. This example checks: Disabled but unlocked criteria remain editable.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'active-projection':(d['operand'] if d['enabled'] else None), 'saved-projection':({'operand':d['operand'],'enabled':d['enabled']}), 'edit-permission':(not d['locked']), 'toggle-permission':(not d['locked']), 'strike-caption':(not d['enabled']), 'invalid-active':(d['enabled'] and not d['valid'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 2: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 3: [({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 4: [({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 5: [({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': 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 {'active-projection':(d['operand'] if d['enabled'] else None), 'saved-projection':({'operand':d['operand'],'enabled':d['enabled']}), 'edit-permission':(not d['locked']), 'toggle-permission':(not d['mandatory']), 'strike-caption':(not d['enabled']), 'invalid-active':(d['enabled'] and not d['valid'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 2: [({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 3: [({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False})], 4: [({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': True}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': True})], 5: [({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': True, 'valid': False}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 'x', 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 'x', 'saved-projection': {'operand': 'x', 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': False, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 0, 'enabled': False}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': True, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': False, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': True, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': False, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 0, 'enabled': True, 'locked': True, 'mandatory': True, 'valid': True}, {'active-projection': 0, 'saved-projection': {'operand': 0, 'enabled': True}, 'edit-permission': False, 'toggle-permission': False, 'strike-caption': False, 'invalid-active': False}), ({'operand': 'x', 'enabled': False, 'locked': False, 'mandatory': False, 'valid': True}, {'active-projection': None, 'saved-projection': {'operand': 'x', 'enabled': False}, 'edit-permission': True, 'toggle-permission': True, 'strike-caption': True, 'invalid-active': 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:
Mandatory and locked criteria both reject disable toggles is violated by the widget projection.

A disabled filter criterion remains editable and serialized in saved configuration but is omitted from the active query projection; locked criteria differ from disabled ones. This example checks: Mandatory and locked criteria both reject disable toggles.

split: open-access