FA-34096 / Notification interfaces / Open access
Grouped notification interaction: collapse from expanded · case 01
The collapse event leaves a notification in empty instead of collapsed.
ROOT CAUSE
Collapsing a group removes its summary.
VERIFIED REPAIR
Commit the expanded / collapse transition to collapsed; preserve the other explicitly stipulated transitions.
Unsuccessful approach: Refetching on collapse replaces stable content with a spinner.
Case contract
Grouped notification interaction is a bounded visual-notification workflow with mutable policy state {'children': ['a', 'b'], 'request': 3, 'wanted_open': False}. Its default transition relation is {('collapsed', 'expand'): 'expanded', ('expanded', 'collapse'): 'collapsed', ('collapsed', 'uncached-expand'): 'loading', ('loading', 'children-arrive'): 'expanded', ('loading', 'children-fail'): 'load-error', ('load-error', 'retry-expand'): 'loading', ('loading', 'collapse-during-load'): 'collapse-pending', ('collapse-pending', 'children-arrive'): 'collapsed', ('expanded', 'last-child-removed'): 'empty', ('empty', 'first-child-added'): 'collapsed'}; domain inputs can suppress or redirect transitions and update policy fields, as specified in solve. Different-generation events are inert. Batches apply in order. Optional observe returns the selected policy field alongside the phase.
Why this case matters
Visual notification lifecycle ordering can leave an inbox or toast showing the wrong actionable state even when transport succeeds.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
table = {('collapsed', 'expand'): 'expanded', ('expanded', 'collapse'): 'empty', ('collapsed', 'uncached-expand'): 'loading', ('loading', 'children-arrive'): 'expanded', ('loading', 'children-fail'): 'load-error', ('load-error', 'retry-expand'): 'loading', ('loading', 'collapse-during-load'): 'collapse-pending', ('collapse-pending', 'children-arrive'): 'collapsed', ('expanded', 'last-child-removed'): 'empty', ('empty', 'first-child-added'): 'collapsed'}
data = json.loads(json.dumps({'children': ['a', 'b'], 'request': 3, 'wanted_open': False})) if payload is None else {**json.loads(json.dumps({'children': ['a', 'b'], 'request': 3, 'wanted_open': False})), **json.loads(json.dumps(payload))}
state = initial
for delivery in events:
event, event_generation = delivery[:2]
arg = delivery[2] if len(delivery) > 2 else {}
if event_generation == generation:
previous = state
if event in ('children-arrive','children-fail') and arg.get('request',data['request']) != data['request']: event = 'unknown-event'
if event in ('expand','uncached-expand','retry-expand'): data['wanted_open'] = True
if event in ('collapse','collapse-during-load'): data['wanted_open'] = False
if event == 'children-arrive' and 'children' in arg: data['children'] = list(dict.fromkeys(arg['children']))
if event == 'last-child-removed': data['children'] = []
if event == 'first-child-added': data['children'] = [arg.get('child','new')]
state = table.get((state, event), state)
if state == 'expanded': data['wanted_open'] = True
if state in ('collapsed','empty'): data['wanted_open'] = False
return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('collapsed / expand', solve('collapsed', [('expand', N)], N), 'expanded')
check('expanded / collapse', solve('expanded', [('collapse', N)], N), 'collapsed')
check('collapsed / uncached-expand', solve('collapsed', [('uncached-expand', N)], N), 'loading')
check('loading / children-arrive', solve('loading', [('children-arrive', N)], N), 'expanded')
check('loading / children-fail', solve('loading', [('children-fail', N)], N), 'load-error')
check('load-error / retry-expand', solve('load-error', [('retry-expand', N)], N), 'loading')
check('loading / collapse-during-load', solve('loading', [('collapse-during-load', N)], N), 'collapse-pending')
check('collapse-pending / children-arrive', solve('collapse-pending', [('children-arrive', N)], N), 'collapsed')
check('expanded / last-child-removed', solve('expanded', [('last-child-removed', N)], N), 'empty')
check('empty / first-child-added', solve('empty', [('first-child-added', N)], N), 'collapsed')
check('older notification incarnation', solve('collapsed', [('expand', N - 1)], N), 'collapsed')
check('future notification incarnation', solve('collapsed', [('expand', N + 1)], N), 'collapsed')
check('unknown event is inert', solve('collapsed', [('unknown-event', N)], N), 'collapsed')
check('empty delivery batch', solve('collapsed', [], N), 'collapsed')
check('N stale deliveries before current delivery', solve('collapsed', [('expand', N - 1)] * N + [('expand', N)], N), 'expanded')
check('trace expand then collapse', solve('collapsed', [('expand', N), ('collapse', N)], N), 'collapsed')
check('trace expand then last-child-removed', solve('collapsed', [('expand', N), ('last-child-removed', N)], N), 'empty')
check('trace collapse then expand', solve('expanded', [('collapse', N), ('expand', N)], N), 'expanded')
check('trace collapse then uncached-expand', solve('expanded', [('collapse', N), ('uncached-expand', N)], N), 'loading')
check('trace uncached-expand then children-arrive', solve('collapsed', [('uncached-expand', N), ('children-arrive', N)], N), 'expanded')
check('trace uncached-expand then children-fail', solve('collapsed', [('uncached-expand', N), ('children-fail', N)], N), 'load-error')
check('trace uncached-expand then collapse-during-load', solve('collapsed', [('uncached-expand', N), ('collapse-during-load', N)], N), 'collapse-pending')
check('trace children-arrive then collapse', solve('loading', [('children-arrive', N), ('collapse', N)], N), 'collapsed')
check('trace children-arrive then last-child-removed', solve('loading', [('children-arrive', N), ('last-child-removed', N)], N), 'empty')
check('trace children-fail then retry-expand', solve('loading', [('children-fail', N), ('retry-expand', N)], N), 'loading')
check('trace retry-expand then children-arrive', solve('load-error', [('retry-expand', N), ('children-arrive', N)], N), 'expanded')
check('trace retry-expand then children-fail', solve('load-error', [('retry-expand', N), ('children-fail', N)], N), 'load-error')
check('trace retry-expand then collapse-during-load', solve('load-error', [('retry-expand', N), ('collapse-during-load', N)], N), 'collapse-pending')
check('trace collapse-during-load then children-arrive', solve('loading', [('collapse-during-load', N), ('children-arrive', N)], N), 'collapsed')
check('trace children-arrive then expand', solve('collapse-pending', [('children-arrive', N), ('expand', N)], N), 'expanded')
check('trace children-arrive then uncached-expand', solve('collapse-pending', [('children-arrive', N), ('uncached-expand', N)], N), 'loading')
check('trace last-child-removed then first-child-added', solve('expanded', [('last-child-removed', N), ('first-child-added', N)], N), 'collapsed')
check('trace first-child-added then expand', solve('empty', [('first-child-added', N), ('expand', N)], N), 'expanded')
check('trace first-child-added then uncached-expand', solve('empty', [('first-child-added', N), ('uncached-expand', N)], N), 'loading')
check('domain state regression 1: children', solve('loading', [('children-arrive', N, {'request': 2, 'children': ['old']})], N, {}, 'children'), {'phase': 'loading', 'value': ['a', 'b']})
check('domain state regression 2: children', solve('loading', [('children-arrive', N, {'children': ['x', 'x', 'y']})], N, {}, 'children'), {'phase': 'expanded', 'value': ['x', 'y']})
check('domain state regression 3: wanted_open', solve('collapse-pending', [('children-arrive', N, {'children': ['x']})], N, {}, 'wanted_open'), {'phase': 'collapsed', 'value': False})
check('domain state regression 4: children', solve('expanded', [('last-child-removed', N, {})], N, {}, 'children'), {'phase': 'empty', 'value': []})
check('domain state regression 5: children', solve('empty', [('first-child-added', N, {'child': 'z'})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['z']})
check('domain state regression 6: children', solve('expanded', [('collapse', N, {})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['a', 'b']})
check('domain state regression 7: children', solve('collapsed', [('uncached-expand', N, {}), ('collapse-during-load', N, {}), ('children-arrive', N, {'children': ['x', 'y']})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['x', 'y']})
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 |
|---|---|---|---|
| collapsed / expand | expanded | expanded | Passed |
| expanded / collapse | empty | collapsed | Failed |
| collapsed / uncached-expand | loading | loading | Passed |
| loading / children-arrive | expanded | expanded | Passed |
| loading / children-fail | load-error | load-error | Passed |
| load-error / retry-expand | loading | loading | Passed |
| loading / collapse-during-load | collapse-pending | collapse-pending | Passed |
| collapse-pending / children-arrive | collapsed | collapsed | Passed |
| expanded / last-child-removed | empty | empty | Passed |
| empty / first-child-added | collapsed | collapsed | Passed |
| older notification incarnation | collapsed | collapsed | Passed |
| future notification incarnation | collapsed | collapsed | Passed |
| unknown event is inert | collapsed | collapsed | Passed |
| empty delivery batch | collapsed | collapsed | Passed |
| N stale deliveries before current delivery | expanded | expanded | Passed |
| trace expand then collapse | empty | collapsed | Failed |
| trace expand then last-child-removed | empty | empty | Passed |
| trace collapse then expand | empty | expanded | Failed |
| trace collapse then uncached-expand | empty | loading | Failed |
| trace uncached-expand then children-arrive | expanded | expanded | Passed |
| trace uncached-expand then children-fail | load-error | load-error | Passed |
| trace uncached-expand then collapse-during-load | collapse-pending | collapse-pending | Passed |
| trace children-arrive then collapse | empty | collapsed | Failed |
| trace children-arrive then last-child-removed | empty | empty | Passed |
| trace children-fail then retry-expand | loading | loading | Passed |
| trace retry-expand then children-arrive | expanded | expanded | Passed |
| trace retry-expand then children-fail | load-error | load-error | Passed |
| trace retry-expand then collapse-during-load | collapse-pending | collapse-pending | Passed |
| trace collapse-during-load then children-arrive | collapsed | collapsed | Passed |
| trace children-arrive then expand | expanded | expanded | Passed |
| trace children-arrive then uncached-expand | loading | loading | Passed |
| trace last-child-removed then first-child-added | collapsed | collapsed | Passed |
| trace first-child-added then expand | expanded | expanded | Passed |
| trace first-child-added then uncached-expand | loading | loading | Passed |
| domain state regression 1: children | {'phase': 'loading', 'value': ['a', 'b']} | {'phase': 'loading', 'value': ['a', 'b']} | Passed |
| domain state regression 2: children | {'phase': 'expanded', 'value': ['x', 'y']} | {'phase': 'expanded', 'value': ['x', 'y']} | Passed |
| domain state regression 3: wanted_open | {'phase': 'collapsed', 'value': False} | {'phase': 'collapsed', 'value': False} | Passed |
| domain state regression 4: children | {'phase': 'empty', 'value': []} | {'phase': 'empty', 'value': []} | Passed |
| domain state regression 5: children | {'phase': 'collapsed', 'value': ['z']} | {'phase': 'collapsed', 'value': ['z']} | Passed |
| domain state regression 6: children | {'phase': 'empty', 'value': ['a', 'b']} | {'phase': 'collapsed', 'value': ['a', 'b']} | Failed |
| domain state regression 7: children | {'phase': 'collapsed', 'value': ['x', 'y']} | {'phase': 'collapsed', 'value': ['x', 'y']} | Passed |
SHA-256 / 57694f3b4834991143968ccfc7652768ebc1a0cfe832f26104b2191154b923cb
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
table = {('collapsed', 'expand'): 'expanded', ('expanded', 'collapse'): 'loading', ('collapsed', 'uncached-expand'): 'loading', ('loading', 'children-arrive'): 'expanded', ('loading', 'children-fail'): 'load-error', ('load-error', 'retry-expand'): 'loading', ('loading', 'collapse-during-load'): 'collapse-pending', ('collapse-pending', 'children-arrive'): 'collapsed', ('expanded', 'last-child-removed'): 'empty', ('empty', 'first-child-added'): 'collapsed'}
data = json.loads(json.dumps({'children': ['a', 'b'], 'request': 3, 'wanted_open': False})) if payload is None else {**json.loads(json.dumps({'children': ['a', 'b'], 'request': 3, 'wanted_open': False})), **json.loads(json.dumps(payload))}
state = initial
for delivery in events:
event, event_generation = delivery[:2]
arg = delivery[2] if len(delivery) > 2 else {}
if event_generation == generation:
previous = state
if event in ('children-arrive','children-fail') and arg.get('request',data['request']) != data['request']: event = 'unknown-event'
if event in ('expand','uncached-expand','retry-expand'): data['wanted_open'] = True
if event in ('collapse','collapse-during-load'): data['wanted_open'] = False
if event == 'children-arrive' and 'children' in arg: data['children'] = list(dict.fromkeys(arg['children']))
if event == 'last-child-removed': data['children'] = []
if event == 'first-child-added': data['children'] = [arg.get('child','new')]
state = table.get((state, event), state)
if state == 'expanded': data['wanted_open'] = True
if state in ('collapsed','empty'): data['wanted_open'] = False
return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('collapsed / expand', solve('collapsed', [('expand', N)], N), 'expanded')
check('expanded / collapse', solve('expanded', [('collapse', N)], N), 'collapsed')
check('collapsed / uncached-expand', solve('collapsed', [('uncached-expand', N)], N), 'loading')
check('loading / children-arrive', solve('loading', [('children-arrive', N)], N), 'expanded')
check('loading / children-fail', solve('loading', [('children-fail', N)], N), 'load-error')
check('load-error / retry-expand', solve('load-error', [('retry-expand', N)], N), 'loading')
check('loading / collapse-during-load', solve('loading', [('collapse-during-load', N)], N), 'collapse-pending')
check('collapse-pending / children-arrive', solve('collapse-pending', [('children-arrive', N)], N), 'collapsed')
check('expanded / last-child-removed', solve('expanded', [('last-child-removed', N)], N), 'empty')
check('empty / first-child-added', solve('empty', [('first-child-added', N)], N), 'collapsed')
check('older notification incarnation', solve('collapsed', [('expand', N - 1)], N), 'collapsed')
check('future notification incarnation', solve('collapsed', [('expand', N + 1)], N), 'collapsed')
check('unknown event is inert', solve('collapsed', [('unknown-event', N)], N), 'collapsed')
check('empty delivery batch', solve('collapsed', [], N), 'collapsed')
check('N stale deliveries before current delivery', solve('collapsed', [('expand', N - 1)] * N + [('expand', N)], N), 'expanded')
check('trace expand then collapse', solve('collapsed', [('expand', N), ('collapse', N)], N), 'collapsed')
check('trace expand then last-child-removed', solve('collapsed', [('expand', N), ('last-child-removed', N)], N), 'empty')
check('trace collapse then expand', solve('expanded', [('collapse', N), ('expand', N)], N), 'expanded')
check('trace collapse then uncached-expand', solve('expanded', [('collapse', N), ('uncached-expand', N)], N), 'loading')
check('trace uncached-expand then children-arrive', solve('collapsed', [('uncached-expand', N), ('children-arrive', N)], N), 'expanded')
check('trace uncached-expand then children-fail', solve('collapsed', [('uncached-expand', N), ('children-fail', N)], N), 'load-error')
check('trace uncached-expand then collapse-during-load', solve('collapsed', [('uncached-expand', N), ('collapse-during-load', N)], N), 'collapse-pending')
check('trace children-arrive then collapse', solve('loading', [('children-arrive', N), ('collapse', N)], N), 'collapsed')
check('trace children-arrive then last-child-removed', solve('loading', [('children-arrive', N), ('last-child-removed', N)], N), 'empty')
check('trace children-fail then retry-expand', solve('loading', [('children-fail', N), ('retry-expand', N)], N), 'loading')
check('trace retry-expand then children-arrive', solve('load-error', [('retry-expand', N), ('children-arrive', N)], N), 'expanded')
check('trace retry-expand then children-fail', solve('load-error', [('retry-expand', N), ('children-fail', N)], N), 'load-error')
check('trace retry-expand then collapse-during-load', solve('load-error', [('retry-expand', N), ('collapse-during-load', N)], N), 'collapse-pending')
check('trace collapse-during-load then children-arrive', solve('loading', [('collapse-during-load', N), ('children-arrive', N)], N), 'collapsed')
check('trace children-arrive then expand', solve('collapse-pending', [('children-arrive', N), ('expand', N)], N), 'expanded')
check('trace children-arrive then uncached-expand', solve('collapse-pending', [('children-arrive', N), ('uncached-expand', N)], N), 'loading')
check('trace last-child-removed then first-child-added', solve('expanded', [('last-child-removed', N), ('first-child-added', N)], N), 'collapsed')
check('trace first-child-added then expand', solve('empty', [('first-child-added', N), ('expand', N)], N), 'expanded')
check('trace first-child-added then uncached-expand', solve('empty', [('first-child-added', N), ('uncached-expand', N)], N), 'loading')
check('domain state regression 1: children', solve('loading', [('children-arrive', N, {'request': 2, 'children': ['old']})], N, {}, 'children'), {'phase': 'loading', 'value': ['a', 'b']})
check('domain state regression 2: children', solve('loading', [('children-arrive', N, {'children': ['x', 'x', 'y']})], N, {}, 'children'), {'phase': 'expanded', 'value': ['x', 'y']})
check('domain state regression 3: wanted_open', solve('collapse-pending', [('children-arrive', N, {'children': ['x']})], N, {}, 'wanted_open'), {'phase': 'collapsed', 'value': False})
check('domain state regression 4: children', solve('expanded', [('last-child-removed', N, {})], N, {}, 'children'), {'phase': 'empty', 'value': []})
check('domain state regression 5: children', solve('empty', [('first-child-added', N, {'child': 'z'})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['z']})
check('domain state regression 6: children', solve('expanded', [('collapse', N, {})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['a', 'b']})
check('domain state regression 7: children', solve('collapsed', [('uncached-expand', N, {}), ('collapse-during-load', N, {}), ('children-arrive', N, {'children': ['x', 'y']})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['x', 'y']})
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 |
|---|---|---|---|
| collapsed / expand | expanded | expanded | Passed |
| expanded / collapse | loading | collapsed | Failed |
| collapsed / uncached-expand | loading | loading | Passed |
| loading / children-arrive | expanded | expanded | Passed |
| loading / children-fail | load-error | load-error | Passed |
| load-error / retry-expand | loading | loading | Passed |
| loading / collapse-during-load | collapse-pending | collapse-pending | Passed |
| collapse-pending / children-arrive | collapsed | collapsed | Passed |
| expanded / last-child-removed | empty | empty | Passed |
| empty / first-child-added | collapsed | collapsed | Passed |
| older notification incarnation | collapsed | collapsed | Passed |
| future notification incarnation | collapsed | collapsed | Passed |
| unknown event is inert | collapsed | collapsed | Passed |
| empty delivery batch | collapsed | collapsed | Passed |
| N stale deliveries before current delivery | expanded | expanded | Passed |
| trace expand then collapse | loading | collapsed | Failed |
| trace expand then last-child-removed | empty | empty | Passed |
| trace collapse then expand | loading | expanded | Failed |
| trace collapse then uncached-expand | loading | loading | Passed |
| trace uncached-expand then children-arrive | expanded | expanded | Passed |
| trace uncached-expand then children-fail | load-error | load-error | Passed |
| trace uncached-expand then collapse-during-load | collapse-pending | collapse-pending | Passed |
| trace children-arrive then collapse | loading | collapsed | Failed |
| trace children-arrive then last-child-removed | empty | empty | Passed |
| trace children-fail then retry-expand | loading | loading | Passed |
| trace retry-expand then children-arrive | expanded | expanded | Passed |
| trace retry-expand then children-fail | load-error | load-error | Passed |
| trace retry-expand then collapse-during-load | collapse-pending | collapse-pending | Passed |
| trace collapse-during-load then children-arrive | collapsed | collapsed | Passed |
| trace children-arrive then expand | expanded | expanded | Passed |
| trace children-arrive then uncached-expand | loading | loading | Passed |
| trace last-child-removed then first-child-added | collapsed | collapsed | Passed |
| trace first-child-added then expand | expanded | expanded | Passed |
| trace first-child-added then uncached-expand | loading | loading | Passed |
| domain state regression 1: children | {'phase': 'loading', 'value': ['a', 'b']} | {'phase': 'loading', 'value': ['a', 'b']} | Passed |
| domain state regression 2: children | {'phase': 'expanded', 'value': ['x', 'y']} | {'phase': 'expanded', 'value': ['x', 'y']} | Passed |
| domain state regression 3: wanted_open | {'phase': 'collapsed', 'value': False} | {'phase': 'collapsed', 'value': False} | Passed |
| domain state regression 4: children | {'phase': 'empty', 'value': []} | {'phase': 'empty', 'value': []} | Passed |
| domain state regression 5: children | {'phase': 'collapsed', 'value': ['z']} | {'phase': 'collapsed', 'value': ['z']} | Passed |
| domain state regression 6: children | {'phase': 'loading', 'value': ['a', 'b']} | {'phase': 'collapsed', 'value': ['a', 'b']} | Failed |
| domain state regression 7: children | {'phase': 'collapsed', 'value': ['x', 'y']} | {'phase': 'collapsed', 'value': ['x', 'y']} | Passed |
SHA-256 / 49076222aebf748d939a75b3bf6aacca853d933bcaa3aa09ca27660339e193e3
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(initial, events, generation, payload=None, observe=None):
table = {('collapsed', 'expand'): 'expanded', ('expanded', 'collapse'): 'collapsed', ('collapsed', 'uncached-expand'): 'loading', ('loading', 'children-arrive'): 'expanded', ('loading', 'children-fail'): 'load-error', ('load-error', 'retry-expand'): 'loading', ('loading', 'collapse-during-load'): 'collapse-pending', ('collapse-pending', 'children-arrive'): 'collapsed', ('expanded', 'last-child-removed'): 'empty', ('empty', 'first-child-added'): 'collapsed'}
data = json.loads(json.dumps({'children': ['a', 'b'], 'request': 3, 'wanted_open': False})) if payload is None else {**json.loads(json.dumps({'children': ['a', 'b'], 'request': 3, 'wanted_open': False})), **json.loads(json.dumps(payload))}
state = initial
for delivery in events:
event, event_generation = delivery[:2]
arg = delivery[2] if len(delivery) > 2 else {}
if event_generation == generation:
previous = state
if event in ('children-arrive','children-fail') and arg.get('request',data['request']) != data['request']: event = 'unknown-event'
if event in ('expand','uncached-expand','retry-expand'): data['wanted_open'] = True
if event in ('collapse','collapse-during-load'): data['wanted_open'] = False
if event == 'children-arrive' and 'children' in arg: data['children'] = list(dict.fromkeys(arg['children']))
if event == 'last-child-removed': data['children'] = []
if event == 'first-child-added': data['children'] = [arg.get('child','new')]
state = table.get((state, event), state)
if state == 'expanded': data['wanted_open'] = True
if state in ('collapsed','empty'): data['wanted_open'] = False
return {'phase': state, 'value': data[observe]} if observe else state
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('collapsed / expand', solve('collapsed', [('expand', N)], N), 'expanded')
check('expanded / collapse', solve('expanded', [('collapse', N)], N), 'collapsed')
check('collapsed / uncached-expand', solve('collapsed', [('uncached-expand', N)], N), 'loading')
check('loading / children-arrive', solve('loading', [('children-arrive', N)], N), 'expanded')
check('loading / children-fail', solve('loading', [('children-fail', N)], N), 'load-error')
check('load-error / retry-expand', solve('load-error', [('retry-expand', N)], N), 'loading')
check('loading / collapse-during-load', solve('loading', [('collapse-during-load', N)], N), 'collapse-pending')
check('collapse-pending / children-arrive', solve('collapse-pending', [('children-arrive', N)], N), 'collapsed')
check('expanded / last-child-removed', solve('expanded', [('last-child-removed', N)], N), 'empty')
check('empty / first-child-added', solve('empty', [('first-child-added', N)], N), 'collapsed')
check('older notification incarnation', solve('collapsed', [('expand', N - 1)], N), 'collapsed')
check('future notification incarnation', solve('collapsed', [('expand', N + 1)], N), 'collapsed')
check('unknown event is inert', solve('collapsed', [('unknown-event', N)], N), 'collapsed')
check('empty delivery batch', solve('collapsed', [], N), 'collapsed')
check('N stale deliveries before current delivery', solve('collapsed', [('expand', N - 1)] * N + [('expand', N)], N), 'expanded')
check('trace expand then collapse', solve('collapsed', [('expand', N), ('collapse', N)], N), 'collapsed')
check('trace expand then last-child-removed', solve('collapsed', [('expand', N), ('last-child-removed', N)], N), 'empty')
check('trace collapse then expand', solve('expanded', [('collapse', N), ('expand', N)], N), 'expanded')
check('trace collapse then uncached-expand', solve('expanded', [('collapse', N), ('uncached-expand', N)], N), 'loading')
check('trace uncached-expand then children-arrive', solve('collapsed', [('uncached-expand', N), ('children-arrive', N)], N), 'expanded')
check('trace uncached-expand then children-fail', solve('collapsed', [('uncached-expand', N), ('children-fail', N)], N), 'load-error')
check('trace uncached-expand then collapse-during-load', solve('collapsed', [('uncached-expand', N), ('collapse-during-load', N)], N), 'collapse-pending')
check('trace children-arrive then collapse', solve('loading', [('children-arrive', N), ('collapse', N)], N), 'collapsed')
check('trace children-arrive then last-child-removed', solve('loading', [('children-arrive', N), ('last-child-removed', N)], N), 'empty')
check('trace children-fail then retry-expand', solve('loading', [('children-fail', N), ('retry-expand', N)], N), 'loading')
check('trace retry-expand then children-arrive', solve('load-error', [('retry-expand', N), ('children-arrive', N)], N), 'expanded')
check('trace retry-expand then children-fail', solve('load-error', [('retry-expand', N), ('children-fail', N)], N), 'load-error')
check('trace retry-expand then collapse-during-load', solve('load-error', [('retry-expand', N), ('collapse-during-load', N)], N), 'collapse-pending')
check('trace collapse-during-load then children-arrive', solve('loading', [('collapse-during-load', N), ('children-arrive', N)], N), 'collapsed')
check('trace children-arrive then expand', solve('collapse-pending', [('children-arrive', N), ('expand', N)], N), 'expanded')
check('trace children-arrive then uncached-expand', solve('collapse-pending', [('children-arrive', N), ('uncached-expand', N)], N), 'loading')
check('trace last-child-removed then first-child-added', solve('expanded', [('last-child-removed', N), ('first-child-added', N)], N), 'collapsed')
check('trace first-child-added then expand', solve('empty', [('first-child-added', N), ('expand', N)], N), 'expanded')
check('trace first-child-added then uncached-expand', solve('empty', [('first-child-added', N), ('uncached-expand', N)], N), 'loading')
check('domain state regression 1: children', solve('loading', [('children-arrive', N, {'request': 2, 'children': ['old']})], N, {}, 'children'), {'phase': 'loading', 'value': ['a', 'b']})
check('domain state regression 2: children', solve('loading', [('children-arrive', N, {'children': ['x', 'x', 'y']})], N, {}, 'children'), {'phase': 'expanded', 'value': ['x', 'y']})
check('domain state regression 3: wanted_open', solve('collapse-pending', [('children-arrive', N, {'children': ['x']})], N, {}, 'wanted_open'), {'phase': 'collapsed', 'value': False})
check('domain state regression 4: children', solve('expanded', [('last-child-removed', N, {})], N, {}, 'children'), {'phase': 'empty', 'value': []})
check('domain state regression 5: children', solve('empty', [('first-child-added', N, {'child': 'z'})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['z']})
check('domain state regression 6: children', solve('expanded', [('collapse', N, {})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['a', 'b']})
check('domain state regression 7: children', solve('collapsed', [('uncached-expand', N, {}), ('collapse-during-load', N, {}), ('children-arrive', N, {'children': ['x', 'y']})], N, {}, 'children'), {'phase': 'collapsed', 'value': ['x', 'y']})
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 |
|---|---|---|---|
| collapsed / expand | expanded | expanded | Passed |
| expanded / collapse | collapsed | collapsed | Passed |
| collapsed / uncached-expand | loading | loading | Passed |
| loading / children-arrive | expanded | expanded | Passed |
| loading / children-fail | load-error | load-error | Passed |
| load-error / retry-expand | loading | loading | Passed |
| loading / collapse-during-load | collapse-pending | collapse-pending | Passed |
| collapse-pending / children-arrive | collapsed | collapsed | Passed |
| expanded / last-child-removed | empty | empty | Passed |
| empty / first-child-added | collapsed | collapsed | Passed |
| older notification incarnation | collapsed | collapsed | Passed |
| future notification incarnation | collapsed | collapsed | Passed |
| unknown event is inert | collapsed | collapsed | Passed |
| empty delivery batch | collapsed | collapsed | Passed |
| N stale deliveries before current delivery | expanded | expanded | Passed |
| trace expand then collapse | collapsed | collapsed | Passed |
| trace expand then last-child-removed | empty | empty | Passed |
| trace collapse then expand | expanded | expanded | Passed |
| trace collapse then uncached-expand | loading | loading | Passed |
| trace uncached-expand then children-arrive | expanded | expanded | Passed |
| trace uncached-expand then children-fail | load-error | load-error | Passed |
| trace uncached-expand then collapse-during-load | collapse-pending | collapse-pending | Passed |
| trace children-arrive then collapse | collapsed | collapsed | Passed |
| trace children-arrive then last-child-removed | empty | empty | Passed |
| trace children-fail then retry-expand | loading | loading | Passed |
| trace retry-expand then children-arrive | expanded | expanded | Passed |
| trace retry-expand then children-fail | load-error | load-error | Passed |
| trace retry-expand then collapse-during-load | collapse-pending | collapse-pending | Passed |
| trace collapse-during-load then children-arrive | collapsed | collapsed | Passed |
| trace children-arrive then expand | expanded | expanded | Passed |
| trace children-arrive then uncached-expand | loading | loading | Passed |
| trace last-child-removed then first-child-added | collapsed | collapsed | Passed |
| trace first-child-added then expand | expanded | expanded | Passed |
| trace first-child-added then uncached-expand | loading | loading | Passed |
| domain state regression 1: children | {'phase': 'loading', 'value': ['a', 'b']} | {'phase': 'loading', 'value': ['a', 'b']} | Passed |
| domain state regression 2: children | {'phase': 'expanded', 'value': ['x', 'y']} | {'phase': 'expanded', 'value': ['x', 'y']} | Passed |
| domain state regression 3: wanted_open | {'phase': 'collapsed', 'value': False} | {'phase': 'collapsed', 'value': False} | Passed |
| domain state regression 4: children | {'phase': 'empty', 'value': []} | {'phase': 'empty', 'value': []} | Passed |
| domain state regression 5: children | {'phase': 'collapsed', 'value': ['z']} | {'phase': 'collapsed', 'value': ['z']} | Passed |
| domain state regression 6: children | {'phase': 'collapsed', 'value': ['a', 'b']} | {'phase': 'collapsed', 'value': ['a', 'b']} | Passed |
| domain state regression 7: children | {'phase': 'collapsed', 'value': ['x', 'y']} | {'phase': 'collapsed', 'value': ['x', 'y']} | Passed |
SHA-256 / 8d360c087c50c3bf7b717357bd9581455e79e318bc35da05c062f3b8fa7fb912
Verification & scope
Stipulated single-notification state and policy model only. Event delivery and acknowledgements are explicit test inputs. No DOM, accessibility announcements, live timers, networking, actual rendering, or production-platform conformance is simulated. 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:42:28.541374+00:00.
Case digest / 137e4ce0f2f0d8875a123578b8ef83a6e540c64820a7967f3e622d1275da4574