FA-32746 / Menu interactions / Open access
Cascade root identity is replaced by its nearest parent · case 01
Cascade root identity is replaced by its nearest parent.
ROOT CAUSE
The menu-surface-stack model applies `p['id']` at its root-of operation instead of the stipulated transformation.
VERIFIED REPAIR
Apply `p['ancestors'][0] if p['ancestors'] else p['id']` at root-of.
Unsuccessful approach: The attempted repair `p['ancestors'][-1] if p['ancestors'] else p['id']` still violates the root-of oracle.
Case contract
Menu surfaces form an ownership stack independent of document overlays; operations preserve unrelated roots and remove owned descendants.
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 == 'top':
return p[-1] if p else None
if action == 'raise':
return [x for x in p['stack'] if x!=p['id']]+[p['id']]
if action == 'remove-subtree':
return [x for x in p['stack'] if p['owner'] not in x['ancestors'] and x['id']!=p['owner']]
if action == 'root-of':
return p['id']
if action == 'depth-z':
return p['base']+p['depth']*p['stride']
if action == 'detach':
return [dict(x,parent=None) if x['parent']==p['removed'] else x for x in p['rows']]
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('top contract', solve('top', ['root','child'+str(N)]), 'child'+str(N))
check('raise contract', solve('raise', {'stack':['a','b'+str(N)],'id':'a'}), ['b'+str(N),'a'])
check('remove-subtree contract', solve('remove-subtree', {'owner':'a','stack':[{'id':'a','ancestors':[]},{'id':'b','ancestors':['a']},{'id':N,'ancestors':[]}]}), [{'id':N,'ancestors':[]}])
check('root-of contract', solve('root-of', {'id':N,'ancestors':['r','a']}), 'r')
check('depth-z contract', solve('depth-z', {'base':100,'depth':N+1,'stride':4}), 100+(N+1)*4)
check('detach contract', solve('detach', {'removed':'host','rows':[{'id':N,'parent':'host'},{'id':N+1,'parent':'other'}]}), [{'id':N,'parent':None},{'id':N+1,'parent':'other'}])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| top contract | child1 | child1 | Passed |
| raise contract | ['b1', 'a'] | ['b1', 'a'] | Passed |
| remove-subtree contract | [{'ancestors': [], 'id': 1}] | [{'ancestors': [], 'id': 1}] | Passed |
| root-of contract | 1 | r | Failed |
| depth-z contract | 108 | 108 | Passed |
| detach contract | [{'id': 1, 'parent': None}, {'id': 2, 'parent': 'other'}] | [{'id': 1, 'parent': None}, {'id': 2, 'parent': 'other'}] | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 8ad5be402e42d14c30a3028c11edc74f2d66ca55921e8a2140b98061afadf638
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 == 'top':
return p[-1] if p else None
if action == 'raise':
return [x for x in p['stack'] if x!=p['id']]+[p['id']]
if action == 'remove-subtree':
return [x for x in p['stack'] if p['owner'] not in x['ancestors'] and x['id']!=p['owner']]
if action == 'root-of':
return p['ancestors'][-1] if p['ancestors'] else p['id']
if action == 'depth-z':
return p['base']+p['depth']*p['stride']
if action == 'detach':
return [dict(x,parent=None) if x['parent']==p['removed'] else x for x in p['rows']]
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('top contract', solve('top', ['root','child'+str(N)]), 'child'+str(N))
check('raise contract', solve('raise', {'stack':['a','b'+str(N)],'id':'a'}), ['b'+str(N),'a'])
check('remove-subtree contract', solve('remove-subtree', {'owner':'a','stack':[{'id':'a','ancestors':[]},{'id':'b','ancestors':['a']},{'id':N,'ancestors':[]}]}), [{'id':N,'ancestors':[]}])
check('root-of contract', solve('root-of', {'id':N,'ancestors':['r','a']}), 'r')
check('depth-z contract', solve('depth-z', {'base':100,'depth':N+1,'stride':4}), 100+(N+1)*4)
check('detach contract', solve('detach', {'removed':'host','rows':[{'id':N,'parent':'host'},{'id':N+1,'parent':'other'}]}), [{'id':N,'parent':None},{'id':N+1,'parent':'other'}])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| top contract | child1 | child1 | Passed |
| raise contract | ['b1', 'a'] | ['b1', 'a'] | Passed |
| remove-subtree contract | [{'ancestors': [], 'id': 1}] | [{'ancestors': [], 'id': 1}] | Passed |
| root-of contract | a | r | Failed |
| depth-z contract | 108 | 108 | Passed |
| detach contract | [{'id': 1, 'parent': None}, {'id': 2, 'parent': 'other'}] | [{'id': 1, 'parent': None}, {'id': 2, 'parent': 'other'}] | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 29670d2e4aa31f082154d960e45a392abd5bbb9b7d926f0868f3752c69f85196
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 == 'top':
return p[-1] if p else None
if action == 'raise':
return [x for x in p['stack'] if x!=p['id']]+[p['id']]
if action == 'remove-subtree':
return [x for x in p['stack'] if p['owner'] not in x['ancestors'] and x['id']!=p['owner']]
if action == 'root-of':
return p['ancestors'][0] if p['ancestors'] else p['id']
if action == 'depth-z':
return p['base']+p['depth']*p['stride']
if action == 'detach':
return [dict(x,parent=None) if x['parent']==p['removed'] else x for x in p['rows']]
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('top contract', solve('top', ['root','child'+str(N)]), 'child'+str(N))
check('raise contract', solve('raise', {'stack':['a','b'+str(N)],'id':'a'}), ['b'+str(N),'a'])
check('remove-subtree contract', solve('remove-subtree', {'owner':'a','stack':[{'id':'a','ancestors':[]},{'id':'b','ancestors':['a']},{'id':N,'ancestors':[]}]}), [{'id':N,'ancestors':[]}])
check('root-of contract', solve('root-of', {'id':N,'ancestors':['r','a']}), 'r')
check('depth-z contract', solve('depth-z', {'base':100,'depth':N+1,'stride':4}), 100+(N+1)*4)
check('detach contract', solve('detach', {'removed':'host','rows':[{'id':N,'parent':'host'},{'id':N+1,'parent':'other'}]}), [{'id':N,'parent':None},{'id':N+1,'parent':'other'}])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| top contract | child1 | child1 | Passed |
| raise contract | ['b1', 'a'] | ['b1', 'a'] | Passed |
| remove-subtree contract | [{'ancestors': [], 'id': 1}] | [{'ancestors': [], 'id': 1}] | Passed |
| root-of contract | r | r | Passed |
| depth-z contract | 108 | 108 | Passed |
| detach contract | [{'id': 1, 'parent': None}, {'id': 2, 'parent': 'other'}] | [{'id': 1, 'parent': None}, {'id': 2, 'parent': 'other'}] | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 929b850081b3c1929ec00f0ba904a5617c2e02cc0b1bec3bb4c79bf628dd8e85
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:15.284317+00:00.
Case digest / 9c2a65eeb46f292c40d31371cb1054b164b2d9ac84e3488ca27964a095a753bf