FA-32361 / Menu interactions / Open access
Repeated local IDs route to the wrong menu branch · case 01
Repeated local IDs route to the wrong menu branch.
ROOT CAUSE
The command-address model applies `next((x['command'] for x in p['rows'] if x['path'][-1]==p['path'][-1]),None)` at its resolve operation instead of the stipulated transformation.
VERIFIED REPAIR
Apply `next((x['command'] for x in p['rows'] if x['path']==p['path']),None)` at resolve.
Unsuccessful approach: The attempted repair `next((x['command'] for x in p['rows'] if x['path'][0]==p['path'][0]),None)` still violates the resolve oracle.
Case contract
Stable menu paths retain ancestry and available owners; separator encoding is unambiguous and resolution is exact.
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 == 'encode':
return '/'.join(x.replace('~','~0').replace('/','~1') for x in p)
if action == 'ancestor-availability':
return all(x['available'] for x in p['owners']) and p['command_available']
if action == 'parent':
return p[:-1]
if action == 'descendant':
return p['candidate'][:len(p['root'])]==p['root'] and len(p['candidate'])>len(p['root'])
if action == 'resolve':
return next((x['command'] for x in p['rows'] if x['path'][-1]==p['path'][-1]),None)
if action == 'reroot':
return [p['new']]+p['path'][1:]
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('encode contract', solve('encode', ['r~'+str(N),'a/b']), 'r~0'+str(N)+'/a~1b')
check('ancestor-availability contract', solve('ancestor-availability', {'owners':[{'available':True,'id':N},{'available':False,'id':N+1}],'command_available':True}), False)
check('parent contract', solve('parent', ['r','a','b'+str(N)]), ['r','a'])
check('descendant contract', solve('descendant', {'root':['r','a'],'candidate':['r','b',str(N)]}), False)
check('resolve contract', solve('resolve', {'rows':[{'path':['r','a',str(N)],'command':'wrong'},{'path':['r','b',str(N)],'command':'right'}],'path':['r','b',str(N)]}), 'right')
check('reroot contract', solve('reroot', {'new':'new'+str(N),'path':['old','tools','run']}), ['new'+str(N),'tools','run'])
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 |
|---|---|---|---|
| encode contract | r~01/a~1b | r~01/a~1b | Passed |
| ancestor-availability contract | False | False | Passed |
| parent contract | ['r', 'a'] | ['r', 'a'] | Passed |
| descendant contract | False | False | Passed |
| resolve contract | wrong | right | Failed |
| reroot contract | ['new1', 'tools', 'run'] | ['new1', 'tools', 'run'] | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 2f2bc38f96ebdf6343c68bfd7ed09fd54f582b9cc659085eece59b5ef488b3b9
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 == 'encode':
return '/'.join(x.replace('~','~0').replace('/','~1') for x in p)
if action == 'ancestor-availability':
return all(x['available'] for x in p['owners']) and p['command_available']
if action == 'parent':
return p[:-1]
if action == 'descendant':
return p['candidate'][:len(p['root'])]==p['root'] and len(p['candidate'])>len(p['root'])
if action == 'resolve':
return next((x['command'] for x in p['rows'] if x['path'][0]==p['path'][0]),None)
if action == 'reroot':
return [p['new']]+p['path'][1:]
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('encode contract', solve('encode', ['r~'+str(N),'a/b']), 'r~0'+str(N)+'/a~1b')
check('ancestor-availability contract', solve('ancestor-availability', {'owners':[{'available':True,'id':N},{'available':False,'id':N+1}],'command_available':True}), False)
check('parent contract', solve('parent', ['r','a','b'+str(N)]), ['r','a'])
check('descendant contract', solve('descendant', {'root':['r','a'],'candidate':['r','b',str(N)]}), False)
check('resolve contract', solve('resolve', {'rows':[{'path':['r','a',str(N)],'command':'wrong'},{'path':['r','b',str(N)],'command':'right'}],'path':['r','b',str(N)]}), 'right')
check('reroot contract', solve('reroot', {'new':'new'+str(N),'path':['old','tools','run']}), ['new'+str(N),'tools','run'])
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 |
|---|---|---|---|
| encode contract | r~01/a~1b | r~01/a~1b | Passed |
| ancestor-availability contract | False | False | Passed |
| parent contract | ['r', 'a'] | ['r', 'a'] | Passed |
| descendant contract | False | False | Passed |
| resolve contract | wrong | right | Failed |
| reroot contract | ['new1', 'tools', 'run'] | ['new1', 'tools', 'run'] | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / b8db6adc17f902a90f02efaf9a47c66327d6816a047f36ada00761fcabc12d12
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 == 'encode':
return '/'.join(x.replace('~','~0').replace('/','~1') for x in p)
if action == 'ancestor-availability':
return all(x['available'] for x in p['owners']) and p['command_available']
if action == 'parent':
return p[:-1]
if action == 'descendant':
return p['candidate'][:len(p['root'])]==p['root'] and len(p['candidate'])>len(p['root'])
if action == 'resolve':
return next((x['command'] for x in p['rows'] if x['path']==p['path']),None)
if action == 'reroot':
return [p['new']]+p['path'][1:]
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('encode contract', solve('encode', ['r~'+str(N),'a/b']), 'r~0'+str(N)+'/a~1b')
check('ancestor-availability contract', solve('ancestor-availability', {'owners':[{'available':True,'id':N},{'available':False,'id':N+1}],'command_available':True}), False)
check('parent contract', solve('parent', ['r','a','b'+str(N)]), ['r','a'])
check('descendant contract', solve('descendant', {'root':['r','a'],'candidate':['r','b',str(N)]}), False)
check('resolve contract', solve('resolve', {'rows':[{'path':['r','a',str(N)],'command':'wrong'},{'path':['r','b',str(N)],'command':'right'}],'path':['r','b',str(N)]}), 'right')
check('reroot contract', solve('reroot', {'new':'new'+str(N),'path':['old','tools','run']}), ['new'+str(N),'tools','run'])
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 |
|---|---|---|---|
| encode contract | r~01/a~1b | r~01/a~1b | Passed |
| ancestor-availability contract | False | False | Passed |
| parent contract | ['r', 'a'] | ['r', 'a'] | Passed |
| descendant contract | False | False | Passed |
| resolve contract | right | right | Passed |
| reroot contract | ['new1', 'tools', 'run'] | ['new1', 'tools', 'run'] | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 7b36aeb56c772b1d76e560448cc396d853ad494ad307ca5bd0d6e4e9ad1f05a2
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:11.486189+00:00.
Case digest / fecaa10f7491e05b0d48fd7b8006ee648d84181bcc19409eae3e1578d0a7eca4