FAILURE MAP
← Case archive

FA-33066 / Menu interactions / Open access

Menu command rollback executes effects in forward order · case 01

Menu command rollback executes effects in forward order.

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

ROOT CAUSE

The menu-command-receipts model applies `p` at its effect-order operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `list(reversed(p))` at effect-order.

Unsuccessful approach: The attempted repair `sorted(p)` still violates the effect-order oracle.

Case contract

Menu command receipts retain committed effects, invocation identity and reversible scope; receipt generation does not imply successful mutation.

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 == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return p
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), 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
success-receipt contractNoneNonePassed
effect-order contract['create', 'write1', 'rename']['rename', 'write1', 'create']Failed
scope contract[{'document': 'd', 'transaction': 1}][{'document': 'd', 'transaction': 1}]Passed
description contractMove 1Move 1Passed
noop contractNoneNonePassed
merge-window contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 2b6e08435782db4e8a5d904224d4d6fd1b4d99bd44c1d3896cda55e85284d2cc

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 == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return sorted(p)
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), 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
success-receipt contractNoneNonePassed
effect-order contract['create', 'rename', 'write1']['rename', 'write1', 'create']Failed
scope contract[{'document': 'd', 'transaction': 1}][{'document': 'd', 'transaction': 1}]Passed
description contractMove 1Move 1Passed
noop contractNoneNonePassed
merge-window contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 34dbcb704ebda7941b014c018e9d6885886b7e01978ed0fc06aba227b0de314d

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 == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), 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
success-receipt contractNoneNonePassed
effect-order contract['rename', 'write1', 'create']['rename', 'write1', 'create']Passed
scope contract[{'document': 'd', 'transaction': 1}][{'document': 'd', 'transaction': 1}]Passed
description contractMove 1Move 1Passed
noop contractNoneNonePassed
merge-window contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 79cdbebe599a468dd5d63fa2cf905ccc390178c52a3f69906590fa3d291526ba

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

Case digest / 80bbe13a33f5a5ed3d0d1ad6a21c369960179bc99efd1b231bcb865d0e7433b3