FAILURE MAP
← Case archive

FA-39376 / Tree accessibility / Open access

Hierarchical drag hover expansion timer: Drop or cancel clears the wrong auto-expansion state · case 01

Drop or cancel clears the wrong auto-expansion state produces the wrong hierarchical widget state in a regression fixture.

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

ROOT CAUSE

The drag-hover contract is violated at `if not d['active'] and d['cancelled']:` by replacing it with `if not d['active']:`.

VERIFIED REPAIR

Restore `if not d['active'] and d['cancelled']:` at this fault site while retaining the other tree state decisions.

Unsuccessful approach: The partial repair `if d['cancelled'] and d['active']:` still violates a boundary or preservation case.

Case contract

Hover expansion processing occurs only after dwell on a legal branch. Already user-open branches must not acquire hover ownership. Leaving or changing target resets the timer. A drag generation prevents old timers expanding a later drag. Auto-opened branches close on cancelled drag but user-open branches remain.

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):
    same=d['target']==d['previous_target'] and d['drag']==d['timer_drag']
    since=d['since'] if same else d['now']
    eligible=d['target'] in d['branches'] and d['target'] not in d['closure'] and d['legal']
    elapsed=max(0,d['now']-since)
    trigger=eligible and elapsed>=d['dwell'] and d['active']
    auto=set(d['auto'])
    if trigger and d['target'] not in d['user_open']: auto.add(d['target'])
    if not d['active']: auto.clear()
    expanded=sorted(set(d['user_open'])|auto)
    timer=[d['target'],since,d['drag']] if eligible and d['active'] and not trigger else None
    return [expanded,sorted(auto),timer,trigger]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 10, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 1], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 11, 1], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 0, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 11, 1], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 9, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 1], False])], 2: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 11, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 2], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 12, 2], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 1, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 12, 2], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 9, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 2], False])], 3: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 12, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 3], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 13, 3], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 2, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 13, 3], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 9, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 3], False])], 4: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 13, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 4], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 14, 4], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 3, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 14, 4], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 9, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 4], False])], 5: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 14, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 5], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 15, 5], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 4, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 15, 5], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 9, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 5], False])]}
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
at deadline[['a', 'b', 'r'], ['a', 'b'], None, True][['a', 'b', 'r'], ['a', 'b'], None, True]Passed
before deadline[['a', 'r'], ['a'], ['b', 10, 1], False][['a', 'r'], ['a'], ['b', 10, 1], False]Passed
changed target[['a', 'r'], ['a'], ['b', 11, 1], False][['a', 'r'], ['a'], ['b', 11, 1], False]Passed
new drag[['a', 'r'], ['a'], ['b', 11, 1], False][['a', 'r'], ['a'], ['b', 11, 1], False]Passed
illegal descendant[['a', 'r'], ['a'], None, False][['a', 'r'], ['a'], None, False]Passed
permission denied[['a', 'r'], ['a'], None, False][['a', 'r'], ['a'], None, False]Passed
cancelled[['r'], [], None, False][['r'], [], None, False]Passed
committed drop[['r'], [], None, False][['a', 'r'], ['a'], None, False]Failed
user opened[['a', 'b', 'r'], ['a'], None, True][['a', 'b', 'r'], ['a'], None, True]Passed
negative elapsed[['a', 'r'], ['a'], ['b', 10, 1], False][['a', 'r'], ['a'], ['b', 10, 1], False]Passed

SHA-256 / 8f23ad500e8db365eaa909a8eeb95c2c9f99727679f7d6257ef9d524be79b23a

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    same=d['target']==d['previous_target'] and d['drag']==d['timer_drag']
    since=d['since'] if same else d['now']
    eligible=d['target'] in d['branches'] and d['target'] not in d['closure'] and d['legal']
    elapsed=max(0,d['now']-since)
    trigger=eligible and elapsed>=d['dwell'] and d['active']
    auto=set(d['auto'])
    if trigger and d['target'] not in d['user_open']: auto.add(d['target'])
    if d['cancelled'] and d['active']: auto.clear()
    expanded=sorted(set(d['user_open'])|auto)
    timer=[d['target'],since,d['drag']] if eligible and d['active'] and not trigger else None
    return [expanded,sorted(auto),timer,trigger]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 10, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 1], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 11, 1], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 0, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 11, 1], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 9, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 1], False])], 2: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 11, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 2], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 12, 2], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 1, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 12, 2], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 9, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 2], False])], 3: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 12, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 3], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 13, 3], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 2, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 13, 3], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 9, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 3], False])], 4: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 13, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 4], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 14, 4], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 3, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 14, 4], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 9, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 4], False])], 5: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 14, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 5], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 15, 5], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 4, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 15, 5], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 9, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 5], False])]}
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
at deadline[['a', 'b', 'r'], ['a', 'b'], None, True][['a', 'b', 'r'], ['a', 'b'], None, True]Passed
before deadline[['a', 'r'], ['a'], ['b', 10, 1], False][['a', 'r'], ['a'], ['b', 10, 1], False]Passed
changed target[['a', 'r'], ['a'], ['b', 11, 1], False][['a', 'r'], ['a'], ['b', 11, 1], False]Passed
new drag[['a', 'r'], ['a'], ['b', 11, 1], False][['a', 'r'], ['a'], ['b', 11, 1], False]Passed
illegal descendant[['a', 'r'], ['a'], None, False][['a', 'r'], ['a'], None, False]Passed
permission denied[['a', 'r'], ['a'], None, False][['a', 'r'], ['a'], None, False]Passed
cancelled[['a', 'r'], ['a'], None, False][['r'], [], None, False]Failed
committed drop[['a', 'r'], ['a'], None, False][['a', 'r'], ['a'], None, False]Passed
user opened[['a', 'b', 'r'], ['a'], None, True][['a', 'b', 'r'], ['a'], None, True]Passed
negative elapsed[['a', 'r'], ['a'], ['b', 10, 1], False][['a', 'r'], ['a'], ['b', 10, 1], False]Passed

