FA-33896 / Notification interfaces / Open access
Notification undo affordance: undo-success from undo-pending · case 01
The undo-success event leaves a notification in committed instead of restored.
ROOT CAUSE
Successful undo is displayed as committed destruction.
VERIFIED REPAIR
Commit the undo-pending / undo-success transition to restored; preserve the other explicitly stipulated transitions.
Unsuccessful approach: Reopening the undo offer permits a second reversal.
Case contract
Notification undo affordance is a bounded visual-notification workflow with mutable policy state {'deadline': 20, 'now': 5, 'applied': True, 'requests': 0}. Its default transition relation is {('offered', 'undo-click'): 'undo-pending', ('undo-pending', 'undo-success'): 'restored', ('undo-pending', 'undo-failure'): 'retry-offered', ('offered', 'window-end'): 'committed', ('undo-pending', 'window-end'): 'undo-pending', ('retry-offered', 'retry-click'): 'undo-pending', ('restored', 'late-window-end'): 'restored', ('committed', 'late-undo-click'): 'too-late', ('too-late', 'acknowledge'): 'closed', ('retry-offered', 'dismiss-error'): 'committed'}; 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 = {('offered', 'undo-click'): 'undo-pending', ('undo-pending', 'undo-success'): 'committed', ('undo-pending', 'undo-failure'): 'retry-offered', ('offered', 'window-end'): 'committed', ('undo-pending', 'window-end'): 'undo-pending', ('retry-offered', 'retry-click'): 'undo-pending', ('restored', 'late-window-end'): 'restored', ('committed', 'late-undo-click'): 'too-late', ('too-late', 'acknowledge'): 'closed', ('retry-offered', 'dismiss-error'): 'committed'}
data = json.loads(json.dumps({'deadline': 20, 'now': 5, 'applied': True, 'requests': 0})) if payload is None else {**json.loads(json.dumps({'deadline': 20, 'now': 5, 'applied': True, 'requests': 0})), **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
data['now'] = max(data['now'], arg.get('now', data['now']))
if event in ('undo-click', 'retry-click'):
if data['now'] >= data['deadline']: event = 'window-end'
else: data['requests'] += 1
if event == 'window-end' and data['now'] < data['deadline'] and 'now' in arg: event = 'unknown-event'
state = table.get((state, event), state)
if state == 'restored': data['applied'] = False
if state == 'committed': data['applied'] = True
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('offered / undo-click', solve('offered', [('undo-click', N)], N), 'undo-pending')
check('undo-pending / undo-success', solve('undo-pending', [('undo-success', N)], N), 'restored')
check('undo-pending / undo-failure', solve('undo-pending', [('undo-failure', N)], N), 'retry-offered')
check('offered / window-end', solve('offered', [('window-end', N)], N), 'committed')
check('undo-pending / window-end', solve('undo-pending', [('window-end', N)], N), 'undo-pending')
check('retry-offered / retry-click', solve('retry-offered', [('retry-click', N)], N), 'undo-pending')
check('restored / late-window-end', solve('restored', [('late-window-end', N)], N), 'restored')
check('committed / late-undo-click', solve('committed', [('late-undo-click', N)], N), 'too-late')
check('too-late / acknowledge', solve('too-late', [('acknowledge', N)], N), 'closed')
check('retry-offered / dismiss-error', solve('retry-offered', [('dismiss-error', N)], N), 'committed')
check('older notification incarnation', solve('offered', [('undo-click', N - 1)], N), 'offered')
check('future notification incarnation', solve('offered', [('undo-click', N + 1)], N), 'offered')
check('unknown event is inert', solve('offered', [('unknown-event', N)], N), 'offered')
check('empty delivery batch', solve('offered', [], N), 'offered')
check('N stale deliveries before current delivery', solve('offered', [('undo-click', N - 1)] * N + [('undo-click', N)], N), 'undo-pending')
check('trace undo-click then undo-success', solve('offered', [('undo-click', N), ('undo-success', N)], N), 'restored')
check('trace undo-click then undo-failure', solve('offered', [('undo-click', N), ('undo-failure', N)], N), 'retry-offered')
check('trace undo-click then window-end', solve('offered', [('undo-click', N), ('window-end', N)], N), 'undo-pending')
check('trace undo-success then late-window-end', solve('undo-pending', [('undo-success', N), ('late-window-end', N)], N), 'restored')
check('trace undo-failure then retry-click', solve('undo-pending', [('undo-failure', N), ('retry-click', N)], N), 'undo-pending')
check('trace undo-failure then dismiss-error', solve('undo-pending', [('undo-failure', N), ('dismiss-error', N)], N), 'committed')
check('trace window-end then late-undo-click', solve('offered', [('window-end', N), ('late-undo-click', N)], N), 'too-late')
check('trace window-end then undo-success', solve('undo-pending', [('window-end', N), ('undo-success', N)], N), 'restored')
check('trace window-end then undo-failure', solve('undo-pending', [('window-end', N), ('undo-failure', N)], N), 'retry-offered')
check('trace window-end then window-end', solve('undo-pending', [('window-end', N), ('window-end', N)], N), 'undo-pending')
check('trace retry-click then undo-success', solve('retry-offered', [('retry-click', N), ('undo-success', N)], N), 'restored')
check('trace retry-click then undo-failure', solve('retry-offered', [('retry-click', N), ('undo-failure', N)], N), 'retry-offered')
check('trace retry-click then window-end', solve('retry-offered', [('retry-click', N), ('window-end', N)], N), 'undo-pending')
check('trace late-window-end then late-window-end', solve('restored', [('late-window-end', N), ('late-window-end', N)], N), 'restored')
check('trace late-undo-click then acknowledge', solve('committed', [('late-undo-click', N), ('acknowledge', N)], N), 'closed')
check('trace dismiss-error then late-undo-click', solve('retry-offered', [('dismiss-error', N), ('late-undo-click', N)], N), 'too-late')
check('domain state regression 1: requests', solve('offered', [('undo-click', N, {'now': 19})], N, {}, 'requests'), {'phase': 'undo-pending', 'value': 1})
check('domain state regression 2: requests', solve('offered', [('undo-click', N, {'now': 20})], N, {}, 'requests'), {'phase': 'committed', 'value': 0})
check('domain state regression 3: applied', solve('offered', [('window-end', N, {'now': 19})], N, {}, 'applied'), {'phase': 'offered', 'value': True})
check('domain state regression 4: applied', solve('undo-pending', [('undo-success', N, {})], N, {}, 'applied'), {'phase': 'restored', 'value': False})
check('domain state regression 5: requests', solve('retry-offered', [('retry-click', N, {'now': 8})], N, {'requests': 1}, 'requests'), {'phase': 'undo-pending', 'value': 2})
check('domain state regression 6: now', solve('offered', [('undo-click', N, {'now': 2})], N, {}, 'now'), {'phase': 'undo-pending', 'value': 5})
check('domain state regression 7: applied', solve('offered', [('undo-click', N, {'now': 19}), ('window-end', N, {'now': 20}), ('undo-success', N, {})], N, {}, 'applied'), {'phase': 'restored', 'value': False})
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 |
|---|---|---|---|
| offered / undo-click | undo-pending | undo-pending | Passed |
| undo-pending / undo-success | committed | restored | Failed |
| undo-pending / undo-failure | retry-offered | retry-offered | Passed |
| offered / window-end | committed | committed | Passed |
| undo-pending / window-end | undo-pending | undo-pending | Passed |
| retry-offered / retry-click | undo-pending | undo-pending | Passed |
| restored / late-window-end | restored | restored | Passed |
| committed / late-undo-click | too-late | too-late | Passed |
| too-late / acknowledge | closed | closed | Passed |
| retry-offered / dismiss-error | committed | committed | Passed |
| older notification incarnation | offered | offered | Passed |
| future notification incarnation | offered | offered | Passed |
| unknown event is inert | offered | offered | Passed |
| empty delivery batch | offered | offered | Passed |
| N stale deliveries before current delivery | undo-pending | undo-pending | Passed |
| trace undo-click then undo-success | committed | restored | Failed |
| trace undo-click then undo-failure | retry-offered | retry-offered | Passed |
| trace undo-click then window-end | undo-pending | undo-pending | Passed |
| trace undo-success then late-window-end | committed | restored | Failed |
| trace undo-failure then retry-click | undo-pending | undo-pending | Passed |
| trace undo-failure then dismiss-error | committed | committed | Passed |
| trace window-end then late-undo-click | too-late | too-late | Passed |
| trace window-end then undo-success | committed | restored | Failed |
| trace window-end then undo-failure | retry-offered | retry-offered | Passed |
| trace window-end then window-end | undo-pending | undo-pending | Passed |
| trace retry-click then undo-success | committed | restored | Failed |
| trace retry-click then undo-failure | retry-offered | retry-offered | Passed |
| trace retry-click then window-end | undo-pending | undo-pending | Passed |
| trace late-window-end then late-window-end | restored | restored | Passed |
| trace late-undo-click then acknowledge | closed | closed | Passed |
| trace dismiss-error then late-undo-click | too-late | too-late | Passed |
| domain state regression 1: requests | {'phase': 'undo-pending', 'value': 1} | {'phase': 'undo-pending', 'value': 1} | Passed |
| domain state regression 2: requests | {'phase': 'committed', 'value': 0} | {'phase': 'committed', 'value': 0} | Passed |
| domain state regression 3: applied | {'phase': 'offered', 'value': True} | {'phase': 'offered', 'value': True} | Passed |
| domain state regression 4: applied | {'phase': 'committed', 'value': True} | {'phase': 'restored', 'value': False} | Failed |
| domain state regression 5: requests | {'phase': 'undo-pending', 'value': 2} | {'phase': 'undo-pending', 'value': 2} | Passed |
| domain state regression 6: now | {'phase': 'undo-pending', 'value': 5} | {'phase': 'undo-pending', 'value': 5} | Passed |
| domain state regression 7: applied | {'phase': 'committed', 'value': True} | {'phase': 'restored', 'value': False} | Failed |
SHA-256 / 495d58c9690aadda7069a018fdebcd18ce7937d09a90c67cc09b6a329ca6f13d
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 = {('offered', 'undo-click'): 'undo-pending', ('undo-pending', 'undo-success'): 'offered', ('undo-pending', 'undo-failure'): 'retry-offered', ('offered', 'window-end'): 'committed', ('undo-pending', 'window-end'): 'undo-pending', ('retry-offered', 'retry-click'): 'undo-pending', ('restored', 'late-window-end'): 'restored', ('committed', 'late-undo-click'): 'too-late', ('too-late', 'acknowledge'): 'closed', ('retry-offered', 'dismiss-error'): 'committed'}
data = json.loads(json.dumps({'deadline': 20, 'now': 5, 'applied': True, 'requests': 0})) if payload is None else {**json.loads(json.dumps({'deadline': 20, 'now': 5, 'applied': True, 'requests': 0})), **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
data['now'] = max(data['now'], arg.get('now', data['now']))
if event in ('undo-click', 'retry-click'):
if data['now'] >= data['deadline']: event = 'window-end'
else: data['requests'] += 1
if event == 'window-end' and data['now'] < data['deadline'] and 'now' in arg: event = 'unknown-event'
state = table.get((state, event), state)
if state == 'restored': data['applied'] = False
if state == 'committed': data['applied'] = True
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('offered / undo-click', solve('offered', [('undo-click', N)], N), 'undo-pending')
check('undo-pending / undo-success', solve('undo-pending', [('undo-success', N)], N), 'restored')
check('undo-pending / undo-failure', solve('undo-pending', [('undo-failure', N)], N), 'retry-offered')
check('offered / window-end', solve('offered', [('window-end', N)], N), 'committed')
check('undo-pending / window-end', solve('undo-pending', [('window-end', N)], N), 'undo-pending')
check('retry-offered / retry-click', solve('retry-offered', [('retry-click', N)], N), 'undo-pending')
check('restored / late-window-end', solve('restored', [('late-window-end', N)], N), 'restored')
check('committed / late-undo-click', solve('committed', [('late-undo-click', N)], N), 'too-late')
check('too-late / acknowledge', solve('too-late', [('acknowledge', N)], N), 'closed')
check('retry-offered / dismiss-error', solve('retry-offered', [('dismiss-error', N)], N), 'committed')
check('older notification incarnation', solve('offered', [('undo-click', N - 1)], N), 'offered')
check('future notification incarnation', solve('offered', [('undo-click', N + 1)], N), 'offered')
check('unknown event is inert', solve('offered', [('unknown-event', N)], N), 'offered')
check('empty delivery batch', solve('offered', [], N), 'offered')
check('N stale deliveries before current delivery', solve('offered', [('undo-click', N - 1)] * N + [('undo-click', N)], N), 'undo-pending')
check('trace undo-click then undo-success', solve('offered', [('undo-click', N), ('undo-success', N)], N), 'restored')
check('trace undo-click then undo-failure', solve('offered', [('undo-click', N), ('undo-failure', N)], N), 'retry-offered')
check('trace undo-click then window-end', solve('offered', [('undo-click', N), ('window-end', N)], N), 'undo-pending')
check('trace undo-success then late-window-end', solve('undo-pending', [('undo-success', N), ('late-window-end', N)], N), 'restored')
check('trace undo-failure then retry-click', solve('undo-pending', [('undo-failure', N), ('retry-click', N)], N), 'undo-pending')
check('trace undo-failure then dismiss-error', solve('undo-pending', [('undo-failure', N), ('dismiss-error', N)], N), 'committed')
check('trace window-end then late-undo-click', solve('offered', [('window-end', N), ('late-undo-click', N)], N), 'too-late')
check('trace window-end then undo-success', solve('undo-pending', [('window-end', N), ('undo-success', N)], N), 'restored')
check('trace window-end then undo-failure', solve('undo-pending', [('window-end', N), ('undo-failure', N)], N), 'retry-offered')
check('trace window-end then window-end', solve('undo-pending', [('window-end', N), ('window-end', N)], N), 'undo-pending')
check('trace retry-click then undo-success', solve('retry-offered', [('retry-click', N), ('undo-success', N)], N), 'restored')
check('trace retry-click then undo-failure', solve('retry-offered', [('retry-click', N), ('undo-failure', N)], N), 'retry-offered')
check('trace retry-click then window-end', solve('retry-offered', [('retry-click', N), ('window-end', N)], N), 'undo-pending')
check('trace late-window-end then late-window-end', solve('restored', [('late-window-end', N), ('late-window-end', N)], N), 'restored')
check('trace late-undo-click then acknowledge', solve('committed', [('late-undo-click', N), ('acknowledge', N)], N), 'closed')
check('trace dismiss-error then late-undo-click', solve('retry-offered', [('dismiss-error', N), ('late-undo-click', N)], N), 'too-late')
check('domain state regression 1: requests', solve('offered', [('undo-click', N, {'now': 19})], N, {}, 'requests'), {'phase': 'undo-pending', 'value': 1})
check('domain state regression 2: requests', solve('offered', [('undo-click', N, {'now': 20})], N, {}, 'requests'), {'phase': 'committed', 'value': 0})
check('domain state regression 3: applied', solve('offered', [('window-end', N, {'now': 19})], N, {}, 'applied'), {'phase': 'offered', 'value': True})
check('domain state regression 4: applied', solve('undo-pending', [('undo-success', N, {})], N, {}, 'applied'), {'phase': 'restored', 'value': False})
check('domain state regression 5: requests', solve('retry-offered', [('retry-click', N, {'now': 8})], N, {'requests': 1}, 'requests'), {'phase': 'undo-pending', 'value': 2})
check('domain state regression 6: now', solve('offered', [('undo-click', N, {'now': 2})], N, {}, 'now'), {'phase': 'undo-pending', 'value': 5})
check('domain state regression 7: applied', solve('offered', [('undo-click', N, {'now': 19}), ('window-end', N, {'now': 20}), ('undo-success', N, {})], N, {}, 'applied'), {'phase': 'restored', 'value': False})
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 |
|---|---|---|---|
| offered / undo-click | undo-pending | undo-pending | Passed |
| undo-pending / undo-success | offered | restored | Failed |
| undo-pending / undo-failure | retry-offered | retry-offered | Passed |
| offered / window-end | committed | committed | Passed |
| undo-pending / window-end | undo-pending | undo-pending | Passed |
| retry-offered / retry-click | undo-pending | undo-pending | Passed |
| restored / late-window-end | restored | restored | Passed |
| committed / late-undo-click | too-late | too-late | Passed |
| too-late / acknowledge | closed | closed | Passed |
| retry-offered / dismiss-error | committed | committed | Passed |
| older notification incarnation | offered | offered | Passed |
| future notification incarnation | offered | offered | Passed |
| unknown event is inert | offered | offered | Passed |
| empty delivery batch | offered | offered | Passed |
| N stale deliveries before current delivery | undo-pending | undo-pending | Passed |
| trace undo-click then undo-success | offered | restored | Failed |
| trace undo-click then undo-failure | retry-offered | retry-offered | Passed |
| trace undo-click then window-end | undo-pending | undo-pending | Passed |
| trace undo-success then late-window-end | offered | restored | Failed |
| trace undo-failure then retry-click | undo-pending | undo-pending | Passed |
| trace undo-failure then dismiss-error | committed | committed | Passed |
| trace window-end then late-undo-click | too-late | too-late | Passed |
| trace window-end then undo-success | offered | restored | Failed |
| trace window-end then undo-failure | retry-offered | retry-offered | Passed |
| trace window-end then window-end | undo-pending | undo-pending | Passed |
| trace retry-click then undo-success | offered | restored | Failed |
| trace retry-click then undo-failure | retry-offered | retry-offered | Passed |
| trace retry-click then window-end | undo-pending | undo-pending | Passed |
| trace late-window-end then late-window-end | restored | restored | Passed |
| trace late-undo-click then acknowledge | closed | closed | Passed |
| trace dismiss-error then late-undo-click | too-late | too-late | Passed |
| domain state regression 1: requests | {'phase': 'undo-pending', 'value': 1} | {'phase': 'undo-pending', 'value': 1} | Passed |
| domain state regression 2: requests | {'phase': 'committed', 'value': 0} | {'phase': 'committed', 'value': 0} | Passed |
| domain state regression 3: applied | {'phase': 'offered', 'value': True} | {'phase': 'offered', 'value': True} | Passed |
| domain state regression 4: applied | {'phase': 'offered', 'value': True} | {'phase': 'restored', 'value': False} | Failed |
| domain state regression 5: requests | {'phase': 'undo-pending', 'value': 2} | {'phase': 'undo-pending', 'value': 2} | Passed |
| domain state regression 6: now | {'phase': 'undo-pending', 'value': 5} | {'phase': 'undo-pending', 'value': 5} | Passed |
| domain state regression 7: applied | {'phase': 'offered', 'value': True} | {'phase': 'restored', 'value': False} | Failed |
SHA-256 / 06b3dc2670aea467ae9c77ffa8ed218e3ad50311de767cdd077b27fd5556a2f9
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 = {('offered', 'undo-click'): 'undo-pending', ('undo-pending', 'undo-success'): 'restored', ('undo-pending', 'undo-failure'): 'retry-offered', ('offered', 'window-end'): 'committed', ('undo-pending', 'window-end'): 'undo-pending', ('retry-offered', 'retry-click'): 'undo-pending', ('restored', 'late-window-end'): 'restored', ('committed', 'late-undo-click'): 'too-late', ('too-late', 'acknowledge'): 'closed', ('retry-offered', 'dismiss-error'): 'committed'}
data = json.loads(json.dumps({'deadline': 20, 'now': 5, 'applied': True, 'requests': 0})) if payload is None else {**json.loads(json.dumps({'deadline': 20, 'now': 5, 'applied': True, 'requests': 0})), **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
data['now'] = max(data['now'], arg.get('now', data['now']))
if event in ('undo-click', 'retry-click'):
if data['now'] >= data['deadline']: event = 'window-end'
else: data['requests'] += 1
if event == 'window-end' and data['now'] < data['deadline'] and 'now' in arg: event = 'unknown-event'
state = table.get((state, event), state)
if state == 'restored': data['applied'] = False
if state == 'committed': data['applied'] = True
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('offered / undo-click', solve('offered', [('undo-click', N)], N), 'undo-pending')
check('undo-pending / undo-success', solve('undo-pending', [('undo-success', N)], N), 'restored')
check('undo-pending / undo-failure', solve('undo-pending', [('undo-failure', N)], N), 'retry-offered')
check('offered / window-end', solve('offered', [('window-end', N)], N), 'committed')
check('undo-pending / window-end', solve('undo-pending', [('window-end', N)], N), 'undo-pending')
check('retry-offered / retry-click', solve('retry-offered', [('retry-click', N)], N), 'undo-pending')
check('restored / late-window-end', solve('restored', [('late-window-end', N)], N), 'restored')
check('committed / late-undo-click', solve('committed', [('late-undo-click', N)], N), 'too-late')
check('too-late / acknowledge', solve('too-late', [('acknowledge', N)], N), 'closed')
check('retry-offered / dismiss-error', solve('retry-offered', [('dismiss-error', N)], N), 'committed')
check('older notification incarnation', solve('offered', [('undo-click', N - 1)], N), 'offered')
check('future notification incarnation', solve('offered', [('undo-click', N + 1)], N), 'offered')
check('unknown event is inert', solve('offered', [('unknown-event', N)], N), 'offered')
check('empty delivery batch', solve('offered', [], N), 'offered')
check('N stale deliveries before current delivery', solve('offered', [('undo-click', N - 1)] * N + [('undo-click', N)], N), 'undo-pending')
check('trace undo-click then undo-success', solve('offered', [('undo-click', N), ('undo-success', N)], N), 'restored')
check('trace undo-click then undo-failure', solve('offered', [('undo-click', N), ('undo-failure', N)], N), 'retry-offered')
check('trace undo-click then window-end', solve('offered', [('undo-click', N), ('window-end', N)], N), 'undo-pending')
check('trace undo-success then late-window-end', solve('undo-pending', [('undo-success', N), ('late-window-end', N)], N), 'restored')
check('trace undo-failure then retry-click', solve('undo-pending', [('undo-failure', N), ('retry-click', N)], N), 'undo-pending')
check('trace undo-failure then dismiss-error', solve('undo-pending', [('undo-failure', N), ('dismiss-error', N)], N), 'committed')
check('trace window-end then late-undo-click', solve('offered', [('window-end', N), ('late-undo-click', N)], N), 'too-late')
check('trace window-end then undo-success', solve('undo-pending', [('window-end', N), ('undo-success', N)], N), 'restored')
check('trace window-end then undo-failure', solve('undo-pending', [('window-end', N), ('undo-failure', N)], N), 'retry-offered')
check('trace window-end then window-end', solve('undo-pending', [('window-end', N), ('window-end', N)], N), 'undo-pending')
check('trace retry-click then undo-success', solve('retry-offered', [('retry-click', N), ('undo-success', N)], N), 'restored')
check('trace retry-click then undo-failure', solve('retry-offered', [('retry-click', N), ('undo-failure', N)], N), 'retry-offered')
check('trace retry-click then window-end', solve('retry-offered', [('retry-click', N), ('window-end', N)], N), 'undo-pending')
check('trace late-window-end then late-window-end', solve('restored', [('late-window-end', N), ('late-window-end', N)], N), 'restored')
check('trace late-undo-click then acknowledge', solve('committed', [('late-undo-click', N), ('acknowledge', N)], N), 'closed')
check('trace dismiss-error then late-undo-click', solve('retry-offered', [('dismiss-error', N), ('late-undo-click', N)], N), 'too-late')
check('domain state regression 1: requests', solve('offered', [('undo-click', N, {'now': 19})], N, {}, 'requests'), {'phase': 'undo-pending', 'value': 1})
check('domain state regression 2: requests', solve('offered', [('undo-click', N, {'now': 20})], N, {}, 'requests'), {'phase': 'committed', 'value': 0})
check('domain state regression 3: applied', solve('offered', [('window-end', N, {'now': 19})], N, {}, 'applied'), {'phase': 'offered', 'value': True})
check('domain state regression 4: applied', solve('undo-pending', [('undo-success', N, {})], N, {}, 'applied'), {'phase': 'restored', 'value': False})
check('domain state regression 5: requests', solve('retry-offered', [('retry-click', N, {'now': 8})], N, {'requests': 1}, 'requests'), {'phase': 'undo-pending', 'value': 2})
check('domain state regression 6: now', solve('offered', [('undo-click', N, {'now': 2})], N, {}, 'now'), {'phase': 'undo-pending', 'value': 5})
check('domain state regression 7: applied', solve('offered', [('undo-click', N, {'now': 19}), ('window-end', N, {'now': 20}), ('undo-success', N, {})], N, {}, 'applied'), {'phase': 'restored', 'value': False})
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 |
|---|---|---|---|
| offered / undo-click | undo-pending | undo-pending | Passed |
| undo-pending / undo-success | restored | restored | Passed |
| undo-pending / undo-failure | retry-offered | retry-offered | Passed |
| offered / window-end | committed | committed | Passed |
| undo-pending / window-end | undo-pending | undo-pending | Passed |
| retry-offered / retry-click | undo-pending | undo-pending | Passed |
| restored / late-window-end | restored | restored | Passed |
| committed / late-undo-click | too-late | too-late | Passed |
| too-late / acknowledge | closed | closed | Passed |
| retry-offered / dismiss-error | committed | committed | Passed |
| older notification incarnation | offered | offered | Passed |
| future notification incarnation | offered | offered | Passed |
| unknown event is inert | offered | offered | Passed |
| empty delivery batch | offered | offered | Passed |
| N stale deliveries before current delivery | undo-pending | undo-pending | Passed |
| trace undo-click then undo-success | restored | restored | Passed |
| trace undo-click then undo-failure | retry-offered | retry-offered | Passed |
| trace undo-click then window-end | undo-pending | undo-pending | Passed |
| trace undo-success then late-window-end | restored | restored | Passed |
| trace undo-failure then retry-click | undo-pending | undo-pending | Passed |
| trace undo-failure then dismiss-error | committed | committed | Passed |
| trace window-end then late-undo-click | too-late | too-late | Passed |
| trace window-end then undo-success | restored | restored | Passed |
| trace window-end then undo-failure | retry-offered | retry-offered | Passed |
| trace window-end then window-end | undo-pending | undo-pending | Passed |
| trace retry-click then undo-success | restored | restored | Passed |
| trace retry-click then undo-failure | retry-offered | retry-offered | Passed |
| trace retry-click then window-end | undo-pending | undo-pending | Passed |
| trace late-window-end then late-window-end | restored | restored | Passed |
| trace late-undo-click then acknowledge | closed | closed | Passed |
| trace dismiss-error then late-undo-click | too-late | too-late | Passed |
| domain state regression 1: requests | {'phase': 'undo-pending', 'value': 1} | {'phase': 'undo-pending', 'value': 1} | Passed |
| domain state regression 2: requests | {'phase': 'committed', 'value': 0} | {'phase': 'committed', 'value': 0} | Passed |
| domain state regression 3: applied | {'phase': 'offered', 'value': True} | {'phase': 'offered', 'value': True} | Passed |
| domain state regression 4: applied | {'phase': 'restored', 'value': False} | {'phase': 'restored', 'value': False} | Passed |
| domain state regression 5: requests | {'phase': 'undo-pending', 'value': 2} | {'phase': 'undo-pending', 'value': 2} | Passed |
| domain state regression 6: now | {'phase': 'undo-pending', 'value': 5} | {'phase': 'undo-pending', 'value': 5} | Passed |
| domain state regression 7: applied | {'phase': 'restored', 'value': False} | {'phase': 'restored', 'value': False} | Passed |
SHA-256 / 53c9b3a588289712f4ce5e52959ade85439c304c4fbf1c087b1cf9d1647b3340
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:26.721599+00:00.
Case digest / 507e51f4bbafdc26782339f6bbd31272e900c8267972a81c73b05bb24e925238