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

N = 1
observations = []
def solve(d):
    return {'breadcrumb':(' / '.join(d['path'])), 'ancestor':(len(d['candidate'])<len(d['path']) and d['path'][:len(d['candidate'])]==d['candidate']), 'sibling':(d['path'][:-1]==d['candidate'][:-1]), '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': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], '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': ['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}), ({'path': ['ab'], 'candidate': ['b', 'a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False})], 2: [({'path': [], 'candidate': ['a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', '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': [], '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})], 3: [({'path': [], 'candidate': ['ab']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], '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': ['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': ['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}), ({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False})], 4: [({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], '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': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', '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}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False})], 5: [({'path': ['a'], 'candidate': ['a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', '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}), ({'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(d['path'])), 'ancestor':(len(d['candidate'])<len(d['path']) and d['path'][:len(d['candidate'])]==d['candidate']), 'sibling':(len(d['path'])==len(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': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], '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': ['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}), ({'path': ['ab'], 'candidate': ['b', 'a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', 'up-navigation': [], 'same-leaf': False})], 2: [({'path': [], 'candidate': ['a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': False}), ({'path': ['ab'], 'candidate': ['ab']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, 'leaf-label': 'ab', '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': [], '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})], 3: [({'path': [], 'candidate': ['ab']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], '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': ['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': ['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}), ({'path': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], 'same-leaf': False})], 4: [({'path': ['a'], 'candidate': []}, {'breadcrumb': 'a', 'ancestor': True, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], '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': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', '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}), ({'path': ['b', 'a'], 'candidate': ['ab']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], 'same-leaf': False})], 5: [({'path': ['a'], 'candidate': ['a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', '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}), ({'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:
Sibling scope requires equal parents and a different leaf 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: Sibling scope requires equal parents and a different leaf.

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':(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'][0] 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': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', '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}), ({'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': ['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': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], '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': [], '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': ['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)

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 {'breadcrumb':(' / '.join(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':('/'.join(d['path'])), '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': [], 'candidate': ['b', 'a']}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', '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}), ({'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': ['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': ['a', 'b'], 'candidate': ['ab']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], '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': [], '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': ['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 leaf labels show only the final segment and name the root 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 leaf labels show only the final segment and name the root.

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':(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': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], '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': ['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}), ({'path': ['ab'], 'candidate': ['b', 'a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, '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': ['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': ['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})], 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(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':([]), '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': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], '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': ['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}), ({'path': ['ab'], 'candidate': ['b', 'a']}, {'breadcrumb': 'ab', 'ancestor': False, 'sibling': False, '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': ['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': ['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})], 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:
Navigating up removes exactly the final hierarchy segment 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: Navigating up removes exactly the final hierarchy segment.

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':(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':(bool(d['path'] and d['candidate']) and d['path'][-1]==d['candidate'][-1])}
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': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], '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': ['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})], 2: [({'path': ['a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], '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': ['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})], 3: [({'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': ['a', 'b']}, {'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': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], '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': ['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})], 5: [({'path': ['a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], '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': ['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':(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':(set(d['path'])==set(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': ['a', 'b']}, {'breadcrumb': 'b / a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': ['b'], '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': ['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})], 2: [({'path': ['a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], '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': ['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})], 3: [({'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': ['a', 'b']}, {'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': [], 'candidate': []}, {'breadcrumb': '', 'ancestor': False, 'sibling': False, 'leaf-label': '(root)', 'up-navigation': [], 'same-leaf': True}), ({'path': ['a', 'b'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a / b', 'ancestor': False, 'sibling': False, 'leaf-label': 'b', 'up-navigation': ['a'], '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': ['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})], 5: [({'path': ['a'], 'candidate': ['b', 'a']}, {'breadcrumb': 'a', 'ancestor': False, 'sibling': False, 'leaf-label': 'a', 'up-navigation': [], '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': ['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:
Equal leaf captions do not merge different hierarchy paths 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: Equal leaf captions do not merge different hierarchy paths.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'lower-bracket':('[' if d['li'] else '('), 'upper-bracket':(')' if d['hi'] is None or not d['ui'] else ']'), 'point-empty':(d['lo'] is not None and d['lo']==d['hi'] and not (d['li'] and d['ui'])), 'lower-operator':(None if d['lo'] is None else ('gte' if d['li'] else 'gt')), 'upper-operator':(None if d['hi'] is None else ('lte' if d['ui'] else 'lt')), 'point-short-label':(d['lo'] if d['lo'] is not None and d['lo']==d['hi'] and d['li'] and d['ui'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': None, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 0}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None})], 2: [({'lo': None, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 2})], 3: [({'lo': None, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None})], 4: [({'lo': None, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None})], 5: [({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 2}), ({'lo': None, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None})]}
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 {'lower-bracket':('[' if d['lo'] is not None else '('), 'upper-bracket':(')' if d['hi'] is None or not d['ui'] else ']'), 'point-empty':(d['lo'] is not None and d['lo']==d['hi'] and not (d['li'] and d['ui'])), 'lower-operator':(None if d['lo'] is None else ('gte' if d['li'] else 'gt')), 'upper-operator':(None if d['hi'] is None else ('lte' if d['ui'] else 'lt')), 'point-short-label':(d['lo'] if d['lo'] is not None and d['lo']==d['hi'] and d['li'] and d['ui'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': None, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 0}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None})], 2: [({'lo': None, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 2})], 3: [({'lo': None, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None})], 4: [({'lo': None, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None})], 5: [({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 2}), ({'lo': None, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None})]}
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:
Open lower endpoints never display a closed bracket is violated by the widget projection.

A range editor stores separate lower and upper inclusivity, suppresses brackets for open endpoints, and identifies empty point intervals. This example checks: Open lower endpoints never display a closed bracket.

split: open-access