FAILURE MAP
← Case archive

FA-38531 / Tree accessibility / Open access

Lazy tree branch request lifecycle: Consumed request token remains active · case 01

Consumed request token remains active produces the wrong hierarchical widget state in a regression fixture.

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

ROOT CAUSE

The lazy-request contract is violated at `token=None if accept else d['token']` by replacing it with `token=d['token']`.

VERIFIED REPAIR

Restore `token=None if accept else d['token']` at this fault site while retaining the other tree state decisions.

Unsuccessful approach: The partial repair `token=None` still violates a boundary or preservation case.

Case contract

A request is accepted only for a live open branch with matching epoch and token. Accepted pages replace a placeholder with deduplicated child IDs, clear busy/error state, and derive completeness from a next cursor. Rejected responses preserve all branch state.

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):
    match=d['reply_epoch']==d['epoch'] and d['reply_token']==d['token']
    accept=match and d['live'] and d['open']
    children=list(dict.fromkeys(d['reply'])) if accept else d['children']
    busy=False if accept else d['busy']
    error=None if accept else d['error']
    cursor=d['next'] if accept else d['cursor']
    complete=(d['next'] is None) if accept else d['complete']
    placeholder=False if accept else d['placeholder']
    token=d['token']
    focus=(children[0] if children else d['parent']) if accept and d['focus']=='placeholder' else d['focus']
    return [children,busy,error,cursor,complete,placeholder,token,focus]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('accepted', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 0, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0'], False, None, None, True, False, None, 'outside'])], 2: [('accepted', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 1, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1'], False, None, None, True, False, None, 'outside'])], 3: [('accepted', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 2, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2'], False, None, None, True, False, None, 'outside'])], 4: [('accepted', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 3, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, None, True, False, None, 'outside'])], 5: [('accepted', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 4, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, None, True, False, None, 'outside'])]}
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
accepted[['z', 'c0'], False, None, None, True, False, 't', 'z'][['z', 'c0'], False, None, None, True, False, None, 'z']Failed
old epoch[['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Passed
old token[['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Passed
collapsed[['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Passed
deleted[['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Passed
empty terminal[[], False, None, None, True, False, 't', 'p'][[], False, None, None, True, False, None, 'p']Failed
empty cursor[['z', 'c0'], False, None, '', False, False, 't', 'z'][['z', 'c0'], False, None, '', False, False, None, 'z']Failed
focus elsewhere[['z', 'c0'], False, None, None, True, False, 't', 'outside'][['z', 'c0'], False, None, None, True, False, None, 'outside']Failed

SHA-256 / 29d5912eb4667f62eb5dbfbe3bc038cab86fa575b854ba07142a767634f15b9a

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    match=d['reply_epoch']==d['epoch'] and d['reply_token']==d['token']
    accept=match and d['live'] and d['open']
    children=list(dict.fromkeys(d['reply'])) if accept else d['children']
    busy=False if accept else d['busy']
    error=None if accept else d['error']
    cursor=d['next'] if accept else d['cursor']
    complete=(d['next'] is None) if accept else d['complete']
    placeholder=False if accept else d['placeholder']
    token=None
    focus=(children[0] if children else d['parent']) if accept and d['focus']=='placeholder' else d['focus']
    return [children,busy,error,cursor,complete,placeholder,token,focus]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('accepted', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 0, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0'], False, None, None, True, False, None, 'outside'])], 2: [('accepted', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 1, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1'], False, None, None, True, False, None, 'outside'])], 3: [('accepted', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 2, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2'], False, None, None, True, False, None, 'outside'])], 4: [('accepted', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 3, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, None, True, False, None, 'outside'])], 5: [('accepted', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 4, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, None, True, False, None, 'outside'])]}
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
accepted[['z', 'c0'], False, None, None, True, False, None, 'z'][['z', 'c0'], False, None, None, True, False, None, 'z']Passed
old epoch[['old'], True, 'old-error', 'oldcursor', False, True, None, 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Failed
old token[['old'], True, 'old-error', 'oldcursor', False, True, None, 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Failed
collapsed[['old'], True, 'old-error', 'oldcursor', False, True, None, 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Failed
deleted[['old'], True, 'old-error', 'oldcursor', False, True, None, 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Failed
empty terminal[[], False, None, None, True, False, None, 'p'][[], False, None, None, True, False, None, 'p']Passed
empty cursor[['z', 'c0'], False, None, '', False, False, None, 'z'][['z', 'c0'], False, None, '', False, False, None, 'z']Passed
focus elsewhere[['z', 'c0'], False, None, None, True, False, None, 'outside'][['z', 'c0'], False, None, None, True, False, None, 'outside']Passed

SHA-256 / 8b61b961cef9a4449a0c5b57293e7f9d57cfbc3729a183e25ab8568f13abee3b

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    match=d['reply_epoch']==d['epoch'] and d['reply_token']==d['token']
    accept=match and d['live'] and d['open']
    children=list(dict.fromkeys(d['reply'])) if accept else d['children']
    busy=False if accept else d['busy']
    error=None if accept else d['error']
    cursor=d['next'] if accept else d['cursor']
    complete=(d['next'] is None) if accept else d['complete']
    placeholder=False if accept else d['placeholder']
    token=None if accept else d['token']
    focus=(children[0] if children else d['parent']) if accept and d['focus']=='placeholder' else d['focus']
    return [children,busy,error,cursor,complete,placeholder,token,focus]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = {1: [('accepted', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 0, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 1, 'epoch': 1, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0'], False, None, None, True, False, None, 'outside'])], 2: [('accepted', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 1, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 2, 'epoch': 2, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1'], False, None, None, True, False, None, 'outside'])], 3: [('accepted', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 2, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 3, 'epoch': 3, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2'], False, None, None, True, False, None, 'outside'])], 4: [('accepted', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 3, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 4, 'epoch': 4, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2', 'c3'], False, None, None, True, False, None, 'outside'])], 5: [('accepted', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, None, True, False, None, 'z']), ('old epoch', {'reply_epoch': 4, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('old token', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 'old', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('collapsed', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': False, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('deleted', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': False, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']), ('empty terminal', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': [], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [[], False, None, None, True, False, None, 'p']), ('empty cursor', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': '', 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'placeholder'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, '', False, False, None, 'z']), ('focus elsewhere', {'reply_epoch': 5, 'epoch': 5, 'reply_token': 't', 'token': 't', 'live': True, 'open': True, 'reply': ['z', 'c0', 'c1', 'c2', 'c3', 'c4', 'z'], 'children': ['old'], 'busy': True, 'error': 'old-error', 'next': None, 'cursor': 'oldcursor', 'complete': False, 'placeholder': True, 'parent': 'p', 'focus': 'outside'}, [['z', 'c0', 'c1', 'c2', 'c3', 'c4'], False, None, None, True, False, None, 'outside'])]}
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
accepted[['z', 'c0'], False, None, None, True, False, None, 'z'][['z', 'c0'], False, None, None, True, False, None, 'z']Passed
old epoch[['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Passed
old token[['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Passed
collapsed[['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Passed
deleted[['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'][['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder']Passed
empty terminal[[], False, None, None, True, False, None, 'p'][[], False, None, None, True, False, None, 'p']Passed
empty cursor[['z', 'c0'], False, None, '', False, False, None, 'z'][['z', 'c0'], False, None, '', False, False, None, 'z']Passed
focus elsewhere[['z', 'c0'], False, None, None, True, False, None, 'outside'][['z', 'c0'], False, None, None, True, False, None, 'outside']Passed

SHA-256 / 1ecc9bb995dd535ec2c2ef3c7eb8af52ab37ca34c06032e7d4038de6bdee2d08

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

Case digest / 83b1e7644dde2da88d48a6b602c96b0e50aaf6062f4b4a39a445ff8cd2784601