FA-38696 / Tree accessibility / Open access
Tree drop accessibility descriptor: After placement is confused with nesting · case 01
After placement is confused with nesting produces the wrong hierarchical widget state in a regression fixture.
ROOT CAUSE
The drag-descriptor contract is violated at `d['placement']=='inside'` by replacing it with `d['placement']!='before'`.
VERIFIED REPAIR
Restore `d['placement']=='inside'` at this fault site while retaining the other tree state decisions.
Unsuccessful approach: The partial repair `d['placement']=='after'` still violates a boundary or preservation case.
Case contract
A drag advertises one legal drop location at a time. Inside requires a writable branch; before/after require a parent and same sibling partition. Self and descendant targets are forbidden. Copy needs copy permission. Descriptor includes announced hierarchy level and one-based insertion position.
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):
selfdrop=d['target'] in d['closure']
inside=d['placement']!='before'
parent=d['target'] if inside else d['parent']
structural=(d['branch'] if inside else parent is not None)
partition=inside or d['source_partition']==d['target_partition']
permission=d['writable'] and (d['copy_allowed'] if d['effect']=='copy' else d['move_allowed'])
allowed=not selfdrop and structural and partition and permission
position=d['child_count']+1 if inside else d['target_index']+1+(d['placement']=='after')
level=d['target_level']+1 if inside else d['target_level']
effect=d['effect'] if allowed else 'none'
return [allowed,parent,position,level,effect]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 't', 5, 3, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 3, 2, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 2, 2, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 'c', 5, 3, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 3, 2, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, None, 2, 2, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 'p', 3, 2, 'none'])], 2: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 't', 6, 4, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 4, 3, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 3, 3, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 'c', 6, 4, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 4, 3, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, None, 3, 3, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 'p', 4, 3, 'none'])], 3: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 't', 7, 5, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 5, 4, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 4, 4, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 'c', 7, 5, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 5, 4, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, None, 4, 4, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 'p', 5, 4, 'none'])], 4: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 't', 8, 6, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 6, 5, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 5, 5, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 'c', 8, 6, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 6, 5, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, None, 5, 5, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 'p', 6, 5, 'none'])], 5: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 't', 9, 7, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 7, 6, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 6, 6, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 'c', 9, 7, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 7, 6, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, None, 6, 6, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 'p', 7, 6, 'none'])]}
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 |
|---|---|---|---|
| copy inside | [True, 't', 5, 3, 'copy'] | [True, 't', 5, 3, 'copy'] | Passed |
| after sibling | [True, 't', 5, 3, 'copy'] | [True, 'p', 3, 2, 'copy'] | Failed |
| before sibling | [True, 'p', 2, 2, 'copy'] | [True, 'p', 2, 2, 'copy'] | Passed |
| descendant | [False, 'c', 5, 3, 'none'] | [False, 'c', 5, 3, 'none'] | Passed |
| leaf inside | [False, 't', 5, 3, 'none'] | [False, 't', 5, 3, 'none'] | Passed |
| leaf sibling | [False, 't', 5, 3, 'none'] | [True, 'p', 3, 2, 'copy'] | Failed |
| root sibling | [False, None, 2, 2, 'none'] | [False, None, 2, 2, 'none'] | Passed |
| forbidden copy | [False, 't', 5, 3, 'none'] | [False, 't', 5, 3, 'none'] | Passed |
| move denied | [False, 't', 5, 3, 'none'] | [False, 't', 5, 3, 'none'] | Passed |
| partition mismatch | [True, 't', 5, 3, 'copy'] | [False, 'p', 3, 2, 'none'] | Failed |
SHA-256 / f9f742606344eb2fa58e2063cff7b365a2757aea3e6ecf9d6e04e312a3624384
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
selfdrop=d['target'] in d['closure']
inside=d['placement']=='after'
parent=d['target'] if inside else d['parent']
structural=(d['branch'] if inside else parent is not None)
partition=inside or d['source_partition']==d['target_partition']
permission=d['writable'] and (d['copy_allowed'] if d['effect']=='copy' else d['move_allowed'])
allowed=not selfdrop and structural and partition and permission
position=d['child_count']+1 if inside else d['target_index']+1+(d['placement']=='after')
level=d['target_level']+1 if inside else d['target_level']
effect=d['effect'] if allowed else 'none'
return [allowed,parent,position,level,effect]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 't', 5, 3, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 3, 2, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 2, 2, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 'c', 5, 3, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 3, 2, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, None, 2, 2, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 'p', 3, 2, 'none'])], 2: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 't', 6, 4, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 4, 3, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 3, 3, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 'c', 6, 4, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 4, 3, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, None, 3, 3, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 'p', 4, 3, 'none'])], 3: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 't', 7, 5, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 5, 4, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 4, 4, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 'c', 7, 5, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 5, 4, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, None, 4, 4, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 'p', 5, 4, 'none'])], 4: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 't', 8, 6, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 6, 5, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 5, 5, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 'c', 8, 6, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 6, 5, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, None, 5, 5, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 'p', 6, 5, 'none'])], 5: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 't', 9, 7, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 7, 6, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 6, 6, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 'c', 9, 7, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 7, 6, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, None, 6, 6, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 'p', 7, 6, 'none'])]}
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 |
|---|---|---|---|
| copy inside | [False, 'p', 2, 2, 'none'] | [True, 't', 5, 3, 'copy'] | Failed |
| after sibling | [True, 't', 5, 3, 'copy'] | [True, 'p', 3, 2, 'copy'] | Failed |
| before sibling | [True, 'p', 2, 2, 'copy'] | [True, 'p', 2, 2, 'copy'] | Passed |
| descendant | [False, 'p', 2, 2, 'none'] | [False, 'c', 5, 3, 'none'] | Failed |
| leaf inside | [False, 'p', 2, 2, 'none'] | [False, 't', 5, 3, 'none'] | Failed |
| leaf sibling | [False, 't', 5, 3, 'none'] | [True, 'p', 3, 2, 'copy'] | Failed |
| root sibling | [False, None, 2, 2, 'none'] | [False, None, 2, 2, 'none'] | Passed |
| forbidden copy | [False, 'p', 2, 2, 'none'] | [False, 't', 5, 3, 'none'] | Failed |
| move denied | [False, 'p', 2, 2, 'none'] | [False, 't', 5, 3, 'none'] | Failed |
| partition mismatch | [True, 't', 5, 3, 'copy'] | [False, 'p', 3, 2, 'none'] | Failed |
SHA-256 / 6dbd814ad87042b98adfb5c964da294cad240b900ccd0a98717b33c145b7b623
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
selfdrop=d['target'] in d['closure']
inside=d['placement']=='inside'
parent=d['target'] if inside else d['parent']
structural=(d['branch'] if inside else parent is not None)
partition=inside or d['source_partition']==d['target_partition']
permission=d['writable'] and (d['copy_allowed'] if d['effect']=='copy' else d['move_allowed'])
allowed=not selfdrop and structural and partition and permission
position=d['child_count']+1 if inside else d['target_index']+1+(d['placement']=='after')
level=d['target_level']+1 if inside else d['target_level']
effect=d['effect'] if allowed else 'none'
return [allowed,parent,position,level,effect]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 't', 5, 3, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 3, 2, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 2, 2, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 'c', 5, 3, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [True, 'p', 3, 2, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, None, 2, 2, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 't', 5, 3, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 4, 'target_index': 1, 'target_level': 2}, [False, 'p', 3, 2, 'none'])], 2: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 't', 6, 4, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 4, 3, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 3, 3, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 'c', 6, 4, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [True, 'p', 4, 3, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, None, 3, 3, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 't', 6, 4, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 5, 'target_index': 2, 'target_level': 3}, [False, 'p', 4, 3, 'none'])], 3: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 't', 7, 5, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 5, 4, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 4, 4, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 'c', 7, 5, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [True, 'p', 5, 4, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, None, 4, 4, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 't', 7, 5, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 6, 'target_index': 3, 'target_level': 4}, [False, 'p', 5, 4, 'none'])], 4: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 't', 8, 6, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 6, 5, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 5, 5, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 'c', 8, 6, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [True, 'p', 6, 5, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, None, 5, 5, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 't', 8, 6, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 7, 'target_index': 4, 'target_level': 5}, [False, 'p', 6, 5, 'none'])], 5: [('copy inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 't', 9, 7, 'copy']), ('after sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 7, 6, 'copy']), ('before sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 6, 6, 'copy']), ('descendant', {'target': 'c', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 'c', 9, 7, 'none']), ('leaf inside', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('leaf sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': False, 'source_partition': 'A', 'target_partition': 'A', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [True, 'p', 7, 6, 'copy']), ('root sibling', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'before', 'parent': None, 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, None, 6, 6, 'none']), ('forbidden copy', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': False, 'move_allowed': True, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('move denied', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'inside', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'move', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 't', 9, 7, 'none']), ('partition mismatch', {'target': 't', 'source': 's', 'closure': ['s', 'c'], 'placement': 'after', 'parent': 'p', 'branch': True, 'source_partition': 'A', 'target_partition': 'B', 'writable': True, 'copy_allowed': True, 'move_allowed': False, 'effect': 'copy', 'child_count': 8, 'target_index': 5, 'target_level': 6}, [False, 'p', 7, 6, 'none'])]}
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 |
|---|---|---|---|
| copy inside | [True, 't', 5, 3, 'copy'] | [True, 't', 5, 3, 'copy'] | Passed |
| after sibling | [True, 'p', 3, 2, 'copy'] | [True, 'p', 3, 2, 'copy'] | Passed |
| before sibling | [True, 'p', 2, 2, 'copy'] | [True, 'p', 2, 2, 'copy'] | Passed |
| descendant | [False, 'c', 5, 3, 'none'] | [False, 'c', 5, 3, 'none'] | Passed |
| leaf inside | [False, 't', 5, 3, 'none'] | [False, 't', 5, 3, 'none'] | Passed |
| leaf sibling | [True, 'p', 3, 2, 'copy'] | [True, 'p', 3, 2, 'copy'] | Passed |
| root sibling | [False, None, 2, 2, 'none'] | [False, None, 2, 2, 'none'] | Passed |
| forbidden copy | [False, 't', 5, 3, 'none'] | [False, 't', 5, 3, 'none'] | Passed |
| move denied | [False, 't', 5, 3, 'none'] | [False, 't', 5, 3, 'none'] | Passed |
| partition mismatch | [False, 'p', 3, 2, 'none'] | [False, 'p', 3, 2, 'none'] | Passed |
SHA-256 / b07a02a62b71a2ac266ff21b9609ded74e36bf98711829ce4be61f1150192353
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:13.796284+00:00.
Case digest / 2b6a8093e463e3654d8a154d574a38e18844c1b5b5694768dbc911aab5de5551