FA-25221 / Filter interfaces / Open access
Navigating up removes exactly the final hierarchy segment · case 01
Navigating up removes exactly the final hierarchy segment is violated by the widget projection.
ROOT CAUSE
The up-navigation decision uses `d['path'][1:]` instead of the stipulated hierarchical-facet projection.
VERIFIED REPAIR
Implement the declared up-navigation projection: `d['path'][:-1]`.
Unsuccessful approach: The attempted correction `[]` 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: Navigating up removes exactly the final hierarchy segment.
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':(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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Failed |
| contract fixture 1 | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | 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': ['b']} | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Failed |
| contract fixture 5 | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Failed |
| contract fixture 6 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Failed |
| contract fixture 7 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Failed |
| 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 / e94bd02eaf08bcddc1db0527c6e7b0270c7fa8149d197d207489be7acbe6be79
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':([]), '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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Failed |
| contract fixture 1 | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | 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': []} | {'ancestor': True, 'breadcrumb': 'a / b', 'leaf-label': 'b', 'same-leaf': False, 'sibling': False, 'up-navigation': ['a']} | Failed |
| contract fixture 5 | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': True, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Failed |
| contract fixture 6 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Failed |
| contract fixture 7 | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': []} | {'ancestor': False, 'breadcrumb': 'b / a', 'leaf-label': 'a', 'same-leaf': False, 'sibling': False, 'up-navigation': ['b']} | Failed |
| 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 / cee8403d701532cdcaef14d69ae12d96ad0c40f5f72084732916045b83c9a1c7
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': ['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)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| contract fixture 0 | {'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 1 | {'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 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': 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 6 | {'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 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 / 417e8a675bf6a69cd41ad92a8a56eafa628940a4302548d515ecd1d9c707ece7
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.631259+00:00.
Case digest / d4f12d57813ddcaf05a6ae3a6acf7c476fb264a5e1c75c58938546ea09a7328f