FAILURE MAP
← Case archive

FA-32606 / Menu interactions / Open access

Menu command result conflates execution owner and invocation origin · case 01

Menu command result conflates execution owner and invocation origin.

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

ROOT CAUSE

The command-routing model applies `{'command':p['command'],'handler':p['origin'],'origin':p['origin']}` at its result-owner operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `{'command':p['command'],'handler':p['handler'],'origin':p['origin']}` at result-owner.

Unsuccessful approach: The attempted repair `{'command':p['command'],'handler':p['handler'],'origin':p['handler']}` still violates the result-owner 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['defaults'],**p['invocation'])
    if action == 'stop':
        return p['handled'] or p['cancelled']
    if action == 'result-owner':
        return {'command':p['command'],'handler':p['origin'],'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': 'context', 'origin': 'context'}{'command': '1', 'handler': 'app', 'origin': 'context'}Failed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 42b8b37e554e627456396e882a54036ec15a50907f031fd18fbb8c490e1fa9fc

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 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['handler']}
    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': 'app'}{'command': '1', 'handler': 'app', 'origin': 'context'}Failed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 7b45339549cfef04cf7df09a1f8e85aec596c8b3bb6b8fa831c2c14f0862a576

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

Case digest / bc2b477574f86beefe3c0eb31ca4782205e7908792223765aabc1cd073136189