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

N = 1
observations = []
def solve(d):
    return {'known-fields':([x for x in d['pairs'] if x[0] in d['fields']]), 'unknown-diagnostics':([x[0] for x in d['pairs'] if x[0] not in d['fields']]), 'repeat-values':([dict(d['pairs'])[d['field']]] if d['field'] in dict(d['pairs']) else []), 'version-acceptance':(d['version'] in d['supported']), 'unknown-operator':(d['op'] not in d['operators']), 'atomic-publication':(d['valid'] and d['version'] in d['supported'] and d['op'] in d['operators'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False})], 2: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False})], 3: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True})], 4: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False})], 5: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    return {'known-fields':([x for x in d['pairs'] if x[0] in d['fields']]), 'unknown-diagnostics':([x[0] for x in d['pairs'] if x[0] not in d['fields']]), 'repeat-values':(sorted(set(v for k,v in d['pairs'] if k==d['field']))), 'version-acceptance':(d['version'] in d['supported']), 'unknown-operator':(d['op'] not in d['operators']), 'atomic-publication':(d['valid'] and d['version'] in d['supported'] and d['op'] in d['operators'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False})], 2: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False})], 3: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True})], 4: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False})], 5: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Hydration retains ordered repeated operands rather than last-value wins is violated by the widget projection.

URL hydration validates filter fields and operators before publishing a draft, preserving duplicate value order while rejecting unknown schema references. This example checks: Hydration retains ordered repeated operands rather than last-value wins.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'known-fields':([x for x in d['pairs'] if x[0] in d['fields']]), 'unknown-diagnostics':([x[0] for x in d['pairs'] if x[0] not in d['fields']]), 'repeat-values':([v for k,v in d['pairs'] if k==d['field']]), 'version-acceptance':(d['version']<=max(d['supported'])), 'unknown-operator':(d['op'] not in d['operators']), 'atomic-publication':(d['valid'] and d['version'] in d['supported'] and d['op'] in d['operators'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False})], 2: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False})], 3: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True})], 4: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False})], 5: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(d):
    return {'known-fields':([x for x in d['pairs'] if x[0] in d['fields']]), 'unknown-diagnostics':([x[0] for x in d['pairs'] if x[0] not in d['fields']]), 'repeat-values':([v for k,v in d['pairs'] if k==d['field']]), 'version-acceptance':(d['version']==max(d['supported'])), 'unknown-operator':(d['op'] not in d['operators']), 'atomic-publication':(d['valid'] and d['version'] in d['supported'] and d['op'] in d['operators'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False})], 2: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False})], 3: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': True})], 4: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['v'], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 3, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': False, 'atomic-publication': False})], 5: [({'pairs': [['a', 'z'], ['a', 'x'], ['q', 'v']], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'eq', 'operators': ['eq'], 'valid': False}, {'known-fields': [['a', 'z'], ['a', 'x']], 'unknown-diagnostics': ['q'], 'repeat-values': ['z', 'x'], 'version-acceptance': False, 'unknown-operator': False, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 1, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': True, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [], 'fields': ['a'], 'field': 'q', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'a', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [''], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 0, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False}), ({'pairs': [['a', '']], 'fields': ['a'], 'field': 'q', 'version': 2, 'supported': [1, 3], 'op': 'bad', 'operators': ['eq'], 'valid': True}, {'known-fields': [['a', '']], 'unknown-diagnostics': [], 'repeat-values': [], 'version-acceptance': False, 'unknown-operator': True, 'atomic-publication': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
URL versions must belong to the explicit supported set is violated by the widget projection.

URL hydration validates filter fields and operators before publishing a draft, preserving duplicate value order while rejecting unknown schema references. This example checks: URL versions must belong to the explicit supported set.

split: open-access