{"abstract":"Popup cleanup reverses registration order instead of menu ancestor depth.","category":"Menu interactions","checks":7,"contract":"Each popup owns subscriptions, timers, content and anchors; teardown releases exactly owned resources and is safe when repeated.","contract_signature":"action, p","evaluation_group":"s3-menu-interactions-menu-resource-disposal","failed_approach":"The attempted repair `[x['id'] for x in p]` still violates the child-order oracle.","family":"s3-menu-interactions-menu-resource-disposal-child-order","id":"FA-32841","implementations":{"attempt":{"sha256":"67799ec3201f7097294d413dbe37aa8415bd8b3a735fcece5c62d9d94d59a2d9","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 == 'listeners':\n        return [x for x in p['listeners'] if x['session']!=p['session']]\n    if action == 'timer-handles':\n        return sorted({x for x in p if x is not None})\n    if action == 'content':\n        return {'rows':[],'loading':False,'error':None}\n    if action == 'lease':\n        return max(0,p['leases']-int(not p['already_closed']))\n    if action == 'child-order':\n        return [x['id'] for x in p]\n    if action == 'anchor-null':\n        return None\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('listeners contract', solve('listeners', {'session':N,'listeners':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}]}), [{'session':N+1,'id':'b'}])\ncheck('timer-handles contract', solve('timer-handles', [0,N,N,None]), [0,N])\ncheck('content contract', solve('content', {'rows':[N],'loading':True}), {'rows':[],'loading':False,'error':None})\ncheck('lease contract', solve('lease', {'leases':N+1,'already_closed':True}), N+1)\ncheck('child-order contract', solve('child-order', [{'id':'child','menu_path':['r','a']},{'id':'root','menu_path':['r']},{'id':N,'menu_path':['r','a','b']}]), [N,'child','root'])\ncheck('anchor-null contract', solve('anchor-null', {'anchor':N,'fallback':'document'}), None)\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":"951113cdc4e0c6c2ea194451df647c9270563f2ba00636e1a48852162d0b71db","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 == 'listeners':\n        return [x for x in p['listeners'] if x['session']!=p['session']]\n    if action == 'timer-handles':\n        return sorted({x for x in p if x is not None})\n    if action == 'content':\n        return {'rows':[],'loading':False,'error':None}\n    if action == 'lease':\n        return max(0,p['leases']-int(not p['already_closed']))\n    if action == 'child-order':\n        return [x['id'] for x in reversed(p)]\n    if action == 'anchor-null':\n        return None\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('listeners contract', solve('listeners', {'session':N,'listeners':[{'session':N,'id':'a'},{'session':N+1,'id':'b'}]}), [{'session':N+1,'id':'b'}])\ncheck('timer-handles contract', solve('timer-handles', [0,N,N,None]), [0,N])\ncheck('content contract', solve('content', {'rows':[N],'loading':True}), {'rows':[],'loading':False,'error':None})\ncheck('lease contract', solve('lease', {'leases':N+1,'already_closed':True}), N+1)\ncheck('child-order contract', solve('child-order', [{'id':'child','menu_path':['r','a']},{'id':'root','menu_path':['r']},{'id':N,'menu_path':['r','a','b']}]), [N,'child','root'])\ncheck('anchor-null contract', solve('anchor-null', {'anchor':N,'fallback':'document'}), None)\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-resource-disposal-child-order","generated_at":"2026-09-29T14:42:16.382126+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-resource-disposal model applies `[x['id'] for x in reversed(p)]` at its child-order operation instead of the stipulated transformation.","sha256":"ef5539c2f3fb012fcfad1a946e18af75738a1e152e31ffb11a3becd270efba80","title":"Popup cleanup reverses registration order instead of menu ancestor depth · 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":44.077,"exit_code":1,"observations":[{"actual":[{"id":"b","session":2}],"check":"listeners contract","expected":[{"id":"b","session":2}],"passed":true},{"actual":[0,1],"check":"timer-handles contract","expected":[0,1],"passed":true},{"actual":{"error":null,"loading":false,"rows":[]},"check":"content contract","expected":{"error":null,"loading":false,"rows":[]},"passed":true},{"actual":2,"check":"lease contract","expected":2,"passed":true},{"actual":["child","root",1],"check":"child-order contract","expected":[1,"child","root"],"passed":false},{"actual":null,"check":"anchor-null contract","expected":null,"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"listeners contract\", \"actual\": [{\"session\": 2, \"id\": \"b\"}], \"expected\": [{\"session\": 2, \"id\": \"b\"}], \"passed\": true}, {\"check\": \"timer-handles contract\", \"actual\": [0, 1], \"expected\": [0, 1], \"passed\": true}, {\"check\": \"content contract\", \"actual\": {\"rows\": [], \"loading\": false, \"error\": null}, \"expected\": {\"rows\": [], \"loading\": false, \"error\": null}, \"passed\": true}, {\"check\": \"lease contract\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"child-order contract\", \"actual\": [\"child\", \"root\", 1], \"expected\": [1, \"child\", \"root\"], \"passed\": false}, {\"check\": \"anchor-null contract\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.26,"exit_code":1,"observations":[{"actual":[{"id":"b","session":2}],"check":"listeners contract","expected":[{"id":"b","session":2}],"passed":true},{"actual":[0,1],"check":"timer-handles contract","expected":[0,1],"passed":true},{"actual":{"error":null,"loading":false,"rows":[]},"check":"content contract","expected":{"error":null,"loading":false,"rows":[]},"passed":true},{"actual":2,"check":"lease contract","expected":2,"passed":true},{"actual":[1,"root","child"],"check":"child-order contract","expected":[1,"child","root"],"passed":false},{"actual":null,"check":"anchor-null contract","expected":null,"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"listeners contract\", \"actual\": [{\"session\": 2, \"id\": \"b\"}], \"expected\": [{\"session\": 2, \"id\": \"b\"}], \"passed\": true}, {\"check\": \"timer-handles contract\", \"actual\": [0, 1], \"expected\": [0, 1], \"passed\": true}, {\"check\": \"content contract\", \"actual\": {\"rows\": [], \"loading\": false, \"error\": null}, \"expected\": {\"rows\": [], \"loading\": false, \"error\": null}, \"passed\": true}, {\"check\": \"lease contract\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"child-order contract\", \"actual\": [1, \"root\", \"child\"], \"expected\": [1, \"child\", \"root\"], \"passed\": false}, {\"check\": \"anchor-null contract\", \"actual\": null, \"expected\": null, \"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."}}