{"abstract":"Command origin is rewritten while bubbling through menu owners.","category":"Menu interactions","checks":7,"contract":"Menu dispatch resolves the nearest ancestor handler accepting the command, preserving a command origin distinct from the handler owner.","evaluation_group":"s3-menu-interactions-command-routing","failed_approach":"The attempted repair `p['root_owner']` still violates the origin oracle.","family":"s3-menu-interactions-command-routing-origin","id":"FA-32591","implementations":{"attempt":{"sha256":"adfe1655f16170a4174bbef2b828b08c31651636363c09fb22a4072cc07a6b4e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport unicodedata\nN = 1\nobservations = []\ndef solve(action, p):\n    if action == 'nearest':\n        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)\n    if action == 'unsupported':\n        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)\n    if action == 'origin':\n        return p['root_owner']\n    if action == 'args':\n        return dict(p['defaults'],**p['invocation'])\n    if action == 'stop':\n        return p['handled'] or p['cancelled']\n    if action == 'result-owner':\n        return {'command':p['command'],'handler':p['handler'],'origin':p['origin']}\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('nearest contract', solve('nearest', {'command':'c'+str(N),'chain':[{'owner':'root','handles':['c'+str(N)]},{'owner':'child','handles':['c'+str(N)]}]}), 'child')\ncheck('unsupported contract', solve('unsupported', {'command':'missing'+str(N),'chain':[{'owner':'root','handles':['a']},{'owner':'child','handles':['b']}]}), None)\ncheck('origin contract', solve('origin', {'invocation_origin':'row'+str(N),'handler_owner':'panel','root_owner':'app'}), 'row'+str(N))\ncheck('args contract', solve('args', {'defaults':{'count':1,'mode':'copy'},'invocation':{'count':N+1}}), {'count':N+1,'mode':'copy'})\ncheck('stop contract', solve('stop', {'handled':False,'cancelled':True,'serial':N}), True)\ncheck('result-owner contract', solve('result-owner', {'command':str(N),'handler':'app','origin':'context'}), {'command':str(N),'handler':'app','origin':'context'})\ncheck('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"72841b944c3d21c713a99bc025360d355525fdcd117216fd7341c34cf214bb23","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport unicodedata\nN = 1\nobservations = []\ndef solve(action, p):\n    if action == 'nearest':\n        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)\n    if action == 'unsupported':\n        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)\n    if action == 'origin':\n        return p['handler_owner']\n    if action == 'args':\n        return dict(p['defaults'],**p['invocation'])\n    if action == 'stop':\n        return p['handled'] or p['cancelled']\n    if action == 'result-owner':\n        return {'command':p['command'],'handler':p['handler'],'origin':p['origin']}\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('nearest contract', solve('nearest', {'command':'c'+str(N),'chain':[{'owner':'root','handles':['c'+str(N)]},{'owner':'child','handles':['c'+str(N)]}]}), 'child')\ncheck('unsupported contract', solve('unsupported', {'command':'missing'+str(N),'chain':[{'owner':'root','handles':['a']},{'owner':'child','handles':['b']}]}), None)\ncheck('origin contract', solve('origin', {'invocation_origin':'row'+str(N),'handler_owner':'panel','root_owner':'app'}), 'row'+str(N))\ncheck('args contract', solve('args', {'defaults':{'count':1,'mode':'copy'},'invocation':{'count':N+1}}), {'count':N+1,'mode':'copy'})\ncheck('stop contract', solve('stop', {'handled':False,'cancelled':True,'serial':N}), True)\ncheck('result-owner contract', solve('result-owner', {'command':str(N),'handler':'app','origin':'context'}), {'command':str(N),'handler':'app','origin':'context'})\ncheck('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"a074dadc309847fa86daf7c53729dc9f1d2f43608fa3d0e6829c711c5680dee8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport unicodedata\nN = 1\nobservations = []\ndef solve(action, p):\n    if action == 'nearest':\n        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)\n    if action == 'unsupported':\n        return next((x['owner'] for x in reversed(p['chain']) if p['command'] in x['handles']),None)\n    if action == 'origin':\n        return p['invocation_origin']\n    if action == 'args':\n        return dict(p['defaults'],**p['invocation'])\n    if action == 'stop':\n        return p['handled'] or p['cancelled']\n    if action == 'result-owner':\n        return {'command':p['command'],'handler':p['handler'],'origin':p['origin']}\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('nearest contract', solve('nearest', {'command':'c'+str(N),'chain':[{'owner':'root','handles':['c'+str(N)]},{'owner':'child','handles':['c'+str(N)]}]}), 'child')\ncheck('unsupported contract', solve('unsupported', {'command':'missing'+str(N),'chain':[{'owner':'root','handles':['a']},{'owner':'child','handles':['b']}]}), None)\ncheck('origin contract', solve('origin', {'invocation_origin':'row'+str(N),'handler_owner':'panel','root_owner':'app'}), 'row'+str(N))\ncheck('args contract', solve('args', {'defaults':{'count':1,'mode':'copy'},'invocation':{'count':N+1}}), {'count':N+1,'mode':'copy'})\ncheck('stop contract', solve('stop', {'handled':False,'cancelled':True,'serial':N}), True)\ncheck('result-owner contract', solve('result-owner', {'command':str(N),'handler':'app','origin':'context'}), {'command':str(N),'handler':'app','origin':'context'})\ncheck('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-menu-interactions-command-routing-origin","generated_at":"2026-09-29T14:42:13.765773+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Cascading and context menus require coherent command and session state as content changes.","repair":"Apply `p['invocation_origin']` at origin.","root_cause":"The command-routing model applies `p['handler_owner']` at its origin operation instead of the stipulated transformation.","sha256":"3f9170a558d19d92e6062760b573617eb16298c9b459b87973184a2e9437bd47","title":"Command origin is rewritten while bubbling through menu owners · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.531,"exit_code":1,"observations":[{"actual":"child","check":"nearest contract","expected":"child","passed":true},{"actual":null,"check":"unsupported contract","expected":null,"passed":true},{"actual":"app","check":"origin contract","expected":"row1","passed":false},{"actual":{"count":2,"mode":"copy"},"check":"args contract","expected":{"count":2,"mode":"copy"},"passed":true},{"actual":true,"check":"stop contract","expected":true,"passed":true},{"actual":{"command":"1","handler":"app","origin":"context"},"check":"result-owner contract","expected":{"command":"1","handler":"app","origin":"context"},"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nearest contract\", \"actual\": \"child\", \"expected\": \"child\", \"passed\": true}, {\"check\": \"unsupported contract\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"origin contract\", \"actual\": \"app\", \"expected\": \"row1\", \"passed\": false}, {\"check\": \"args contract\", \"actual\": {\"count\": 2, \"mode\": \"copy\"}, \"expected\": {\"count\": 2, \"mode\": \"copy\"}, \"passed\": true}, {\"check\": \"stop contract\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"result-owner contract\", \"actual\": {\"command\": \"1\", \"handler\": \"app\", \"origin\": \"context\"}, \"expected\": {\"command\": \"1\", \"handler\": \"app\", \"origin\": \"context\"}, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.807,"exit_code":1,"observations":[{"actual":"child","check":"nearest contract","expected":"child","passed":true},{"actual":null,"check":"unsupported contract","expected":null,"passed":true},{"actual":"panel","check":"origin contract","expected":"row1","passed":false},{"actual":{"count":2,"mode":"copy"},"check":"args contract","expected":{"count":2,"mode":"copy"},"passed":true},{"actual":true,"check":"stop contract","expected":true,"passed":true},{"actual":{"command":"1","handler":"app","origin":"context"},"check":"result-owner contract","expected":{"command":"1","handler":"app","origin":"context"},"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nearest contract\", \"actual\": \"child\", \"expected\": \"child\", \"passed\": true}, {\"check\": \"unsupported contract\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"origin contract\", \"actual\": \"panel\", \"expected\": \"row1\", \"passed\": false}, {\"check\": \"args contract\", \"actual\": {\"count\": 2, \"mode\": \"copy\"}, \"expected\": {\"count\": 2, \"mode\": \"copy\"}, \"passed\": true}, {\"check\": \"stop contract\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"result-owner contract\", \"actual\": {\"command\": \"1\", \"handler\": \"app\", \"origin\": \"context\"}, \"expected\": {\"command\": \"1\", \"handler\": \"app\", \"origin\": \"context\"}, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.929,"exit_code":0,"observations":[{"actual":"child","check":"nearest contract","expected":"child","passed":true},{"actual":null,"check":"unsupported contract","expected":null,"passed":true},{"actual":"row1","check":"origin contract","expected":"row1","passed":true},{"actual":{"count":2,"mode":"copy"},"check":"args contract","expected":{"count":2,"mode":"copy"},"passed":true},{"actual":true,"check":"stop contract","expected":true,"passed":true},{"actual":{"command":"1","handler":"app","origin":"context"},"check":"result-owner contract","expected":{"command":"1","handler":"app","origin":"context"},"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nearest contract\", \"actual\": \"child\", \"expected\": \"child\", \"passed\": true}, {\"check\": \"unsupported contract\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"origin contract\", \"actual\": \"row1\", \"expected\": \"row1\", \"passed\": true}, {\"check\": \"args contract\", \"actual\": {\"count\": 2, \"mode\": \"copy\"}, \"expected\": {\"count\": 2, \"mode\": \"copy\"}, \"passed\": true}, {\"check\": \"stop contract\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"result-owner contract\", \"actual\": {\"command\": \"1\", \"handler\": \"app\", \"origin\": \"context\"}, \"expected\": {\"command\": \"1\", \"handler\": \"app\", \"origin\": \"context\"}, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}