FA-39711 / Tree accessibility / Open access
Hierarchical branch command lock: Read-only inspection and state-changing commands share wrong lock policy · case 01
Read-only inspection and state-changing commands share wrong lock policy produces the wrong hierarchical widget state in a regression fixture.
ROOT CAUSE
The branch-command-lock contract is violated at `d['command'] in ['rename','delete','move','check']` by replacing it with `d['command'] in ['delete','move']`.
VERIFIED REPAIR
Restore `d['command'] in ['rename','delete','move','check']` at this fault site while retaining the other tree state decisions.
Unsuccessful approach: The partial repair `True` still violates a boundary or preservation case.
Case contract
A pending subtree mutation locks that branch and descendants, but does not lock siblings. Read-only inspection remains available. New commands use nearest locking ancestor for reason attribution; completed operation tokens release only their owned locks and never a replacement lock.
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):
locks=dict(d['locks'])
if d['complete_node'] in locks and locks[d['complete_node']]==d['complete_token']: del locks[d['complete_node']]
chain=d['ancestors'].get(d['target'],[])+[d['target']]
owner=next((x for x in reversed(chain) if x in locks),None)
mutating=d['command'] in ['delete','move']
allowed=d['target'] in d['rows'] and (not mutating or owner is None) and (not mutating or d['target'] not in d['readonly'])
reason=('missing' if d['target'] not in d['rows'] else ('busy:'+owner if owner is not None and mutating else ('readonly' if mutating and d['target'] in d['readonly'] else None)))
newlocks=dict(locks)
if allowed and d['command'] in ['delete','move']: newlocks[d['target']]=d['new_token']
busy=[x for x in d['rows'] if x in newlocks or any(a in newlocks for a in d['ancestors'].get(x,[]))]
return [allowed,reason,newlocks,busy]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': ['v0'], 'new_token': 'N1'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N1'}, ['r', 'b', 'c', 'q', 's']])], 2: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N2'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': ['v0'], 'new_token': 'N2'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N2'}, ['r', 'b', 'c', 'q', 's']])], 3: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N3'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': ['v0'], 'new_token': 'N3'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N3'}, ['r', 'b', 'c', 'q', 's']])], 4: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N4'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': ['v0'], 'new_token': 'N4'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N4'}, ['r', 'b', 'c', 'q', 's']])], 5: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N5'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': ['v0'], 'new_token': 'N5'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N5'}, ['r', 'b', 'c', 'q', 's']])]}
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 |
|---|---|---|---|
| nested lock | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Failed |
| locked delete | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| inspection | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| release nearest | [True, None, {'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:r', {'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Failed |
| stale completion | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Failed |
| self lock | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Failed |
| free sibling delete | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']] | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']] | Passed |
| protected free | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'readonly', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Failed |
| missing target | [False, 'missing', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'missing', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| release and move | [True, None, {'b': 'B', 'q': 'N1', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [True, None, {'b': 'B', 'q': 'N1', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
SHA-256 / 9ffb33603326229de6d12f0a5d7a5798d0e076bf90e3041193a39b074038d205
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
locks=dict(d['locks'])
if d['complete_node'] in locks and locks[d['complete_node']]==d['complete_token']: del locks[d['complete_node']]
chain=d['ancestors'].get(d['target'],[])+[d['target']]
owner=next((x for x in reversed(chain) if x in locks),None)
mutating=True
allowed=d['target'] in d['rows'] and (not mutating or owner is None) and (not mutating or d['target'] not in d['readonly'])
reason=('missing' if d['target'] not in d['rows'] else ('busy:'+owner if owner is not None and mutating else ('readonly' if mutating and d['target'] in d['readonly'] else None)))
newlocks=dict(locks)
if allowed and d['command'] in ['delete','move']: newlocks[d['target']]=d['new_token']
busy=[x for x in d['rows'] if x in newlocks or any(a in newlocks for a in d['ancestors'].get(x,[]))]
return [allowed,reason,newlocks,busy]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': ['v0'], 'new_token': 'N1'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N1'}, ['r', 'b', 'c', 'q', 's']])], 2: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N2'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': ['v0'], 'new_token': 'N2'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N2'}, ['r', 'b', 'c', 'q', 's']])], 3: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N3'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': ['v0'], 'new_token': 'N3'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N3'}, ['r', 'b', 'c', 'q', 's']])], 4: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N4'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': ['v0'], 'new_token': 'N4'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N4'}, ['r', 'b', 'c', 'q', 's']])], 5: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N5'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': ['v0'], 'new_token': 'N5'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N5'}, ['r', 'b', 'c', 'q', 's']])]}
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 |
|---|---|---|---|
| nested lock | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| locked delete | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| inspection | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Failed |
| release nearest | [False, 'busy:r', {'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:r', {'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| stale completion | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| self lock | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| free sibling delete | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']] | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']] | Passed |
| protected free | [False, 'readonly', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'readonly', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| missing target | [False, 'missing', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'missing', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| release and move | [True, None, {'b': 'B', 'q': 'N1', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [True, None, {'b': 'B', 'q': 'N1', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
SHA-256 / c5b7283fed452b6fcfa2b67aafa62e2dabb3242bc61c4fea50596c4277f19274
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(d):
locks=dict(d['locks'])
if d['complete_node'] in locks and locks[d['complete_node']]==d['complete_token']: del locks[d['complete_node']]
chain=d['ancestors'].get(d['target'],[])+[d['target']]
owner=next((x for x in reversed(chain) if x in locks),None)
mutating=d['command'] in ['rename','delete','move','check']
allowed=d['target'] in d['rows'] and (not mutating or owner is None) and (not mutating or d['target'] not in d['readonly'])
reason=('missing' if d['target'] not in d['rows'] else ('busy:'+owner if owner is not None and mutating else ('readonly' if mutating and d['target'] in d['readonly'] else None)))
newlocks=dict(locks)
if allowed and d['command'] in ['delete','move']: newlocks[d['target']]=d['new_token']
busy=[x for x in d['rows'] if x in newlocks or any(a in newlocks for a in d['ancestors'].get(x,[]))]
return [allowed,reason,newlocks,busy]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': ['v0'], 'new_token': 'N1'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0'], 'readonly': [], 'new_token': 'N1'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N1'}, ['r', 'b', 'c', 'q', 's']])], 2: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N2'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': ['v0'], 'new_token': 'N2'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1'], 'readonly': [], 'new_token': 'N2'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N2'}, ['r', 'b', 'c', 'q', 's']])], 3: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N3'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': ['v0'], 'new_token': 'N3'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2'], 'readonly': [], 'new_token': 'N3'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N3'}, ['r', 'b', 'c', 'q', 's']])], 4: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N4'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': ['v0'], 'new_token': 'N4'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3'], 'readonly': [], 'new_token': 'N4'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N4'}, ['r', 'b', 'c', 'q', 's']])], 5: [('nested lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('locked delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('inspection', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'inspect', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release nearest', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'B', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:r', {'r': 'R', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('stale completion', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'b', 'complete_token': 'old', 'target': 'c', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('self lock', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'b', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'busy:b', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('free sibling delete', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'delete', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'Q', 'v0': 'N5'}, ['r', 'b', 'c', 'q', 's', 'v0']]), ('protected free', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'v0', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': ['v0'], 'new_token': 'N5'}, [False, 'readonly', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('missing target', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': None, 'complete_token': None, 'target': 'missing', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'rename', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [False, 'missing', {'r': 'R', 'b': 'B', 'q': 'Q'}, ['r', 'b', 'c', 'q', 's']]), ('release and move', {'locks': {'r': 'R', 'b': 'B', 'q': 'Q'}, 'complete_node': 'q', 'complete_token': 'Q', 'target': 'q', 'ancestors': {'b': ['r'], 'c': ['r', 'b'], 's': ['q']}, 'command': 'move', 'rows': ['r', 'b', 'c', 'q', 's', 'v0', 'v1', 'v2', 'v3', 'v4'], 'readonly': [], 'new_token': 'N5'}, [True, None, {'r': 'R', 'b': 'B', 'q': 'N5'}, ['r', 'b', 'c', 'q', 's']])]}
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 |
|---|---|---|---|
| nested lock | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| locked delete | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| inspection | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| release nearest | [False, 'busy:r', {'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:r', {'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| stale completion | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| self lock | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| free sibling delete | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']] | [True, None, {'b': 'B', 'q': 'Q', 'r': 'R', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']] | Passed |
| protected free | [False, 'readonly', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'readonly', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| missing target | [False, 'missing', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [False, 'missing', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
| release and move | [True, None, {'b': 'B', 'q': 'N1', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | [True, None, {'b': 'B', 'q': 'N1', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']] | Passed |
SHA-256 / aba3f4bd3325fad5d56b714100f8548dd89c32ade9cc493d17146aceee45ca72
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:23.939365+00:00.
Case digest / 73f4087707c5f49e2b0eb528771ee1369fd07dd41d3f88209c88042f6080b591