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

N = 1
observations = []
def solve(d):
    return {'reset-survivors':([x for x in d['rows'] if x['system']]), 'removal-control':(not d['system']), 'effective-conjunction':([x['value'] for x in d['rows']]), 'export-user':(list(d['rows'])), 'system-badge':('required' if d['system'] else ''), 'user-count':(sum(not x['system'] for x in d['rows']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0})], 2: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1})], 3: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2})], 4: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0})], 5: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1})]}
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 {'reset-survivors':([x for x in d['rows'] if x['system']]), 'removal-control':(not d['system']), 'effective-conjunction':([x['value'] for x in d['rows']]), 'export-user':([x for x in d['rows'] if x['field'] not in d['protected']]), 'system-badge':('required' if d['system'] else ''), 'user-count':(sum(not x['system'] for x in d['rows']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0})], 2: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1})], 3: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2})], 4: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0})], 5: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1})]}
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:
Portable preset export excludes enforced rows by provenance is violated by the widget projection.

System-enforced filter constraints are immutable and survive user resets; user and system operands with the same field remain separate conjuncts. This example checks: Portable preset export excludes enforced rows by provenance.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'reset-survivors':([x for x in d['rows'] if x['system']]), 'removal-control':(not d['system']), 'effective-conjunction':([x['value'] for x in d['rows']]), 'export-user':([x for x in d['rows'] if not x['system']]), 'system-badge':('required' if d['field'] in d['protected'] else ''), 'user-count':(sum(not x['system'] for x in d['rows']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2})], 2: [({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1})], 3: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2})], 4: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0})], 5: [({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2})]}
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 {'reset-survivors':([x for x in d['rows'] if x['system']]), 'removal-control':(not d['system']), 'effective-conjunction':([x['value'] for x in d['rows']]), 'export-user':([x for x in d['rows'] if not x['system']]), 'system-badge':(''), 'user-count':(sum(not x['system'] for x in d['rows']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2})], 2: [({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1})], 3: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2})], 4: [({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0})], 5: [({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': '', 'user-count': 1}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2}), ({'rows': [{'field': 'b', 'value': 4, 'system': False}], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [4], 'export-user': [{'field': 'b', 'value': 4, 'system': False}], 'system-badge': 'required', 'user-count': 1}), ({'rows': [], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': True, 'effective-conjunction': [], 'export-user': [], 'system-badge': '', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [], 'system': True, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [], 'removal-control': False, 'effective-conjunction': [], 'export-user': [], 'system-badge': 'required', 'user-count': 0}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': False, 'field': 'b', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': True, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': '', 'user-count': 2}), ({'rows': [{'field': 'a', 'value': 1, 'system': True}, {'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system': True, 'field': 'a', 'protected': ['a']}, {'reset-survivors': [{'field': 'a', 'value': 1, 'system': True}], 'removal-control': False, 'effective-conjunction': [1, 2, 3], 'export-user': [{'field': 'a', 'value': 2, 'system': False}, {'field': 'a', 'value': 3, 'system': False}], 'system-badge': 'required', 'user-count': 2})]}
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:
Required badges identify actual enforced rows is violated by the widget projection.

System-enforced filter constraints are immutable and survive user resets; user and system operands with the same field remain separate conjuncts. This example checks: Required badges identify actual enforced rows.

split: open-access