FA-38496 / Tree accessibility / Open access
Lazy tree branch request lifecycle: Closed or removed branch accepts a page · case 01
Closed or removed branch accepts a page produces the wrong hierarchical widget state in a regression fixture.
ROOT CAUSE
The lazy-request contract is violated at `match and d['live'] and d['open']` by replacing it with `match and d['live']`.
VERIFIED REPAIR
Restore `match and d['live'] and d['open']` at this fault site while retaining the other tree state decisions.
Unsuccessful approach: The partial repair `match and d['open']` 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']
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 | [['z', 'c0'], False, None, None, True, False, None, 'z'] | [['old'], True, 'old-error', 'oldcursor', False, True, 't', 'placeholder'] | Failed |
| 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 / 5e9e8ccc61f6a0e426d09652eac9d7292040398bd23f770ff533d33235afb1cc
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['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 | [['z', 'c0'], False, None, None, True, False, None, 'z'] | [['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 / ecc12390e623a8433af7e68c16d3df6a31ecccbf0d71dfaaa8412fb4f9c66d69
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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:11.838684+00:00.
Case digest / 0ac00c9796e3f7f24efbd4838cdad1df6729c26dabeaf9bdc7e06b4fc8974823