{"abstract":"Nested menu surface levels ignore the reserved z-order stride.","category":"Menu interactions","checks":7,"contract":"Menu surfaces form an ownership stack independent of document overlays; operations preserve unrelated roots and remove owned descendants.","evaluation_group":"s3-menu-interactions-menu-surface-stack","failed_approach":"The attempted repair `p['base']+p['stride']` still violates the depth-z oracle.","family":"s3-menu-interactions-menu-surface-stack-depth-z","id":"FA-32751","implementations":{"attempt":{"sha256":"11cd11d0027687d364f61eb9b13f41b54093dd5c72a1e4ae72a4aeec6b633459","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 == 'top':\n        return p[-1] if p else None\n    if action == 'raise':\n        return [x for x in p['stack'] if x!=p['id']]+[p['id']]\n    if action == 'remove-subtree':\n        return [x for x in p['stack'] if p['owner'] not in x['ancestors'] and x['id']!=p['owner']]\n    if action == 'root-of':\n        return p['ancestors'][0] if p['ancestors'] else p['id']\n    if action == 'depth-z':\n        return p['base']+p['stride']\n    if action == 'detach':\n        return [dict(x,parent=None) if x['parent']==p['removed'] else x for x in p['rows']]\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('top contract', solve('top', ['root','child'+str(N)]), 'child'+str(N))\ncheck('raise contract', solve('raise', {'stack':['a','b'+str(N)],'id':'a'}), ['b'+str(N),'a'])\ncheck('remove-subtree contract', solve('remove-subtree', {'owner':'a','stack':[{'id':'a','ancestors':[]},{'id':'b','ancestors':['a']},{'id':N,'ancestors':[]}]}), [{'id':N,'ancestors':[]}])\ncheck('root-of contract', solve('root-of', {'id':N,'ancestors':['r','a']}), 'r')\ncheck('depth-z contract', solve('depth-z', {'base':100,'depth':N+1,'stride':4}), 100+(N+1)*4)\ncheck('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'}])\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":"8ec91c08349213a63b0c866b1a9ac78fb9d7a5f9db1eee692c9b13da29b82508","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 == 'top':\n        return p[-1] if p else None\n    if action == 'raise':\n        return [x for x in p['stack'] if x!=p['id']]+[p['id']]\n    if action == 'remove-subtree':\n        return [x for x in p['stack'] if p['owner'] not in x['ancestors'] and x['id']!=p['owner']]\n    if action == 'root-of':\n        return p['ancestors'][0] if p['ancestors'] else p['id']\n    if action == 'depth-z':\n        return p['base']+p['depth']\n    if action == 'detach':\n        return [dict(x,parent=None) if x['parent']==p['removed'] else x for x in p['rows']]\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('top contract', solve('top', ['root','child'+str(N)]), 'child'+str(N))\ncheck('raise contract', solve('raise', {'stack':['a','b'+str(N)],'id':'a'}), ['b'+str(N),'a'])\ncheck('remove-subtree contract', solve('remove-subtree', {'owner':'a','stack':[{'id':'a','ancestors':[]},{'id':'b','ancestors':['a']},{'id':N,'ancestors':[]}]}), [{'id':N,'ancestors':[]}])\ncheck('root-of contract', solve('root-of', {'id':N,'ancestors':['r','a']}), 'r')\ncheck('depth-z contract', solve('depth-z', {'base':100,'depth':N+1,'stride':4}), 100+(N+1)*4)\ncheck('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'}])\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":"929b850081b3c1929ec00f0ba904a5617c2e02cc0b1bec3bb4c79bf628dd8e85","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 == 'top':\n        return p[-1] if p else None\n    if action == 'raise':\n        return [x for x in p['stack'] if x!=p['id']]+[p['id']]\n    if action == 'remove-subtree':\n        return [x for x in p['stack'] if p['owner'] not in x['ancestors'] and x['id']!=p['owner']]\n    if action == 'root-of':\n        return p['ancestors'][0] if p['ancestors'] else p['id']\n    if action == 'depth-z':\n        return p['base']+p['depth']*p['stride']\n    if action == 'detach':\n        return [dict(x,parent=None) if x['parent']==p['removed'] else x for x in p['rows']]\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('top contract', solve('top', ['root','child'+str(N)]), 'child'+str(N))\ncheck('raise contract', solve('raise', {'stack':['a','b'+str(N)],'id':'a'}), ['b'+str(N),'a'])\ncheck('remove-subtree contract', solve('remove-subtree', {'owner':'a','stack':[{'id':'a','ancestors':[]},{'id':'b','ancestors':['a']},{'id':N,'ancestors':[]}]}), [{'id':N,'ancestors':[]}])\ncheck('root-of contract', solve('root-of', {'id':N,'ancestors':['r','a']}), 'r')\ncheck('depth-z contract', solve('depth-z', {'base':100,'depth':N+1,'stride':4}), 100+(N+1)*4)\ncheck('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'}])\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-menu-surface-stack-depth-z","generated_at":"2026-09-29T14:42:15.302796+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['base']+p['depth']*p['stride']` at depth-z.","root_cause":"The menu-surface-stack model applies `p['base']+p['depth']` at its depth-z operation instead of the stipulated transformation.","sha256":"ab6e66d463d366a8b5c953b53fa7d10f420ea23d812bff5c3a0847aa2443e08a","title":"Nested menu surface levels ignore the reserved z-order stride · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":47.245,"exit_code":1,"observations":[{"actual":"child1","check":"top contract","expected":"child1","passed":true},{"actual":["b1","a"],"check":"raise contract","expected":["b1","a"],"passed":true},{"actual":[{"ancestors":[],"id":1}],"check":"remove-subtree contract","expected":[{"ancestors":[],"id":1}],"passed":true},{"actual":"r","check":"root-of contract","expected":"r","passed":true},{"actual":104,"check":"depth-z contract","expected":108,"passed":false},{"actual":[{"id":1,"parent":null},{"id":2,"parent":"other"}],"check":"detach contract","expected":[{"id":1,"parent":null},{"id":2,"parent":"other"}],"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"top contract\", \"actual\": \"child1\", \"expected\": \"child1\", \"passed\": true}, {\"check\": \"raise contract\", \"actual\": [\"b1\", \"a\"], \"expected\": [\"b1\", \"a\"], \"passed\": true}, {\"check\": \"remove-subtree contract\", \"actual\": [{\"id\": 1, \"ancestors\": []}], \"expected\": [{\"id\": 1, \"ancestors\": []}], \"passed\": true}, {\"check\": \"root-of contract\", \"actual\": \"r\", \"expected\": \"r\", \"passed\": true}, {\"check\": \"depth-z contract\", \"actual\": 104, \"expected\": 108, \"passed\": false}, {\"check\": \"detach contract\", \"actual\": [{\"id\": 1, \"parent\": null}, {\"id\": 2, \"parent\": \"other\"}], \"expected\": [{\"id\": 1, \"parent\": null}, {\"id\": 2, \"parent\": \"other\"}], \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.405,"exit_code":1,"observations":[{"actual":"child1","check":"top contract","expected":"child1","passed":true},{"actual":["b1","a"],"check":"raise contract","expected":["b1","a"],"passed":true},{"actual":[{"ancestors":[],"id":1}],"check":"remove-subtree contract","expected":[{"ancestors":[],"id":1}],"passed":true},{"actual":"r","check":"root-of contract","expected":"r","passed":true},{"actual":102,"check":"depth-z contract","expected":108,"passed":false},{"actual":[{"id":1,"parent":null},{"id":2,"parent":"other"}],"check":"detach contract","expected":[{"id":1,"parent":null},{"id":2,"parent":"other"}],"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"top contract\", \"actual\": \"child1\", \"expected\": \"child1\", \"passed\": true}, {\"check\": \"raise contract\", \"actual\": [\"b1\", \"a\"], \"expected\": [\"b1\", \"a\"], \"passed\": true}, {\"check\": \"remove-subtree contract\", \"actual\": [{\"id\": 1, \"ancestors\": []}], \"expected\": [{\"id\": 1, \"ancestors\": []}], \"passed\": true}, {\"check\": \"root-of contract\", \"actual\": \"r\", \"expected\": \"r\", \"passed\": true}, {\"check\": \"depth-z contract\", \"actual\": 102, \"expected\": 108, \"passed\": false}, {\"check\": \"detach contract\", \"actual\": [{\"id\": 1, \"parent\": null}, {\"id\": 2, \"parent\": \"other\"}], \"expected\": [{\"id\": 1, \"parent\": null}, {\"id\": 2, \"parent\": \"other\"}], \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":49.276,"exit_code":0,"observations":[{"actual":"child1","check":"top contract","expected":"child1","passed":true},{"actual":["b1","a"],"check":"raise contract","expected":["b1","a"],"passed":true},{"actual":[{"ancestors":[],"id":1}],"check":"remove-subtree contract","expected":[{"ancestors":[],"id":1}],"passed":true},{"actual":"r","check":"root-of contract","expected":"r","passed":true},{"actual":108,"check":"depth-z contract","expected":108,"passed":true},{"actual":[{"id":1,"parent":null},{"id":2,"parent":"other"}],"check":"detach contract","expected":[{"id":1,"parent":null},{"id":2,"parent":"other"}],"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"top contract\", \"actual\": \"child1\", \"expected\": \"child1\", \"passed\": true}, {\"check\": \"raise contract\", \"actual\": [\"b1\", \"a\"], \"expected\": [\"b1\", \"a\"], \"passed\": true}, {\"check\": \"remove-subtree contract\", \"actual\": [{\"id\": 1, \"ancestors\": []}], \"expected\": [{\"id\": 1, \"ancestors\": []}], \"passed\": true}, {\"check\": \"root-of contract\", \"actual\": \"r\", \"expected\": \"r\", \"passed\": true}, {\"check\": \"depth-z contract\", \"actual\": 108, \"expected\": 108, \"passed\": true}, {\"check\": \"detach contract\", \"actual\": [{\"id\": 1, \"parent\": null}, {\"id\": 2, \"parent\": \"other\"}], \"expected\": [{\"id\": 1, \"parent\": null}, {\"id\": 2, \"parent\": \"other\"}], \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}