FAILURE MAP
← Case archive

FA-32751 / Menu interactions / Open access

Nested menu surface levels ignore the reserved z-order stride · case 01

Nested menu surface levels ignore the reserved z-order stride.

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

ROOT CAUSE

The menu-surface-stack model applies `p['base']+p['depth']` at its depth-z operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `p['base']+p['depth']*p['stride']` at depth-z.

Unsuccessful approach: The attempted repair `p['base']+p['stride']` still violates the depth-z 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['ancestors'][0] if p['ancestors'] else p['id']
    if action == 'depth-z':
        return p['base']+p['depth']
    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 fixtureActualExpectedOutcome
top contractchild1child1Passed
raise contract['b1', 'a']['b1', 'a']Passed
remove-subtree contract[{'ancestors': [], 'id': 1}][{'ancestors': [], 'id': 1}]Passed
root-of contractrrPassed
depth-z contract102108Failed
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 / 8ec91c08349213a63b0c866b1a9ac78fb9d7a5f9db1eee692c9b13da29b82508

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'][0] if p['ancestors'] else p['id']
    if action == 'depth-z':
        return p['base']+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 fixtureActualExpectedOutcome
top contractchild1child1Passed
raise contract['b1', 'a']['b1', 'a']Passed
remove-subtree contract[{'ancestors': [], 'id': 1}][{'ancestors': [], 'id': 1}]Passed
root-of contractrrPassed
depth-z contract104108Failed
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 / 11cd11d0027687d364f61eb9b13f41b54093dd5c72a1e4ae72a4aeec6b633459

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 fixtureActualExpectedOutcome
top contractchild1child1Passed
raise contract['b1', 'a']['b1', 'a']Passed
remove-subtree contract[{'ancestors': [], 'id': 1}][{'ancestors': [], 'id': 1}]Passed
root-of contractrrPassed
depth-z contract108108Passed
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.302796+00:00.

Case digest / ab6e66d463d366a8b5c953b53fa7d10f420ea23d812bff5c3a0847aa2443e08a