FA-34126 / Notification interfaces / Open access
Grouped notification interaction: children-arrive from collapse-pending · case 01
The children-arrive event leaves a notification in expanded instead of collapsed.
ROOT CAUSE
A late child response reopens a group collapsed by the user.
THE FAILURE
A late child response reopens a group collapsed by the user.
Unsuccessful approach: Erasing the group discards the loaded summary too.
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'): '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'): 'expanded', ('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 | expanded | collapsed | Failed |
| 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 | expanded | collapsed | Failed |
| trace children-arrive then expand | expanded | expanded | Passed |
| trace children-arrive then uncached-expand | expanded | loading | Failed |
| 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': 'expanded', 'value': True} | {'phase': 'collapsed', 'value': False} | Failed |
| 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': 'expanded', 'value': ['x', 'y']} | {'phase': 'collapsed', 'value': ['x', 'y']} | Failed |
SHA-256 / 404ec2c483050c8ef6e2b7a824c7207979da77f833a0b8c02106269c83bcb031
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'): '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'): 'empty', ('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 | empty | collapsed | Failed |
| 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 | empty | collapsed | Failed |
| trace children-arrive then expand | empty | expanded | Failed |
| trace children-arrive then uncached-expand | empty | loading | Failed |
| 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': 'empty', 'value': False} | {'phase': 'collapsed', 'value': False} | Failed |
| 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': 'empty', 'value': ['x', 'y']} | {'phase': 'collapsed', 'value': ['x', 'y']} | Failed |
SHA-256 / 71fc321cff90420b0797157649ce8968633e2dfde68d04ce0f3b85ed3d6581ba
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 41 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.992521+00:00.
Case digest / 983d1019ebc48cd6b3d709851f7647d7a0c56cfe5732e8c69af5230af95588bd