SHA-256 / 28958e4b28b249cbee272781c9a5cb7255b57848273ac2cac200924ae49dc773

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(d):
    same=d['target']==d['previous_target'] and d['drag']==d['timer_drag']
    since=d['since'] if same else d['now']
    eligible=d['target'] in d['branches'] and d['target'] not in d['closure'] and d['legal']
    elapsed=max(0,d['now']-since)
    trigger=eligible and elapsed>=d['dwell'] and d['active']
    auto=set(d['auto'])
    if trigger and d['target'] not in d['user_open']: auto.add(d['target'])
    if not d['active'] and d['cancelled']: auto.clear()
    expanded=sorted(set(d['user_open'])|auto)
    timer=[d['target'],since,d['drag']] if eligible and d['active'] and not trigger else None
    return [expanded,sorted(auto),timer,trigger]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 10, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 1], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 11, 1], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 0, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 11, 1], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 11, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 1, 'timer_drag': 1, 'since': 10, 'now': 9, 'dwell': 1, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 1], False])], 2: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 11, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 2], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 12, 2], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 1, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 12, 2], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 12, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 2, 'timer_drag': 2, 'since': 10, 'now': 9, 'dwell': 2, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 2], False])], 3: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 12, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 3], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 13, 3], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 2, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 13, 3], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 13, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 3, 'timer_drag': 3, 'since': 10, 'now': 9, 'dwell': 3, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 3], False])], 4: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 13, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 4], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 14, 4], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 3, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 14, 4], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 14, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 4, 'timer_drag': 4, 'since': 10, 'now': 9, 'dwell': 4, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 4], False])], 5: [('at deadline', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'b', 'r'], ['a', 'b'], None, True]), ('before deadline', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 14, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 5], False]), ('changed target', {'target': 'b', 'previous_target': 'a', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 15, 5], False]), ('new drag', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 4, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 15, 5], False]), ('illegal descendant', {'target': 'c', 'previous_target': 'c', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b', 'c'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('permission denied', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': False, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('cancelled', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': True}, [['r'], [], None, False]), ('committed drop', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': False, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], None, False]), ('user opened', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 15, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r', 'b'], 'cancelled': False}, [['a', 'b', 'r'], ['a'], None, True]), ('negative elapsed', {'target': 'b', 'previous_target': 'b', 'drag': 5, 'timer_drag': 5, 'since': 10, 'now': 9, 'dwell': 5, 'branches': ['a', 'b'], 'closure': ['s', 'c'], 'legal': True, 'active': True, 'auto': ['a'], 'user_open': ['r'], 'cancelled': False}, [['a', 'r'], ['a'], ['b', 10, 5], False])]}
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
at deadline[['a', 'b', 'r'], ['a', 'b'], None, True][['a', 'b', 'r'], ['a', 'b'], None, True]Passed
before deadline[['a', 'r'], ['a'], ['b', 10, 1], False][['a', 'r'], ['a'], ['b', 10, 1], False]Passed
changed target[['a', 'r'], ['a'], ['b', 11, 1], False][['a', 'r'], ['a'], ['b', 11, 1], False]Passed
new drag[['a', 'r'], ['a'], ['b', 11, 1], False][['a', 'r'], ['a'], ['b', 11, 1], False]Passed
illegal descendant[['a', 'r'], ['a'], None, False][['a', 'r'], ['a'], None, False]Passed
permission denied[['a', 'r'], ['a'], None, False][['a', 'r'], ['a'], None, False]Passed
cancelled[['r'], [], None, False][['r'], [], None, False]Passed
committed drop[['a', 'r'], ['a'], None, False][['a', 'r'], ['a'], None, False]Passed
user opened[['a', 'b', 'r'], ['a'], None, True][['a', 'b', 'r'], ['a'], None, True]Passed
negative elapsed[['a', 'r'], ['a'], ['b', 10, 1], False][['a', 'r'], ['a'], ['b', 10, 1], False]Passed

SHA-256 / 39d4502213c47e1b1c79370afae6db7bcaa0ed739d59a62cac9e4c98f9d7b812

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:20.598985+00:00.

Case digest / c1ae2e371e45c6b0374d2d90a6203230585787aedbb2bffc00826192f4c20469