FA-39351 / Tree accessibility / Open access
Hierarchical drag hover expansion timer: Hover expansion ignores descendant-drop or permission rejection · case 01
Hover expansion ignores descendant-drop or permission rejection produces the wrong hierarchical widget state in a regression fixture.
ROOT CAUSE
The drag-hover contract is violated at `d['target'] in d['branches'] and d['target'] not in d['closure'] and d['legal']` by replacing it with `d['target'] in d['branches'] and d['legal']`.
VERIFIED REPAIR
Restore `d['target'] in d['branches'] and d['target'] not in d['closure'] and d['legal']` at this fault site while retaining the other tree state decisions.
Unsuccessful approach: The partial repair `d['target'] in d['branches'] and d['target'] not in d['closure']` 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['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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', 'c', 'r'], ['a', 'c'], None, True] | [['a', 'r'], ['a'], None, False] | Failed |
| 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 / 9ed89898befcdc8486b8ad4ce173843ff0f41161ec1b7bcacd07458c591dd987
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']
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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', 'b', 'r'], ['a', 'b'], None, True] | [['a', 'r'], ['a'], None, False] | Failed |
| 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 / 8075a3265bc465287dec0a18c3278daee76338a9cf9d673796f1fc52dc0b0017
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.394477+00:00.
Case digest / f807f11af10f36549b5e689b787d0fc0bb8ae35d66e55bbc24fe30813645d3e2