FAILURE MAP
← Case archive

FA-32631 / Menu interactions / Open access

Menu command retry forgets its captured context · case 01

Menu command retry forgets its captured context.

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

ROOT CAUSE

The dispatch-lifecycle model applies `{'command':p['command'],'attempt':p['attempt'],'context':p['context']}` at its retry-id operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `{'command':p['command'],'attempt':p['attempt']+1,'context':p['context']}` at retry-id.

Unsuccessful approach: The attempted repair `{'command':p['command'],'attempt':p['attempt']+1,'context':None}` still violates the retry-id oracle.

Case contract

Menu command transactions have explicit preparation, execution, success and failure phases; close policy and duplicate suppression are separate.

Why this case matters

Cascading and context menus require coherent command and session state as content changes.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'prepare':
        return 'prepared' if p['validated'] and p['authorized'] else 'rejected'
    if action == 'pending':
        return p['state']=='prepared' and not p['inflight']
    if action == 'success-close':
        return p['success'] and p['policy']=='success'
    if action == 'failure':
        return {'state':'failed','error':p['error'],'retry':p['retryable']}
    if action == 'retry-id':
        return {'command':p['command'],'attempt':p['attempt'],'context':p['context']}
    if action == 'completion':
        return p['transaction']==p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prepare contract', solve('prepare', {'validated':True,'authorized':False,'command':N}), 'rejected')
check('pending contract', solve('pending', {'state':'prepared','inflight':True,'id':N}), False)
check('success-close contract', solve('success-close', {'success':False,'policy':'success','id':N}), False)
check('failure contract', solve('failure', {'error':'e'+str(N),'retryable':True}), {'state':'failed','error':'e'+str(N),'retry':True})
check('retry-id contract', solve('retry-id', {'command':'copy','attempt':N,'context':'doc'}), {'command':'copy','attempt':N+1,'context':'doc'})
check('completion contract', solve('completion', {'transaction':N,'pending':N+1}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
prepare contractrejectedrejectedPassed
pending contractFalseFalsePassed
success-close contractFalseFalsePassed
failure contract{'error': 'e1', 'retry': True, 'state': 'failed'}{'error': 'e1', 'retry': True, 'state': 'failed'}Passed
retry-id contract{'attempt': 1, 'command': 'copy', 'context': 'doc'}{'attempt': 2, 'command': 'copy', 'context': 'doc'}Failed
completion contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 5705193200a7b1fb01af90d53e86f30a36f419aabaee00986da3afb0793455aa

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'prepare':
        return 'prepared' if p['validated'] and p['authorized'] else 'rejected'
    if action == 'pending':
        return p['state']=='prepared' and not p['inflight']
    if action == 'success-close':
        return p['success'] and p['policy']=='success'
    if action == 'failure':
        return {'state':'failed','error':p['error'],'retry':p['retryable']}
    if action == 'retry-id':
        return {'command':p['command'],'attempt':p['attempt']+1,'context':None}
    if action == 'completion':
        return p['transaction']==p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prepare contract', solve('prepare', {'validated':True,'authorized':False,'command':N}), 'rejected')
check('pending contract', solve('pending', {'state':'prepared','inflight':True,'id':N}), False)
check('success-close contract', solve('success-close', {'success':False,'policy':'success','id':N}), False)
check('failure contract', solve('failure', {'error':'e'+str(N),'retryable':True}), {'state':'failed','error':'e'+str(N),'retry':True})
check('retry-id contract', solve('retry-id', {'command':'copy','attempt':N,'context':'doc'}), {'command':'copy','attempt':N+1,'context':'doc'})
check('completion contract', solve('completion', {'transaction':N,'pending':N+1}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
prepare contractrejectedrejectedPassed
pending contractFalseFalsePassed
success-close contractFalseFalsePassed
failure contract{'error': 'e1', 'retry': True, 'state': 'failed'}{'error': 'e1', 'retry': True, 'state': 'failed'}Passed
retry-id contract{'attempt': 2, 'command': 'copy', 'context': None}{'attempt': 2, 'command': 'copy', 'context': 'doc'}Failed
completion contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / cff3df83762c9ba5b44be4f2bceb3d601a1513cf703380969fc998182c74eab1

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'prepare':
        return 'prepared' if p['validated'] and p['authorized'] else 'rejected'
    if action == 'pending':
        return p['state']=='prepared' and not p['inflight']
    if action == 'success-close':
        return p['success'] and p['policy']=='success'
    if action == 'failure':
        return {'state':'failed','error':p['error'],'retry':p['retryable']}
    if action == 'retry-id':
        return {'command':p['command'],'attempt':p['attempt']+1,'context':p['context']}
    if action == 'completion':
        return p['transaction']==p['pending']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('prepare contract', solve('prepare', {'validated':True,'authorized':False,'command':N}), 'rejected')
check('pending contract', solve('pending', {'state':'prepared','inflight':True,'id':N}), False)
check('success-close contract', solve('success-close', {'success':False,'policy':'success','id':N}), False)
check('failure contract', solve('failure', {'error':'e'+str(N),'retryable':True}), {'state':'failed','error':'e'+str(N),'retry':True})
check('retry-id contract', solve('retry-id', {'command':'copy','attempt':N,'context':'doc'}), {'command':'copy','attempt':N+1,'context':'doc'})
check('completion contract', solve('completion', {'transaction':N,'pending':N+1}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
prepare contractrejectedrejectedPassed
pending contractFalseFalsePassed
success-close contractFalseFalsePassed
failure contract{'error': 'e1', 'retry': True, 'state': 'failed'}{'error': 'e1', 'retry': True, 'state': 'failed'}Passed
retry-id contract{'attempt': 2, 'command': 'copy', 'context': 'doc'}{'attempt': 2, 'command': 'copy', 'context': 'doc'}Passed
completion contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / fd0f4097b108236b3995e2f8b1917737e62b02c57749983299887385aecc573a

Verification & scope

Offline supplied-valid-payload model; excludes DOM, keyboard, focus, selection, announcements and browser conformance. 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:14.177440+00:00.

Case digest / 8b3c49e17506faf6b06563a8e1da604a76b3fd8f3aff6d4cc6d028c68a17df48