FAILURE MAP
← Case archive

FA-33766 / Menu interactions / Open access

Menu macro playback reorders semantically dependent commands · case 01

Menu macro playback reorders semantically dependent commands.

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

ROOT CAUSE

The menu-macro-recording model applies `list(reversed(p['steps']))` at its playback-order operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `p['steps']` at playback-order.

Unsuccessful approach: The attempted repair `sorted(p['steps'])` still violates the playback-order oracle.

Case contract

Menu command macros record successful semantic commands, omit private context data, preserve execution order and retain typed parameter bindings.

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 == 'semantic':
        return {'command':p['command'],'arguments':p['arguments']}
    if action == 'failed':
        return p['macro'] if not p['success'] else p['macro']+[p['entry']]
    if action == 'private-args':
        return {k:v for k,v in p['args'].items() if k not in p['private']}
    if action == 'playback-order':
        return list(reversed(p['steps']))
    if action == 'recording-playback':
        return p['recording'] and not p['replaying']
    if action == 'typed-parameters':
        return p['args']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('semantic contract', solve('semantic', {'command':'resize','arguments':{'size':N},'row':'row-7','label':'Resize'}), {'command':'resize','arguments':{'size':N}})
check('failed contract', solve('failed', {'macro':[N],'entry':N+1,'success':False}), [N])
check('private-args contract', solve('private-args', {'args':{'size':N,'document_token':'private'},'private':['document_token']}), {'size':N})
check('playback-order contract', solve('playback-order', {'steps':['create','write'+str(N),'close']}), ['create','write'+str(N),'close'])
check('recording-playback contract', solve('recording-playback', {'recording':True,'replaying':True,'step':N}), False)
check('typed-parameters contract', solve('typed-parameters', {'args':{'count':N+1,'enabled':False}}), {'count':N+1,'enabled':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
semantic contract{'arguments': {'size': 1}, 'command': 'resize'}{'arguments': {'size': 1}, 'command': 'resize'}Passed
failed contract[1][1]Passed
private-args contract{'size': 1}{'size': 1}Passed
playback-order contract['close', 'write1', 'create']['create', 'write1', 'close']Failed
recording-playback contractFalseFalsePassed
typed-parameters contract{'count': 2, 'enabled': False}{'count': 2, 'enabled': False}Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / fd8b1fed6fae7edaa6e3f85fdca6824a87af2788380f71dcb96000ef2b05ed5e

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 == 'semantic':
        return {'command':p['command'],'arguments':p['arguments']}
    if action == 'failed':
        return p['macro'] if not p['success'] else p['macro']+[p['entry']]
    if action == 'private-args':
        return {k:v for k,v in p['args'].items() if k not in p['private']}
    if action == 'playback-order':
        return sorted(p['steps'])
    if action == 'recording-playback':
        return p['recording'] and not p['replaying']
    if action == 'typed-parameters':
        return p['args']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('semantic contract', solve('semantic', {'command':'resize','arguments':{'size':N},'row':'row-7','label':'Resize'}), {'command':'resize','arguments':{'size':N}})
check('failed contract', solve('failed', {'macro':[N],'entry':N+1,'success':False}), [N])
check('private-args contract', solve('private-args', {'args':{'size':N,'document_token':'private'},'private':['document_token']}), {'size':N})
check('playback-order contract', solve('playback-order', {'steps':['create','write'+str(N),'close']}), ['create','write'+str(N),'close'])
check('recording-playback contract', solve('recording-playback', {'recording':True,'replaying':True,'step':N}), False)
check('typed-parameters contract', solve('typed-parameters', {'args':{'count':N+1,'enabled':False}}), {'count':N+1,'enabled':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
semantic contract{'arguments': {'size': 1}, 'command': 'resize'}{'arguments': {'size': 1}, 'command': 'resize'}Passed
failed contract[1][1]Passed
private-args contract{'size': 1}{'size': 1}Passed
playback-order contract['close', 'create', 'write1']['create', 'write1', 'close']Failed
recording-playback contractFalseFalsePassed
typed-parameters contract{'count': 2, 'enabled': False}{'count': 2, 'enabled': False}Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / b3281afa2e7ecb0ac4375bc43925b03ca20a74befd5475439b7cef44dfda0c01

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 == 'semantic':
        return {'command':p['command'],'arguments':p['arguments']}
    if action == 'failed':
        return p['macro'] if not p['success'] else p['macro']+[p['entry']]
    if action == 'private-args':
        return {k:v for k,v in p['args'].items() if k not in p['private']}
    if action == 'playback-order':
        return p['steps']
    if action == 'recording-playback':
        return p['recording'] and not p['replaying']
    if action == 'typed-parameters':
        return p['args']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('semantic contract', solve('semantic', {'command':'resize','arguments':{'size':N},'row':'row-7','label':'Resize'}), {'command':'resize','arguments':{'size':N}})
check('failed contract', solve('failed', {'macro':[N],'entry':N+1,'success':False}), [N])
check('private-args contract', solve('private-args', {'args':{'size':N,'document_token':'private'},'private':['document_token']}), {'size':N})
check('playback-order contract', solve('playback-order', {'steps':['create','write'+str(N),'close']}), ['create','write'+str(N),'close'])
check('recording-playback contract', solve('recording-playback', {'recording':True,'replaying':True,'step':N}), False)
check('typed-parameters contract', solve('typed-parameters', {'args':{'count':N+1,'enabled':False}}), {'count':N+1,'enabled':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
semantic contract{'arguments': {'size': 1}, 'command': 'resize'}{'arguments': {'size': 1}, 'command': 'resize'}Passed
failed contract[1][1]Passed
private-args contract{'size': 1}{'size': 1}Passed
playback-order contract['create', 'write1', 'close']['create', 'write1', 'close']Passed
recording-playback contractFalseFalsePassed
typed-parameters contract{'count': 2, 'enabled': False}{'count': 2, 'enabled': False}Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 8ec8c51dfb89b775344110c6b7fc32f03b51438858314d916f76855edbffd8ed

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

Case digest / 068896ce90974a6325832f30c627bc46752516831330ba1fd89d2a9decddc6f6