FA-25226 / Filter interfaces / Open access
Equal leaf captions do not merge different hierarchy paths · case 01
Equal leaf captions do not merge different hierarchy paths is violated by the widget projection.
ROOT CAUSE
The same-leaf decision uses `bool(d['path'] and d['candidate']) and d['path'][-1]==d['candidate'][-1]` instead of the stipulated hierarchical-facet projection.
VERIFIED REPAIR
Implement the declared same-leaf projection: `d['path']==d['candidate']`.
Unsuccessful approach: The attempted correction `set(d['path'])==set(d['candidate'])` still violates the explicit contract fixtures.
Case contract
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.
Why this case matters
Filter-widget state and serialization must preserve user constraints while the view changes.
1 / The failure
Exit 1"""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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'ancestor': False, 'breadcrumb': '', 'leaf-label': '(root)', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': '', 'leaf-label': '(root)', 'same-leaf': True, 'sibling': False, 'up-navigation': []} | Failed |
| contract fixture 1 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Passed |
| contract fixture 2 | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | Passed |
| contract fixture 3 | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | Passed |
| contract fixture 4 | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Passed |
| contract fixture 5 | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Passed |
| contract fixture 6 | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Passed |
| contract fixture 7 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Passed |
| contract fixture 8 | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | Passed |
| contract fixture 9 | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | Passed |
SHA-256 / e3596135091ed53ff6b2ed5da77552c6281d06f7dcf571012ade3d67a2875640
2 / The unsuccessful fix
Exit 1"""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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'ancestor': False, 'breadcrumb': '', 'leaf-label': '(root)', 'same-leaf': True, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': '', 'leaf-label': '(root)', 'same-leaf': True, 'sibling': False, 'up-navigation': []} | Passed |
| contract fixture 1 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': True, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Failed |
| contract fixture 2 | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | Passed |
| contract fixture 3 | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | Passed |
| contract fixture 4 | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Passed |
| contract fixture 5 | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': True, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Failed |
| contract fixture 6 | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Passed |
| contract fixture 7 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Passed |
| contract fixture 8 | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | Passed |
| contract fixture 9 | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | Passed |
SHA-256 / 6ff9518f0fb4aa5196dbc7896bddb0e25d767601d1ec375bb6cf90cab1059b69
3 / The verified repair
Exit 0"""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': [], '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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'ancestor': False, 'breadcrumb': '', 'leaf-label': '(root)', 'same-leaf': True, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': '', 'leaf-label': '(root)', 'same-leaf': True, 'sibling': False, 'up-navigation': []} | Passed |
| contract fixture 1 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Passed |
| contract fixture 2 | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | Passed |
| contract fixture 3 | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | Passed |
| contract fixture 4 | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Passed |
| contract fixture 5 | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Passed |
| contract fixture 6 | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Passed |
| contract fixture 7 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Passed |
| contract fixture 8 | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': True, 'up-navigation': []} | Passed |
| contract fixture 9 | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'ab', 'leaf-label': 'ab', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | Passed |
SHA-256 / 655970a12f2b25959f7072bf5665ad73bddef2d254529d1bc63c4ec029266ce5
Verification & scope
Deterministic bounded UI-state model only; no browser, query engine, network, or production-standard conformance is claimed. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:41:04.714066+00:00.
Case digest / cf9c5b67156132396ac9664f0a62e05320c60bc2828ce9e37f07624ac3af63e1