FA-39086 / Tree accessibility / Open access
Hierarchical clipboard root normalization: Clipboard operation focuses the wrong normalized root · case 01
Clipboard operation focuses the wrong normalized root produces the wrong hierarchical widget state in a regression fixture.
ROOT CAUSE
The subtree-clipboard contract is violated at `allowed[0] if allowed else d['focus']` by replacing it with `allowed[-1] if allowed else d['focus']`.
THE FAILURE
The subtree-clipboard contract is violated at `allowed[0] if allowed else d['focus']` by replacing it with `allowed[-1] if allowed else d['focus']`.
Unsuccessful approach: The partial repair `d['focus']` still violates a boundary or preservation case.
Case contract
Copy or cut operates on selected topmost roots only, excluding descendants of a selected root. Roots follow tree order. Cut excludes read-only roots, retains protected selection, and advertises a move only within the same tree generation. Clipboard payload carries selected root paths and descendants once.
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):
selected=set(d['selected'])&set(d['rows'])
roots=[x for x in d['rows'] if x in selected and not any(a in selected for a in d['ancestors'].get(x,[]))]
allowed=[x for x in roots if d['mode']=='copy' or x not in d['readonly']]
closure=[x for x in d['rows'] if x in allowed or any(a in allowed for a in d['ancestors'].get(x,[]))]
paths={x:d['ancestors'].get(x,[])+[x] for x in allowed}
cut=allowed if d['mode']=='cut' else []
valid=d['clipboard_generation']==d['generation']
effect='move' if cut and valid and d['same_tree'] else ('copy' if allowed else 'none')
remaining=[x for x in d['selected'] if x not in closure] if effect=='move' else d['selected']
focus=allowed[-1] if allowed else d['focus']
return [allowed,closure,paths,cut,effect,remaining,focus]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 0, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])], 2: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])], 3: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])], 4: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])], 5: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])]}
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 |
|---|---|---|---|
| cut normalized | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a'] | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a'] | Passed |
| copy protected | [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'q'] | [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a'] | Failed |
| several roots | [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'q'] | [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a'] | Failed |
| stale cut | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a'] | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a'] | Passed |
| cross tree | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a'] | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a'] | Passed |
| no selection | [[], [], {}, [], 'none', [], 'c'] | [[], [], {}, [], 'none', [], 'c'] | Passed |
| descendant alone | [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'] | [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'] | Passed |
SHA-256 / cd9956cb2b0d5f7ba1a7bfb39c81543ef6dd17a0df64fcb007f9e318f70c1bc0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
selected=set(d['selected'])&set(d['rows'])
roots=[x for x in d['rows'] if x in selected and not any(a in selected for a in d['ancestors'].get(x,[]))]
allowed=[x for x in roots if d['mode']=='copy' or x not in d['readonly']]
closure=[x for x in d['rows'] if x in allowed or any(a in allowed for a in d['ancestors'].get(x,[]))]
paths={x:d['ancestors'].get(x,[])+[x] for x in allowed}
cut=allowed if d['mode']=='cut' else []
valid=d['clipboard_generation']==d['generation']
effect='move' if cut and valid and d['same_tree'] else ('copy' if allowed else 'none')
remaining=[x for x in d['selected'] if x not in closure] if effect=='move' else d['selected']
focus=d['focus']
return [allowed,closure,paths,cut,effect,remaining,focus]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 0, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 1, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])], 2: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 1, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 2, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])], 3: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 2, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 3, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])], 4: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 3, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 4, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])], 5: [('cut normalized', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a']), ('copy protected', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'copy', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a']), ('several roots', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': [], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a']), ('stale cut', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 4, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('cross tree', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['a', 'b', 'q'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': False, 'focus': 'c'}, [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a']), ('no selection', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': [], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [[], [], {}, [], 'none', [], 'c']), ('descendant alone', {'rows': ['z', 'a', 'b', 'c', 'q', 'v0', 'v1', 'v2', 'v3', 'v4'], 'selected': ['b'], 'ancestors': {'a': ['z'], 'b': ['z', 'a'], 'c': ['z', 'a', 'b']}, 'mode': 'cut', 'readonly': ['q'], 'clipboard_generation': 5, 'generation': 5, 'same_tree': True, 'focus': 'c'}, [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'])]}
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 |
|---|---|---|---|
| cut normalized | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'c'] | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'move', ['q'], 'a'] | Failed |
| copy protected | [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'c'] | [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, [], 'copy', ['a', 'b', 'q'], 'a'] | Failed |
| several roots | [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'c'] | [['a', 'q'], ['a', 'b', 'c', 'q'], {'a': ['z', 'a'], 'q': ['q']}, ['a', 'q'], 'move', [], 'a'] | Failed |
| stale cut | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'c'] | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a'] | Failed |
| cross tree | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'c'] | [['a'], ['a', 'b', 'c'], {'a': ['z', 'a']}, ['a'], 'copy', ['a', 'b', 'q'], 'a'] | Failed |
| no selection | [[], [], {}, [], 'none', [], 'c'] | [[], [], {}, [], 'none', [], 'c'] | Passed |
| descendant alone | [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'c'] | [['b'], ['b', 'c'], {'b': ['z', 'a', 'b']}, ['b'], 'move', [], 'b'] | Failed |
SHA-256 / 019c6bc2c2ac81f88bde54bee7c84157902dab1d6a98441d4e76cff157406764
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:17.745586+00:00.
Case digest / cfa8a62437994d311558d4fbf0066dccb064de2b72864c06ac0e5d41e3805bcd