FAILURE MAP
← Case archive

FA-33086 / Menu interactions / Open access

Menu history merges identical commands from different context targets · case 01

Menu history merges identical commands from different context targets.

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

ROOT CAUSE

The menu-command-receipts model applies `p['command']==p['previous_command']` at its merge-window operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']` at merge-window.

Unsuccessful approach: The attempted repair `p['command']==p['previous_command'] and p['elapsed']<=p['window']` still violates the merge-window 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 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']
    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 contractTrueFalseFailed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / d55b5f8250e9501de57c34c4f5ad64819aa8d80461f925ae24e3c2dea6a76a01

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 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['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 contractTrueFalseFailed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / bb0077f70a33b3623bccba7b817c46cb42448ba9865e00cae1132f0f7df66fc0

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

Case digest / 63d79a7d6bbe4f94dbab6bf1822658b2251d81a9f9211254a3526e42fc001f3f