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

N = 1
observations = []
def solve(d):
    return {'queryable-fields':([x['path'] for x in d['fields'] if x['queryable']]), 'hidden-queryable':([x['path'] for x in d['fields'] if x['queryable'] and (x['visible'] or x['path'] in d['selected'])]), 'caption-collision':([x['path'] for x in d['fields'] if sum(y['label']==x['label'] for y in d['fields'])>1]), 'schema-order':([x['path'] for x in d['fields'] if x['queryable']]), 'selected-capability':(next((x['queryable'] for x in d['fields'] if x['path']==d['path']),False)), 'group-members':([x['path'] for x in d['fields'] if x['group']==d['group']])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'z', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'none', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []})], 2: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'a', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [], 'selected': [], 'path': 'a', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'z', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'none', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']})], 3: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'none', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'z', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []})], 4: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'none', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [], 'selected': [], 'path': 'z', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'a', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'z', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []})], 5: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'none', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['b']})]}
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 {'queryable-fields':([x['path'] for x in d['fields'] if x['queryable']]), 'hidden-queryable':([x['path'] for x in d['fields'] if x['queryable'] and (x['visible'] or x['path'] in d['selected'])]), 'caption-collision':([x['path'] for x in d['fields'] if sum(y['label']==x['label'] for y in d['fields'])>1]), 'schema-order':([x['path'] for x in d['fields'] if x['queryable']]), 'selected-capability':(next((x['queryable'] for x in d['fields'] if x['path']==d['path']),False)), 'group-members':([x['path'] for x in d['fields'] if x['queryable']])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'z', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'none', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []})], 2: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'a', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [], 'selected': [], 'path': 'a', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'z', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'none', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']})], 3: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'none', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'z', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []})], 4: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'none', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [], 'selected': [], 'path': 'z', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'a', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'none', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'z', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []})], 5: [({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'a', 'group': 'g'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['z']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['z', 'b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': False, 'group-members': ['b']}), ({'fields': [], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': [], 'path': 'none', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'z', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'a', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [], 'selected': ['z'], 'path': 'none', 'group': 'h'}, {'queryable-fields': [], 'hidden-queryable': [], 'caption-collision': [], 'schema-order': [], 'selected-capability': False, 'group-members': []}), ({'fields': [{'path': 'z', 'label': 'Name', 'queryable': True, 'visible': False, 'group': 'g'}, {'path': 'a', 'label': 'Name', 'queryable': False, 'visible': True, 'group': 'g'}, {'path': 'b', 'label': 'Other', 'queryable': True, 'visible': True, 'group': 'h'}], 'selected': [], 'path': 'z', 'group': 'h'}, {'queryable-fields': ['z', 'b'], 'hidden-queryable': ['b'], 'caption-collision': ['z', 'a'], 'schema-order': ['z', 'b'], 'selected-capability': True, 'group-members': ['b']})]}
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:
Field chooser sections combine group membership with query capability is violated by the widget projection.

The filter-field chooser lists only queryable schema fields, uses stable field paths, disambiguates duplicate captions and preserves the schema-defined field ordering. This example checks: Field chooser sections combine group membership with query capability.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'wrapper-toggle':(True), 'normal-form-mode':(('or' if d['mode']=='and' else 'and') if d['negated'] else d['mode']), 'complement-all':([d['complements'].get(x,x) for x in d['ops']] if d['negated'] else d['ops']), 'normalizable':(all(x in d['complements'] for x in d['ops'])), 'retain-wrapper':(d['negated'] and not all(x in d['complements'] for x in d['ops'])), 'negated-caption':('NOT ('+d['caption']+')' if d['negated'] else d['caption'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'})], 2: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'})], 3: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'})], 4: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'a AND b'})], 5: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'})]}
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 {'wrapper-toggle':(False), 'normal-form-mode':(('or' if d['mode']=='and' else 'and') if d['negated'] else d['mode']), 'complement-all':([d['complements'].get(x,x) for x in d['ops']] if d['negated'] else d['ops']), 'normalizable':(all(x in d['complements'] for x in d['ops'])), 'retain-wrapper':(d['negated'] and not all(x in d['complements'] for x in d['ops'])), 'negated-caption':('NOT ('+d['caption']+')' if d['negated'] else d['caption'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'})], 2: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'})], 3: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (a AND b)'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (x)'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'})], 4: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': True, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'a AND b'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'a AND b'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'a AND b'})], 5: [({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'a AND b'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne', 'regex'], 'normalizable': False, 'retain-wrapper': True, 'negated-caption': 'NOT (a AND b)'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'and', 'complement-all': ['regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': False, 'mode': 'or', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq', 'regex'], 'caption': 'x'}, {'wrapper-toggle': True, 'normal-form-mode': 'or', 'complement-all': ['eq', 'regex'], 'normalizable': False, 'retain-wrapper': False, 'negated-caption': 'x'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': [], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': [], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'}), ({'negated': True, 'mode': 'and', 'complements': {'eq': 'ne', 'ne': 'eq', 'exists': 'missing', 'missing': 'exists'}, 'ops': ['eq'], 'caption': 'x'}, {'wrapper-toggle': False, 'normal-form-mode': 'or', 'complement-all': ['ne'], 'normalizable': True, 'retain-wrapper': False, 'negated-caption': 'NOT (x)'})]}
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:
Group negation toggles rather than only setting or clearing is violated by the widget projection.

Negating a filter group preserves its explicit wrapper; converting a negated group to normal form flips conjunction and complements every supported child operator atomically. This example checks: Group negation toggles rather than only setting or clearing.

split: open-access