FAILURE MAP
← Case archive

FA-32626 / Menu interactions / Open access

Recoverable menu command failure loses retry state · case 01

Recoverable menu command failure loses retry state.

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

ROOT CAUSE

The dispatch-lifecycle model applies `{'state':'done','error':None,'retry':False}` at its failure operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `{'state':'failed','error':p['error'],'retry':p['retryable']}` at failure.

Unsuccessful approach: The attempted repair `{'state':'failed','error':p['error'],'retry':False}` still violates the failure 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':'done','error':None,'retry':False}
    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': None, 'retry': False, 'state': 'done'}{'error': 'e1', 'retry': True, 'state': 'failed'}Failed
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 / 158994b0a2ccaab0e2aa25a07b7f74e9485472ccd7daca708821b40d085a34ef

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':False}
    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': False, 'state': 'failed'}{'error': 'e1', 'retry': True, 'state': 'failed'}Failed
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 / 080b2ca8e746e87ed9fb9119bc9888704bc32615e97e965b95a9fe5e75eacbca

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.046907+00:00.

Case digest / 088e0857ba25d674d101cf979453974e3ce405d43e26854127573c6523c0bb42