{"abstract":"Empty menu section leaves an orphaned header.","category":"Menu interactions","checks":7,"contract":"Menu sections keep headers attached to nonempty groups and separators only between surviving groups; pinned sections retain their declared slots.","evaluation_group":"s3-menu-interactions-section-composition","failed_approach":"The attempted repair `[g for g in p if g['title']]` still violates the empty-group oracle.","family":"s3-menu-interactions-section-composition-empty-group","id":"FA-32491","implementations":{"attempt":{"sha256":"072f527df5e7df807adbd4167789e46770d1f6d9454b50a1f2d6159ed9cfbe48","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 == 'empty-group':\n        return [g for g in p if g['title']]\n    if action == 'separators':\n        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []\n    if action == 'header':\n        return [{'header':p['title']}]+p['items']\n    if action == 'pin-top':\n        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']\n    if action == 'group-key':\n        return [(x['provider'],x['group']) for x in p]\n    if action == 'count':\n        return sum(len(g['items']) for g in p)\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])\ncheck('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])\ncheck('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])\ncheck('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])\ncheck('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])\ncheck('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)\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":"c2eeb1e19a502b51ec1aacd45a328b77520fffec213b0b7f33ce6bac76eb4ed3","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 == 'empty-group':\n        return p\n    if action == 'separators':\n        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []\n    if action == 'header':\n        return [{'header':p['title']}]+p['items']\n    if action == 'pin-top':\n        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']\n    if action == 'group-key':\n        return [(x['provider'],x['group']) for x in p]\n    if action == 'count':\n        return sum(len(g['items']) for g in p)\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])\ncheck('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])\ncheck('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])\ncheck('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])\ncheck('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])\ncheck('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)\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":"1d0d465047edbea9ae80a47a7d5ec8c4b662a8dec9b5f893a8b5cf03c5c80fd9","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 == 'empty-group':\n        return [g for g in p if g['items']]\n    if action == 'separators':\n        return sum(([{'separator':True}]+g for g in p[1:]),p[0]) if p else []\n    if action == 'header':\n        return [{'header':p['title']}]+p['items']\n    if action == 'pin-top':\n        return [x for x in p if x['pin']=='top']+[x for x in p if x['pin']!='top']\n    if action == 'group-key':\n        return [(x['provider'],x['group']) for x in p]\n    if action == 'count':\n        return sum(len(g['items']) for g in p)\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty-group contract', solve('empty-group', [{'title':'empty','items':[]},{'title':'g','items':[N]}]), [{'title':'g','items':[N]}])\ncheck('separators contract', solve('separators', [[N],[N+1]]), [N,{'separator':True},N+1])\ncheck('header contract', solve('header', {'title':'g'+str(N),'items':['a','b']}), [{'header':'g'+str(N)},'a','b'])\ncheck('pin-top contract', solve('pin-top', [{'id':N,'pin':'none'},{'id':N+1,'pin':'top'}]), [{'id':N+1,'pin':'top'},{'id':N,'pin':'none'}])\ncheck('group-key contract', solve('group-key', [{'provider':'p'+str(N),'group':'tools'}]), [('p'+str(N),'tools')])\ncheck('count contract', solve('count', [{'items':[N,N+1,N+2]},{'items':[N+3]}]), 4)\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-section-composition-empty-group","generated_at":"2026-09-29T14:42:12.808236+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 `[g for g in p if g['items']]` at empty-group.","root_cause":"The section-composition model applies `p` at its empty-group operation instead of the stipulated transformation.","sha256":"03969ccd596df969770fe6e0fbec72d8b8444f6c59b20cc58a77d3ddf5422a16","title":"Empty menu section leaves an orphaned header · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.35,"exit_code":1,"observations":[{"actual":[{"items":[],"title":"empty"},{"items":[1],"title":"g"}],"check":"empty-group contract","expected":[{"items":[1],"title":"g"}],"passed":false},{"actual":[1,{"separator":true},2],"check":"separators contract","expected":[1,{"separator":true},2],"passed":true},{"actual":[{"header":"g1"},"a","b"],"check":"header contract","expected":[{"header":"g1"},"a","b"],"passed":true},{"actual":[{"id":2,"pin":"top"},{"id":1,"pin":"none"}],"check":"pin-top contract","expected":[{"id":2,"pin":"top"},{"id":1,"pin":"none"}],"passed":true},{"actual":[["p1","tools"]],"check":"group-key contract","expected":[["p1","tools"]],"passed":true},{"actual":4,"check":"count contract","expected":4,"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty-group contract\", \"actual\": [{\"title\": \"empty\", \"items\": []}, {\"title\": \"g\", \"items\": [1]}], \"expected\": [{\"title\": \"g\", \"items\": [1]}], \"passed\": false}, {\"check\": \"separators contract\", \"actual\": [1, {\"separator\": true}, 2], \"expected\": [1, {\"separator\": true}, 2], \"passed\": true}, {\"check\": \"header contract\", \"actual\": [{\"header\": \"g1\"}, \"a\", \"b\"], \"expected\": [{\"header\": \"g1\"}, \"a\", \"b\"], \"passed\": true}, {\"check\": \"pin-top contract\", \"actual\": [{\"id\": 2, \"pin\": \"top\"}, {\"id\": 1, \"pin\": \"none\"}], \"expected\": [{\"id\": 2, \"pin\": \"top\"}, {\"id\": 1, \"pin\": \"none\"}], \"passed\": true}, {\"check\": \"group-key contract\", \"actual\": [[\"p1\", \"tools\"]], \"expected\": [[\"p1\", \"tools\"]], \"passed\": true}, {\"check\": \"count contract\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.838,"exit_code":1,"observations":[{"actual":[{"items":[],"title":"empty"},{"items":[1],"title":"g"}],"check":"empty-group contract","expected":[{"items":[1],"title":"g"}],"passed":false},{"actual":[1,{"separator":true},2],"check":"separators contract","expected":[1,{"separator":true},2],"passed":true},{"actual":[{"header":"g1"},"a","b"],"check":"header contract","expected":[{"header":"g1"},"a","b"],"passed":true},{"actual":[{"id":2,"pin":"top"},{"id":1,"pin":"none"}],"check":"pin-top contract","expected":[{"id":2,"pin":"top"},{"id":1,"pin":"none"}],"passed":true},{"actual":[["p1","tools"]],"check":"group-key contract","expected":[["p1","tools"]],"passed":true},{"actual":4,"check":"count contract","expected":4,"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty-group contract\", \"actual\": [{\"title\": \"empty\", \"items\": []}, {\"title\": \"g\", \"items\": [1]}], \"expected\": [{\"title\": \"g\", \"items\": [1]}], \"passed\": false}, {\"check\": \"separators contract\", \"actual\": [1, {\"separator\": true}, 2], \"expected\": [1, {\"separator\": true}, 2], \"passed\": true}, {\"check\": \"header contract\", \"actual\": [{\"header\": \"g1\"}, \"a\", \"b\"], \"expected\": [{\"header\": \"g1\"}, \"a\", \"b\"], \"passed\": true}, {\"check\": \"pin-top contract\", \"actual\": [{\"id\": 2, \"pin\": \"top\"}, {\"id\": 1, \"pin\": \"none\"}], \"expected\": [{\"id\": 2, \"pin\": \"top\"}, {\"id\": 1, \"pin\": \"none\"}], \"passed\": true}, {\"check\": \"group-key contract\", \"actual\": [[\"p1\", \"tools\"]], \"expected\": [[\"p1\", \"tools\"]], \"passed\": true}, {\"check\": \"count contract\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.898,"exit_code":0,"observations":[{"actual":[{"items":[1],"title":"g"}],"check":"empty-group contract","expected":[{"items":[1],"title":"g"}],"passed":true},{"actual":[1,{"separator":true},2],"check":"separators contract","expected":[1,{"separator":true},2],"passed":true},{"actual":[{"header":"g1"},"a","b"],"check":"header contract","expected":[{"header":"g1"},"a","b"],"passed":true},{"actual":[{"id":2,"pin":"top"},{"id":1,"pin":"none"}],"check":"pin-top contract","expected":[{"id":2,"pin":"top"},{"id":1,"pin":"none"}],"passed":true},{"actual":[["p1","tools"]],"check":"group-key contract","expected":[["p1","tools"]],"passed":true},{"actual":4,"check":"count contract","expected":4,"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty-group contract\", \"actual\": [{\"title\": \"g\", \"items\": [1]}], \"expected\": [{\"title\": \"g\", \"items\": [1]}], \"passed\": true}, {\"check\": \"separators contract\", \"actual\": [1, {\"separator\": true}, 2], \"expected\": [1, {\"separator\": true}, 2], \"passed\": true}, {\"check\": \"header contract\", \"actual\": [{\"header\": \"g1\"}, \"a\", \"b\"], \"expected\": [{\"header\": \"g1\"}, \"a\", \"b\"], \"passed\": true}, {\"check\": \"pin-top contract\", \"actual\": [{\"id\": 2, \"pin\": \"top\"}, {\"id\": 1, \"pin\": \"none\"}], \"expected\": [{\"id\": 2, \"pin\": \"top\"}, {\"id\": 1, \"pin\": \"none\"}], \"passed\": true}, {\"check\": \"group-key contract\", \"actual\": [[\"p1\", \"tools\"]], \"expected\": [[\"p1\", \"tools\"]], \"passed\": true}, {\"check\": \"count contract\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}