{"abstract":"Removing a parent popup leaves child surfaces registered.","category":"Menu interactions","checks":7,"contract":"Menu surfaces form an ownership stack independent of document overlays; operations preserve unrelated roots and remove owned descendants.","contract_signature":"action, p","evaluation_group":"s3-menu-interactions-menu-surface-stack","failed_approach":"The attempted repair `[]` still violates the remove-subtree oracle.","family":"s3-menu-interactions-menu-surface-stack-remove-subtree","id":"FA-32741","implementations":{"attempt":{"sha256":"8877747f22dfee54a73a8bcc851d00c99aa39ed137c87fc1296e816a5bc8ecfb","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 []\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"},"broken":{"sha256":"93e0fbc0b490ba7bab8d1512f5028a0483947d50d94ab5f5a67c54562e2fe055","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 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-remove-subtree","generated_at":"2026-09-29T14:42:15.409922+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.","root_cause":"The menu-surface-stack model applies `[x for x in p['stack'] if x['id']!=p['owner']]` at its remove-subtree operation instead of the stipulated transformation.","sha256":"a7a396a12da38dc51b90e16d0c6a3d33c3f5d553f6c462442d1dc3630e2580df","title":"Removing a parent popup leaves child surfaces registered · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":49.115,"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":[],"check":"remove-subtree contract","expected":[{"ancestors":[],"id":1}],"passed":false},{"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":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\": [], \"expected\": [{\"id\": 1, \"ancestors\": []}], \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":45.149,"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":["a"],"id":"b"},{"ancestors":[],"id":1}],"check":"remove-subtree contract","expected":[{"ancestors":[],"id":1}],"passed":false},{"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":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\": \"b\", \"ancestors\": [\"a\"]}, {\"id\": 1, \"ancestors\": []}], \"expected\": [{\"id\": 1, \"ancestors\": []}], \"passed\": false}, {\"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\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}