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':(sorted(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'] and 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': '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': ['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': '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': [], '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']})], 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': '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': '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': [], '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': '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': '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': ['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': []})], 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': [], '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': [], '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':(list(reversed([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'] and 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': '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': ['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': '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': [], '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']})], 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': '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': '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': [], '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': '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': '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': ['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': []})], 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': [], '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': [], '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 order follows schema presentation order 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 order follows schema presentation order.

split: open-access


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['visible'] 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'] and 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': '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': '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': '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': ['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': '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': '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': [], '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']})], 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': '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': [], 'selected': [], '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']}), ({'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': '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']})], 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': [], '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': [], 'selected': [], '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': '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': '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': ['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': ['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': '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': ['z'], 'path': 'z', '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': ['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': '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']})]}
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 {'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':(True), 'group-members':([x['path'] for x in d['fields'] if x['group']==d['group'] and 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': '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': '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': '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': ['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': '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': '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': [], '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']})], 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': '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': [], 'selected': [], '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']}), ({'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': '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']})], 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': [], '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': [], 'selected': [], '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': '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': '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': ['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': ['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': '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': ['z'], 'path': 'z', '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': ['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': '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']})]}
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:
Selected field validity comes from queryability rather than visibility 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: Selected field validity comes from queryability rather than visibility.

split: open-access