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

N = 1
observations = []
def solve(d):
    return {'scope-match':(d['saved_scope']==d['scope']), 'schema-gate':(d['saved_schema']==d['schema']), 'criteria-match':(set(d['saved'])==set(d['current'])), 'overwrite-gate':(not d['locked']), 'fork-owner':(d['viewer']), 'dirty-marker':(set(d['saved'])!=set(d['current']) or d['saved_scope']!=d['scope'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 2: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True})], 3: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True})], 4: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 5: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})]}
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 {'scope-match':(d['saved_scope']==d['scope']), 'schema-gate':(d['saved_schema']==d['schema']), 'criteria-match':(set(d['saved'])==set(d['current'])), 'overwrite-gate':(d['owner']==d['viewer']), 'fork-owner':(d['viewer']), 'dirty-marker':(set(d['saved'])!=set(d['current']) or d['saved_scope']!=d['scope'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 2: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True})], 3: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True})], 4: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 5: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})]}
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:
Overwrite requires ownership and an unlocked preset is violated by the widget projection.

Saved filter presets are tied to schema and scope; matching is order-insensitive, while dirty state and replacement preserve explicit ownership. This example checks: Overwrite requires ownership and an unlocked preset.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'scope-match':(d['saved_scope']==d['scope']), 'schema-gate':(d['saved_schema']==d['schema']), 'criteria-match':(set(d['saved'])==set(d['current'])), 'overwrite-gate':(d['owner']==d['viewer'] and not d['locked']), 'fork-owner':(d['owner']), 'dirty-marker':(set(d['saved'])!=set(d['current']) or d['saved_scope']!=d['scope'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 2: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True})], 3: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True})], 4: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 5: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})]}
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 {'scope-match':(d['saved_scope']==d['scope']), 'schema-gate':(d['saved_schema']==d['schema']), 'criteria-match':(set(d['saved'])==set(d['current'])), 'overwrite-gate':(d['owner']==d['viewer'] and not d['locked']), 'fork-owner':(None), 'dirty-marker':(set(d['saved'])!=set(d['current']) or d['saved_scope']!=d['scope'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 2: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True})], 3: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True})], 4: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 5: [({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
A copied preset belongs to the copying viewer is violated by the widget projection.

Saved filter presets are tied to schema and scope; matching is order-insensitive, while dirty state and replacement preserve explicit ownership. This example checks: A copied preset belongs to the copying viewer.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'scope-match':(d['saved_scope']==d['scope']), 'schema-gate':(d['saved_schema']==d['schema']), 'criteria-match':(set(d['saved'])==set(d['current'])), 'overwrite-gate':(d['owner']==d['viewer'] and not d['locked']), 'fork-owner':(d['viewer']), 'dirty-marker':(set(d['saved'])!=set(d['current']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False})], 2: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True})], 3: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True})], 4: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 5: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})]}
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 {'scope-match':(d['saved_scope']==d['scope']), 'schema-gate':(d['saved_schema']==d['schema']), 'criteria-match':(set(d['saved'])==set(d['current'])), 'overwrite-gate':(d['owner']==d['viewer'] and not d['locked']), 'fork-owner':(d['viewer']), 'dirty-marker':(d['saved_scope']!=d['scope'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False})], 2: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': False}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True})], 3: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True})], 4: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})], 5: [({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': [], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'a', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'a'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': False, 'schema-gate': True, 'criteria-match': True, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'a', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': False}, {'scope-match': False, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': True, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 0, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'u', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'u', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 1, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': False}, {'scope-match': True, 'schema-gate': True, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True}), ({'saved_scope': 'ab', 'scope': 'ab', 'saved_schema': 1, 'schema': 2, 'saved': ['a', 'b'], 'current': ['b', 'c'], 'owner': 'u', 'viewer': 'v', 'locked': True}, {'scope-match': True, 'schema-gate': False, 'criteria-match': False, 'overwrite-gate': False, 'fork-owner': 'v', 'dirty-marker': True})]}
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:
Preset dirtiness includes both criterion and scope changes is violated by the widget projection.

Saved filter presets are tied to schema and scope; matching is order-insensitive, while dirty state and replacement preserve explicit ownership. This example checks: Preset dirtiness includes both criterion and scope changes.

split: open-access