FAILURE MAP
← Case archive

FA-32596 / Menu interactions / Open access

Menu invocation arguments lose precedence to command defaults · case 01

Menu invocation arguments lose precedence to command defaults.

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

ROOT CAUSE

The command-routing model applies `dict(p['invocation'],**p['defaults'])` at its args operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `dict(p['defaults'],**p['invocation'])` at args.

Unsuccessful approach: The attempted repair `p['defaults']` still violates the args oracle.

Case contract

Menu dispatch resolves the nearest ancestor handler accepting the command, preserving a command origin distinct from the handler owner.

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 == 'nearest':
        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)
    if action == 'unsupported':
        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)
    if action == 'origin':
        return p['invocation_origin']
    if action == 'args':
        return dict(p['invocation'],**p['defaults'])
    if action == 'stop':
        return p['handled'] or p['cancelled']
    if action == 'result-owner':
        return {'command':p['command'],'handler':p['handler'],'origin':p['origin']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest contract', solve('nearest', {'command':'c'+str(N),'chain':[{'owner':'root','handles':['c'+str(N)]},{'owner':'child','handles':['c'+str(N)]}]}), 'child')
check('unsupported contract', solve('unsupported', {'command':'missing'+str(N),'chain':[{'owner':'root','handles':['a']},{'owner':'child','handles':['b']}]}), None)
check('origin contract', solve('origin', {'invocation_origin':'row'+str(N),'handler_owner':'panel','root_owner':'app'}), 'row'+str(N))
check('args contract', solve('args', {'defaults':{'count':1,'mode':'copy'},'invocation':{'count':N+1}}), {'count':N+1,'mode':'copy'})
check('stop contract', solve('stop', {'handled':False,'cancelled':True,'serial':N}), True)
check('result-owner contract', solve('result-owner', {'command':str(N),'handler':'app','origin':'context'}), {'command':str(N),'handler':'app','origin':'context'})
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
nearest contractchildchildPassed
unsupported contractNoneNonePassed
origin contractrow1row1Passed
args contract{'count': 1, 'mode': 'copy'}{'count': 2, 'mode': 'copy'}Failed
stop contractTrueTruePassed
result-owner contract{'command': '1', 'handler': 'app', 'origin': 'context'}{'command': '1', 'handler': 'app', 'origin': 'context'}Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 700bdd56771ebefb8450304af7678a0b188d65b20dd8c7a2c8daaf7a476efe70

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 == 'nearest':
        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)
    if action == 'unsupported':
        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)
    if action == 'origin':
        return p['invocation_origin']
    if action == 'args':
        return p['defaults']
    if action == 'stop':
        return p['handled'] or p['cancelled']
    if action == 'result-owner':
        return {'command':p['command'],'handler':p['handler'],'origin':p['origin']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest contract', solve('nearest', {'command':'c'+str(N),'chain':[{'owner':'root','handles':['c'+str(N)]},{'owner':'child','handles':['c'+str(N)]}]}), 'child')
check('unsupported contract', solve('unsupported', {'command':'missing'+str(N),'chain':[{'owner':'root','handles':['a']},{'owner':'child','handles':['b']}]}), None)
check('origin contract', solve('origin', {'invocation_origin':'row'+str(N),'handler_owner':'panel','root_owner':'app'}), 'row'+str(N))
check('args contract', solve('args', {'defaults':{'count':1,'mode':'copy'},'invocation':{'count':N+1}}), {'count':N+1,'mode':'copy'})
check('stop contract', solve('stop', {'handled':False,'cancelled':True,'serial':N}), True)
check('result-owner contract', solve('result-owner', {'command':str(N),'handler':'app','origin':'context'}), {'command':str(N),'handler':'app','origin':'context'})
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
nearest contractchildchildPassed
unsupported contractNoneNonePassed
origin contractrow1row1Passed
args contract{'count': 1, 'mode': 'copy'}{'count': 2, 'mode': 'copy'}Failed
stop contractTrueTruePassed
result-owner contract{'command': '1', 'handler': 'app', 'origin': 'context'}{'command': '1', 'handler': 'app', 'origin': 'context'}Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 67ba7df961f52a2a1dbd8cdcf22563fc4542907610ee24cf65fc1bda2a7e9d29

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 == 'nearest':
        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)
    if action == 'unsupported':
        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)
    if action == 'origin':
        return p['invocation_origin']
    if action == 'args':
        return dict(p['defaults'],**p['invocation'])
    if action == 'stop':
        return p['handled'] or p['cancelled']
    if action == 'result-owner':
        return {'command':p['command'],'handler':p['handler'],'origin':p['origin']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest contract', solve('nearest', {'command':'c'+str(N),'chain':[{'owner':'root','handles':['c'+str(N)]},{'owner':'child','handles':['c'+str(N)]}]}), 'child')
check('unsupported contract', solve('unsupported', {'command':'missing'+str(N),'chain':[{'owner':'root','handles':['a']},{'owner':'child','handles':['b']}]}), None)
check('origin contract', solve('origin', {'invocation_origin':'row'+str(N),'handler_owner':'panel','root_owner':'app'}), 'row'+str(N))
check('args contract', solve('args', {'defaults':{'count':1,'mode':'copy'},'invocation':{'count':N+1}}), {'count':N+1,'mode':'copy'})
check('stop contract', solve('stop', {'handled':False,'cancelled':True,'serial':N}), True)
check('result-owner contract', solve('result-owner', {'command':str(N),'handler':'app','origin':'context'}), {'command':str(N),'handler':'app','origin':'context'})
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
nearest contractchildchildPassed
unsupported contractNoneNonePassed
origin contractrow1row1Passed
args contract{'count': 2, 'mode': 'copy'}{'count': 2, 'mode': 'copy'}Passed
stop contractTrueTruePassed
result-owner contract{'command': '1', 'handler': 'app', 'origin': 'context'}{'command': '1', 'handler': 'app', 'origin': 'context'}Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / a074dadc309847fa86daf7c53729dc9f1d2f43608fa3d0e6829c711c5680dee8

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

Case digest / aa89118ef7bf6f853089f3034ea7d21c8028ef0d4fd602cfe984004ad65262fc