FA-39136 / Tree accessibility / Open access
Virtual tree active-descendant lease: Pinning exposes unacknowledged row or drops active row · case 01
Pinning exposes unacknowledged row or drops active row produces the wrong hierarchical widget state in a regression fixture.
ROOT CAUSE
The virtual-focus-lease contract is violated at `[logical] if ack else []` by replacing it with `[logical] if slot is not None else []`.
VERIFIED REPAIR
Restore `[logical] if ack else []` at this fault site while retaining the other tree state decisions.
Unsuccessful approach: The partial repair `[]` still violates a boundary or preservation case.
Case contract
A virtualized active row keeps its identity while offscreen. Expose an active descendant only after a matching mount generation acknowledges the row; scrolling requests mount without changing selection. A recycled slot must not satisfy an old lease. Collapse repairs the logical active row to the closest visible ancestor before mounting.
Why this case matters
Offline executable model of a hierarchical accessibility interaction; inputs are bounded and valid as stipulated. No browser, assistive technology, or normative ARIA conformance is claimed.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
visible=d['visible']
logical=d['active'] if d['active'] in visible else next((a for a in reversed(d['ancestors']) if a in visible),(visible[0] if visible else None))
slot=next((slot for slot,row in d['slots'].items() if row==logical),None)
ack=slot is not None and d['acks'].get(slot)==[logical,d['generation']]
aria=(d['tree']+':'+logical) if ack else None
request=logical if logical is not None and not ack else None
scroll=visible.index(logical) if logical in visible and slot is None else None
selection=d['selection']
lease=[logical,d['generation']] if request is not None else None
pinned=[logical] if slot is not None else []
return [logical,aria,request,scroll,selection,lease,pinned]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 0]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 1], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 1], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []])], 2: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 1]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 2], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 2], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []])], 3: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 2]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 3], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 3], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []])], 4: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 3]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 4], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 4], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []])], 5: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 4]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 5], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 5], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []])]}
for label, data, expected in cases[N]:
check(label, 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 |
|---|---|---|---|
| mounted lease | ['b', 'tree:b', None, None, ['a'], None, ['b']] | ['b', 'tree:b', None, None, ['a'], None, ['b']] | Passed |
| old ack | ['b', None, 'b', None, ['a'], ['b', 1], ['b']] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Failed |
| recycled ack | ['b', None, 'b', None, ['a'], ['b', 1], ['b']] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Failed |
| offscreen | ['b', None, 'b', 2, ['a'], ['b', 1], []] | ['b', None, 'b', 2, ['a'], ['b', 1], []] | Passed |
| collapse | ['a', 'tree:a', None, None, ['a'], None, ['a']] | ['a', 'tree:a', None, None, ['a'], None, ['a']] | Passed |
| collapse offscreen | ['a', None, 'a', 1, ['a'], ['a', 1], []] | ['a', None, 'a', 1, ['a'], ['a', 1], []] | Passed |
| empty tree | [None, None, None, None, ['a'], None, []] | [None, None, None, None, ['a'], None, []] | Passed |
| no ack | ['b', None, 'b', None, ['a'], ['b', 1], ['b']] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Failed |
SHA-256 / c087960ccef33041cb8c8844348d4a406105c76b92bcbc2888241a473a9eeb38
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
visible=d['visible']
logical=d['active'] if d['active'] in visible else next((a for a in reversed(d['ancestors']) if a in visible),(visible[0] if visible else None))
slot=next((slot for slot,row in d['slots'].items() if row==logical),None)
ack=slot is not None and d['acks'].get(slot)==[logical,d['generation']]
aria=(d['tree']+':'+logical) if ack else None
request=logical if logical is not None and not ack else None
scroll=visible.index(logical) if logical in visible and slot is None else None
selection=d['selection']
lease=[logical,d['generation']] if request is not None else None
pinned=[]
return [logical,aria,request,scroll,selection,lease,pinned]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 0]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 1], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 1], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []])], 2: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 1]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 2], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 2], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []])], 3: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 2]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 3], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 3], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []])], 4: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 3]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 4], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 4], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []])], 5: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 4]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 5], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 5], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []])]}
for label, data, expected in cases[N]:
check(label, 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 |
|---|---|---|---|
| mounted lease | ['b', 'tree:b', None, None, ['a'], None, []] | ['b', 'tree:b', None, None, ['a'], None, ['b']] | Failed |
| old ack | ['b', None, 'b', None, ['a'], ['b', 1], []] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Passed |
| recycled ack | ['b', None, 'b', None, ['a'], ['b', 1], []] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Passed |
| offscreen | ['b', None, 'b', 2, ['a'], ['b', 1], []] | ['b', None, 'b', 2, ['a'], ['b', 1], []] | Passed |
| collapse | ['a', 'tree:a', None, None, ['a'], None, []] | ['a', 'tree:a', None, None, ['a'], None, ['a']] | Failed |
| collapse offscreen | ['a', None, 'a', 1, ['a'], ['a', 1], []] | ['a', None, 'a', 1, ['a'], ['a', 1], []] | Passed |
| empty tree | [None, None, None, None, ['a'], None, []] | [None, None, None, None, ['a'], None, []] | Passed |
| no ack | ['b', None, 'b', None, ['a'], ['b', 1], []] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Passed |
SHA-256 / 3975ee6348cf14cec648d1e3d9aeddc23dc222a6b31cf451abaa97c11ce35249
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
visible=d['visible']
logical=d['active'] if d['active'] in visible else next((a for a in reversed(d['ancestors']) if a in visible),(visible[0] if visible else None))
slot=next((slot for slot,row in d['slots'].items() if row==logical),None)
ack=slot is not None and d['acks'].get(slot)==[logical,d['generation']]
aria=(d['tree']+':'+logical) if ack else None
request=logical if logical is not None and not ack else None
scroll=visible.index(logical) if logical in visible and slot is None else None
selection=d['selection']
lease=[logical,d['generation']] if request is not None else None
pinned=[logical] if ack else []
return [logical,aria,request,scroll,selection,lease,pinned]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 0]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 1], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 1], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 1], 'slot1': ['b', 1]}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 1, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 1], []])], 2: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 1]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 2], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 2], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 2], 'slot1': ['b', 2]}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 2, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 2], []])], 3: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 2]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 3], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 3], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 3], 'slot1': ['b', 3]}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 3, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 3], []])], 4: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 3]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 4], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 4], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 4], 'slot1': ['b', 4]}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 4, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 4], []])], 5: [('mounted lease', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', 'tree:b', None, None, ['a'], None, ['b']]), ('old ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['b', 4]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('recycled ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot1': ['gone', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []]), ('offscreen', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'r'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', 2, ['a'], ['b', 5], []]), ('collapse', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', 'tree:a', None, None, ['a'], None, ['a']]), ('collapse offscreen', {'visible': ['r', 'a'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['a', None, 'a', 1, ['a'], ['a', 5], []]), ('empty tree', {'visible': [], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {}, 'acks': {'slot0': ['a', 5], 'slot1': ['b', 5]}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, [None, None, None, None, ['a'], None, []]), ('no ack', {'visible': ['r', 'a', 'b', 'x0', 'x1', 'x2', 'x3', 'x4'], 'active': 'b', 'ancestors': ['r', 'a'], 'slots': {'slot0': 'a', 'slot1': 'b'}, 'acks': {}, 'generation': 5, 'tree': 'tree', 'selection': ['a']}, ['b', None, 'b', None, ['a'], ['b', 5], []])]}
for label, data, expected in cases[N]:
check(label, 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 |
|---|---|---|---|
| mounted lease | ['b', 'tree:b', None, None, ['a'], None, ['b']] | ['b', 'tree:b', None, None, ['a'], None, ['b']] | Passed |
| old ack | ['b', None, 'b', None, ['a'], ['b', 1], []] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Passed |
| recycled ack | ['b', None, 'b', None, ['a'], ['b', 1], []] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Passed |
| offscreen | ['b', None, 'b', 2, ['a'], ['b', 1], []] | ['b', None, 'b', 2, ['a'], ['b', 1], []] | Passed |
| collapse | ['a', 'tree:a', None, None, ['a'], None, ['a']] | ['a', 'tree:a', None, None, ['a'], None, ['a']] | Passed |
| collapse offscreen | ['a', None, 'a', 1, ['a'], ['a', 1], []] | ['a', None, 'a', 1, ['a'], ['a', 1], []] | Passed |
| empty tree | [None, None, None, None, ['a'], None, []] | [None, None, None, None, ['a'], None, []] | Passed |
| no ack | ['b', None, 'b', None, ['a'], ['b', 1], []] | ['b', None, 'b', None, ['a'], ['b', 1], []] | Passed |
SHA-256 / 3c7cd20b733546b54a016d1b01122f7cf354a1d29a4c6142582405ed7b37b39d
Verification & scope
Synthetic deterministic hierarchical-widget data contract; not an implementation of a browser accessibility tree. 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:43:18.206077+00:00.
Case digest / a1203c6b4d222afae6fb4dbbda6d848fb5a151c7e1980da497b07ccda99aa57a