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

N = 1
observations = []
def solve(d):
    return {'field-map':(d['field_map'].get(d['field'],d['field'])), 'operator-map':(d['operator_map'].get(d['op'],d['op'])), 'unresolved-retain':(d['rows']), 'version-advance':(d['target'] if all(x['resolved'] for x in d['rows']) else d['source']), 'migration-apply':(all(x['resolved'] for x in d['rows'])), 'unresolved-count':(sum(not x['resolved'] for x in d['rows']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})], 2: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0})], 3: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})], 4: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0})], 5: [({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})]}
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 {'field-map':(d['field_map'].get(d['field'],d['field'])), 'operator-map':(d['operator_map'].get(d['op'],d['op'])), 'unresolved-retain':(d['rows']), 'version-advance':(d['target'] if all(x['resolved'] for x in d['rows']) else d['source']), 'migration-apply':(d['confirmed']), 'unresolved-count':(sum(not x['resolved'] for x in d['rows']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})], 2: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0})], 3: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})], 4: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0})], 5: [({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})]}
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:
Migrated constraints require complete resolution and review confirmation is violated by the widget projection.

Saved filter migration follows explicit field and operator maps, preserves unresolved rows for review, and advances the schema version only after every row is migrated. This example checks: Migrated constraints require complete resolution and review confirmation.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'field-map':(d['field_map'].get(d['field'],d['field'])), 'operator-map':(d['operator_map'].get(d['op'],d['op'])), 'unresolved-retain':(d['rows']), 'version-advance':(d['target'] if all(x['resolved'] for x in d['rows']) else d['source']), 'migration-apply':(all(x['resolved'] for x in d['rows']) and d['confirmed']), 'unresolved-count':(len(d['rows']))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2})], 2: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0})], 3: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})], 4: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0})], 5: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})]}
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 {'field-map':(d['field_map'].get(d['field'],d['field'])), 'operator-map':(d['operator_map'].get(d['op'],d['op'])), 'unresolved-retain':(d['rows']), 'version-advance':(d['target'] if all(x['resolved'] for x in d['rows']) else d['source']), 'migration-apply':(all(x['resolved'] for x in d['rows']) and d['confirmed']), 'unresolved-count':(int(any(not x['resolved'] for x in d['rows'])))}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2})], 2: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0})], 3: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})], 4: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0})], 5: [({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': False}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': False, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': False}, {'resolved': False}, {'resolved': True}], 'version-advance': 1, 'migration-apply': False, 'unresolved-count': 2}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'same', 'operator_map': {'is': 'eq'}, 'op': 'contains', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'same', 'operator-map': 'contains', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0}), ({'field_map': {'old': 'new'}, 'field': 'old', 'operator_map': {'is': 'eq'}, 'op': 'is', 'rows': [{'resolved': True}], 'target': 2, 'source': 1, 'confirmed': True}, {'field-map': 'new', 'operator-map': 'eq', 'unresolved-retain': [{'resolved': True}], 'version-advance': 2, 'migration-apply': True, 'unresolved-count': 0})]}
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:
Migration diagnostics count every unresolved row is violated by the widget projection.

Saved filter migration follows explicit field and operator maps, preserves unresolved rows for review, and advances the schema version only after every row is migrated. This example checks: Migration diagnostics count every unresolved row.

split: open-access