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

N = 1
observations = []
def solve(d):
    return {'compatible-child':([x for x in d['selected'] if x in d['allowed']]), 'child-editor-enabled':(d['parent'] is not None and not d['loading']), 'request-parent':({'parent':d['parent']} if d['parent'] is not None else None), 'parent-reset-child':([] if d['parent'] is None else list(d['selected'])), 'pending-validation':(d['loading']), 'invalid-child-notice':([x for x in d['selected'] if x not in d['allowed']] if not d['loading'] else [])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'parent': None, 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']})], 2: [({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []})], 3: [({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 4: [({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 5: [({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []})]}
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 {'compatible-child':([x for x in d['selected'] if x in d['allowed']]), 'child-editor-enabled':(d['parent'] is not None and not d['loading']), 'request-parent':({'parent':d['parent']} if d['parent'] is not None else None), 'parent-reset-child':([] if d['parent'] is None else list(d['selected'])), 'pending-validation':(bool(d['selected']) and d['parent'] is not None), 'invalid-child-notice':([x for x in d['selected'] if x not in d['allowed']] if not d['loading'] else [])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'parent': None, 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']})], 2: [({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []})], 3: [({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 4: [({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 5: [({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []})]}
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:
Pending validation markers apply only to selected loading dependents is violated by the widget projection.

A child facet is meaningful only inside its selected parent scope. Parent changes invalidate incompatible child selections but retain compatible identities. This example checks: Pending validation markers apply only to selected loading dependents.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'compatible-child':([x for x in d['selected'] if x in d['allowed']]), 'child-editor-enabled':(d['parent'] is not None and not d['loading']), 'request-parent':({'parent':d['parent']} if d['parent'] is not None else None), 'parent-reset-child':([] if d['parent'] is None else list(d['selected'])), 'pending-validation':(d['parent'] is not None and d['loading'] and bool(d['selected'])), 'invalid-child-notice':([x for x in d['selected'] if x not in d['allowed']])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']})], 2: [({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']})], 3: [({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 4: [({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 5: [({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []})]}
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 {'compatible-child':([x for x in d['selected'] if x in d['allowed']]), 'child-editor-enabled':(d['parent'] is not None and not d['loading']), 'request-parent':({'parent':d['parent']} if d['parent'] is not None else None), 'parent-reset-child':([] if d['parent'] is None else list(d['selected'])), 'pending-validation':(d['parent'] is not None and d['loading'] and bool(d['selected'])), 'invalid-child-notice':([])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': '', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']})], 2: [({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']})], 3: [({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 4: [({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': 'p', 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a', 'z']}), ({'parent': None, 'loading': True, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': [], 'allowed': ['a']}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []})], 5: [({'parent': '', 'loading': True, 'selected': ['a', 'z'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': 'p', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': 'p', 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': {'parent': 'p'}, 'parent-reset-child': ['a', 'z'], 'pending-validation': True, 'invalid-child-notice': []}), ({'parent': None, 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': None, 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': None, 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': None, 'loading': True, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': False, 'request-parent': None, 'parent-reset-child': [], 'pending-validation': False, 'invalid-child-notice': []}), ({'parent': '', 'loading': False, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': False, 'invalid-child-notice': ['a']}), ({'parent': '', 'loading': False, 'selected': ['a', 'z'], 'allowed': ['a']}, {'compatible-child': ['a'], 'child-editor-enabled': True, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a', 'z'], 'pending-validation': False, 'invalid-child-notice': ['z']}), ({'parent': '', 'loading': True, 'selected': ['a'], 'allowed': []}, {'compatible-child': [], 'child-editor-enabled': False, 'request-parent': {'parent': ''}, 'parent-reset-child': ['a'], 'pending-validation': True, 'invalid-child-notice': []})]}
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:
Removed-child notices wait for the parent option load to settle is violated by the widget projection.

A child facet is meaningful only inside its selected parent scope. Parent changes invalidate incompatible child selections but retain compatible identities. This example checks: Removed-child notices wait for the parent option load to settle.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'breadcrumb':('/'.join(d['path'][-1:])), 'ancestor':(len(d['candidate'])<len(d['path']) and d['path'][:len(d['candidate'])]==d['candidate']), 'sibling':(len(d['path'])==len(d['candidate']) and d['path'][:-1]==d['candidate'][:-1] and d['path']!=d['candidate']), 'leaf-label':(d['path'][-1] if d['path'] else '(root)'), 'up-navigation':(d['path'][:-1]), 'same-leaf':(d['path']==d['candidate'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['ab']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': True, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False})], 2: [({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': []}, {'breadcrumb': 'ab', 'ancestor': True, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a', 'b']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False})], 3: [({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['b', 'a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a', 'b']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': ['ab']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False})], 4: [({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['ab']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': True, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False})], 5: [({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': ['b', 'a'], 'candidate': ['a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': []}, {'breadcrumb': 'ab', 'ancestor': True, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a', 'b']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    return {'breadcrumb':(' / '.join(sorted(d['path']))), 'ancestor':(len(d['candidate'])<len(d['path']) and d['path'][:len(d['candidate'])]==d['candidate']), 'sibling':(len(d['path'])==len(d['candidate']) and d['path'][:-1]==d['candidate'][:-1] and d['path']!=d['candidate']), 'leaf-label':(d['path'][-1] if d['path'] else '(root)'), 'up-navigation':(d['path'][:-1]), 'same-leaf':(d['path']==d['candidate'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['ab']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': True, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False})], 2: [({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': []}, {'breadcrumb': 'ab', 'ancestor': True, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a', 'b']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False})], 3: [({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['b', 'a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a', 'b']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': ['ab']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False})], 4: [({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['ab']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': True, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False})], 5: [({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': ['b', 'a'], 'candidate': ['a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': []}, {'breadcrumb': 'ab', 'ancestor': True, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a', 'b']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Facet breadcrumbs retain ancestor order is violated by the widget projection.

Hierarchical facet identities are path tuples. Breadcrumb display, sibling scoping and subtree indicators operate on path segments rather than string prefixes. This example checks: Facet breadcrumbs retain ancestor order.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'breadcrumb':(' / '.join(d['path'])), 'ancestor':('/'.join(d['path']).startswith('/'.join(d['candidate']))), 'sibling':(len(d['path'])==len(d['candidate']) and d['path'][:-1]==d['candidate'][:-1] and d['path']!=d['candidate']), 'leaf-label':(d['path'][-1] if d['path'] else '(root)'), 'up-navigation':(d['path'][:-1]), 'same-leaf':(d['path']==d['candidate'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'path': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['ab']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': True, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False})], 2: [({'path': ['a'], 'candidate': ['a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': []}, {'breadcrumb': 'ab', 'ancestor': True, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a', 'b']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False})], 3: [({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['b', 'a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a', 'b']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': ['ab']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False})], 4: [({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['ab']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': True, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False})], 5: [({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': []}, {'breadcrumb': 'ab', 'ancestor': True, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a', 'b']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(d):
    return {'breadcrumb':(' / '.join(d['path'])), 'ancestor':(d['path'][:len(d['candidate'])]==d['candidate']), 'sibling':(len(d['path'])==len(d['candidate']) and d['path'][:-1]==d['candidate'][:-1] and d['path']!=d['candidate']), 'leaf-label':(d['path'][-1] if d['path'] else '(root)'), 'up-navigation':(d['path'][:-1]), 'same-leaf':(d['path']==d['candidate'])}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'path': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['ab']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': True, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False})], 2: [({'path': ['a'], 'candidate': ['a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': []}, {'breadcrumb': 'ab', 'ancestor': True, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a', 'b']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False})], 3: [({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True}), ({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['b', 'a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': [], 'candidate': ['a', 'b']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': ['ab']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False})], 4: [({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a'], 'candidate': ['ab']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': True, 'leaf-label': 'a', 'up-navigation': [], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a']}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': []}, {'breadcrumb': 'b / a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False})], 5: [({'path': ['ab'], 'candidate': ['a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': True, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': []}, {'breadcrumb': 'a / b', 'ancestor': True, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['a', 'b'], 'candidate': ['a', 'b']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False}), ({'path': ['b', 'a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': True}), ({'path': ['ab'], 'candidate': []}, {'breadcrumb': 'ab', 'ancestor': True, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['a', 'b']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': True})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Strict ancestor markers exclude self and partial segment prefixes is violated by the widget projection.

Hierarchical facet identities are path tuples. Breadcrumb display, sibling scoping and subtree indicators operate on path segments rather than string prefixes. This example checks: Strict ancestor markers exclude self and partial segment prefixes.

split: open-access