FAILURE MAP
← Case archive

FA-39726 / Tree accessibility / Open access

Hierarchical branch command lock: New lock map resurrects released operation · case 01

New lock map resurrects released operation produces the wrong hierarchical widget state in a regression fixture.

Verified by executionVariant 1 · 10 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The branch-command-lock contract is violated at `newlocks=dict(locks)` by replacing it with `newlocks=dict(d['locks'])`.

THE FAILURE

The branch-command-lock contract is violated at `newlocks=dict(locks)` by replacing it with `newlocks=dict(d['locks'])`.

Unsuccessful approach: The partial repair `newlocks={}` 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 ['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(d['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 fixtureActualExpectedOutcome
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', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']][False, 'busy:r', {'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
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 / 2aa95a0ac862953cd0925d1c7b71140420d0858ebd859258b144dc65541dd1eb

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=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={}
    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 fixtureActualExpectedOutcome
nested lock[False, 'busy:b', {}, []][False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
locked delete[False, 'busy:b', {}, []][False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
inspection[True, None, {}, []][True, None, {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
release nearest[False, 'busy:r', {}, []][False, 'busy:r', {'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
stale completion[False, 'busy:b', {}, []][False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
self lock[False, 'busy:b', {}, []][False, 'busy:b', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
free sibling delete[True, None, {'v0': 'N1'}, ['v0']][True, None, {'b': 'B', 'q': 'Q', 'r': 'R', 'v0': 'N1'}, ['r', 'b', 'c', 'q', 's', 'v0']]Failed
protected free[False, 'readonly', {}, []][False, 'readonly', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
missing target[False, 'missing', {}, []][False, 'missing', {'b': 'B', 'q': 'Q', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed
release and move[True, None, {'q': 'N1'}, ['q', 's']][True, None, {'b': 'B', 'q': 'N1', 'r': 'R'}, ['r', 'b', 'c', 'q', 's']]Failed

SHA-256 / 7bedfda0e96ee835acc3787e9ef03f49f6718944e91be4d21f298fe321d3c55d

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 10 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Synthetic deterministic hierarchical-widget data contract; not an implementation of a browser accessibility tree. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:43:24.219740+00:00.

Case digest / e1bf498b97f490c0999fba778ce109ba8a881940ccd140e9ec46a2b7c221b838