{"abstract":"Filtered result counter includes menu headings.","category":"Menu interactions","checks":7,"contract":"Menu filtering retains matching leaves and required ancestor headers, counts only commands, and discards decorations orphaned by filtering.","evaluation_group":"s3-menu-interactions-filtered-menu-projection","failed_approach":"The attempted repair `sum(x['kind']!='separator' for x in p)` still violates the command-count oracle.","family":"s3-menu-interactions-filtered-menu-projection-command-count","id":"FA-32946","implementations":{"attempt":{"sha256":"54b29b2db87719fd38daa9738b331bd6ddb7183079e15e256c22522c4b1aa649","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 == 'ancestors':\n        return sorted(set(p['matches']) | {a for x in p['matches'] for a in p['ancestors'][x]})\n    if action == 'command-count':\n        return sum(x['kind']!='separator' for x in p)\n    if action == 'disabled-match':\n        return [x for x in p if x['matches']]\n    if action == 'group-header':\n        return [x for x in p['headers'] if x in p['surviving_groups']]\n    if action == 'query-clear':\n        return p['original']\n    if action == 'owner-match':\n        return p['direct_match'] or bool(p['descendant_matches'])\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ancestors contract', solve('ancestors', {'matches':['c'+str(N)],'ancestors':{'c'+str(N):['r','tools']}}), sorted(['c'+str(N),'r','tools']))\ncheck('command-count contract', solve('command-count', [{'kind':'header'},{'kind':'command','id':N},{'kind':'separator'}]), 1)\ncheck('disabled-match contract', solve('disabled-match', [{'matches':True,'enabled':False,'id':N},{'matches':False,'enabled':True,'id':N+1}]), [{'matches':True,'enabled':False,'id':N}])\ncheck('group-header contract', solve('group-header', {'headers':['a','b'],'surviving_groups':['b','c'+str(N)]}), ['b'])\ncheck('query-clear contract', solve('query-clear', {'original':list(range(N+3)),'filtered':[N]}), list(range(N+3)))\ncheck('owner-match contract', solve('owner-match', {'direct_match':False,'descendant_matches':[N]}), True)\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":"d287602344c844a688db59742a86c417b632b77c1683bfb4e40ff21db0cc8947","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 == 'ancestors':\n        return sorted(set(p['matches']) | {a for x in p['matches'] for a in p['ancestors'][x]})\n    if action == 'command-count':\n        return len(p)\n    if action == 'disabled-match':\n        return [x for x in p if x['matches']]\n    if action == 'group-header':\n        return [x for x in p['headers'] if x in p['surviving_groups']]\n    if action == 'query-clear':\n        return p['original']\n    if action == 'owner-match':\n        return p['direct_match'] or bool(p['descendant_matches'])\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ancestors contract', solve('ancestors', {'matches':['c'+str(N)],'ancestors':{'c'+str(N):['r','tools']}}), sorted(['c'+str(N),'r','tools']))\ncheck('command-count contract', solve('command-count', [{'kind':'header'},{'kind':'command','id':N},{'kind':'separator'}]), 1)\ncheck('disabled-match contract', solve('disabled-match', [{'matches':True,'enabled':False,'id':N},{'matches':False,'enabled':True,'id':N+1}]), [{'matches':True,'enabled':False,'id':N}])\ncheck('group-header contract', solve('group-header', {'headers':['a','b'],'surviving_groups':['b','c'+str(N)]}), ['b'])\ncheck('query-clear contract', solve('query-clear', {'original':list(range(N+3)),'filtered':[N]}), list(range(N+3)))\ncheck('owner-match contract', solve('owner-match', {'direct_match':False,'descendant_matches':[N]}), True)\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":"0cadb09f912e2d5e1edf70d8815b74b125ad513577df7c2cfe0523bd3e5a6c7d","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 == 'ancestors':\n        return sorted(set(p['matches']) | {a for x in p['matches'] for a in p['ancestors'][x]})\n    if action == 'command-count':\n        return sum(x['kind']=='command' for x in p)\n    if action == 'disabled-match':\n        return [x for x in p if x['matches']]\n    if action == 'group-header':\n        return [x for x in p['headers'] if x in p['surviving_groups']]\n    if action == 'query-clear':\n        return p['original']\n    if action == 'owner-match':\n        return p['direct_match'] or bool(p['descendant_matches'])\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ancestors contract', solve('ancestors', {'matches':['c'+str(N)],'ancestors':{'c'+str(N):['r','tools']}}), sorted(['c'+str(N),'r','tools']))\ncheck('command-count contract', solve('command-count', [{'kind':'header'},{'kind':'command','id':N},{'kind':'separator'}]), 1)\ncheck('disabled-match contract', solve('disabled-match', [{'matches':True,'enabled':False,'id':N},{'matches':False,'enabled':True,'id':N+1}]), [{'matches':True,'enabled':False,'id':N}])\ncheck('group-header contract', solve('group-header', {'headers':['a','b'],'surviving_groups':['b','c'+str(N)]}), ['b'])\ncheck('query-clear contract', solve('query-clear', {'original':list(range(N+3)),'filtered':[N]}), list(range(N+3)))\ncheck('owner-match contract', solve('owner-match', {'direct_match':False,'descendant_matches':[N]}), True)\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-filtered-menu-projection-command-count","generated_at":"2026-09-29T14:42:17.455643+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 `sum(x['kind']=='command' for x in p)` at command-count.","root_cause":"The filtered-menu-projection model applies `len(p)` at its command-count operation instead of the stipulated transformation.","sha256":"ea5cf57a52628a9a250bed0207266363d63dc8c82a8c713201d715041dbb6fad","title":"Filtered result counter includes menu headings · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":53.474,"exit_code":1,"observations":[{"actual":["c1","r","tools"],"check":"ancestors contract","expected":["c1","r","tools"],"passed":true},{"actual":2,"check":"command-count contract","expected":1,"passed":false},{"actual":[{"enabled":false,"id":1,"matches":true}],"check":"disabled-match contract","expected":[{"enabled":false,"id":1,"matches":true}],"passed":true},{"actual":["b"],"check":"group-header contract","expected":["b"],"passed":true},{"actual":[0,1,2,3],"check":"query-clear contract","expected":[0,1,2,3],"passed":true},{"actual":true,"check":"owner-match contract","expected":true,"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ancestors contract\", \"actual\": [\"c1\", \"r\", \"tools\"], \"expected\": [\"c1\", \"r\", \"tools\"], \"passed\": true}, {\"check\": \"command-count contract\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"disabled-match contract\", \"actual\": [{\"matches\": true, \"enabled\": false, \"id\": 1}], \"expected\": [{\"matches\": true, \"enabled\": false, \"id\": 1}], \"passed\": true}, {\"check\": \"group-header contract\", \"actual\": [\"b\"], \"expected\": [\"b\"], \"passed\": true}, {\"check\": \"query-clear contract\", \"actual\": [0, 1, 2, 3], \"expected\": [0, 1, 2, 3], \"passed\": true}, {\"check\": \"owner-match contract\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":49.87,"exit_code":1,"observations":[{"actual":["c1","r","tools"],"check":"ancestors contract","expected":["c1","r","tools"],"passed":true},{"actual":3,"check":"command-count contract","expected":1,"passed":false},{"actual":[{"enabled":false,"id":1,"matches":true}],"check":"disabled-match contract","expected":[{"enabled":false,"id":1,"matches":true}],"passed":true},{"actual":["b"],"check":"group-header contract","expected":["b"],"passed":true},{"actual":[0,1,2,3],"check":"query-clear contract","expected":[0,1,2,3],"passed":true},{"actual":true,"check":"owner-match contract","expected":true,"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ancestors contract\", \"actual\": [\"c1\", \"r\", \"tools\"], \"expected\": [\"c1\", \"r\", \"tools\"], \"passed\": true}, {\"check\": \"command-count contract\", \"actual\": 3, \"expected\": 1, \"passed\": false}, {\"check\": \"disabled-match contract\", \"actual\": [{\"matches\": true, \"enabled\": false, \"id\": 1}], \"expected\": [{\"matches\": true, \"enabled\": false, \"id\": 1}], \"passed\": true}, {\"check\": \"group-header contract\", \"actual\": [\"b\"], \"expected\": [\"b\"], \"passed\": true}, {\"check\": \"query-clear contract\", \"actual\": [0, 1, 2, 3], \"expected\": [0, 1, 2, 3], \"passed\": true}, {\"check\": \"owner-match contract\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":48.34,"exit_code":0,"observations":[{"actual":["c1","r","tools"],"check":"ancestors contract","expected":["c1","r","tools"],"passed":true},{"actual":1,"check":"command-count contract","expected":1,"passed":true},{"actual":[{"enabled":false,"id":1,"matches":true}],"check":"disabled-match contract","expected":[{"enabled":false,"id":1,"matches":true}],"passed":true},{"actual":["b"],"check":"group-header contract","expected":["b"],"passed":true},{"actual":[0,1,2,3],"check":"query-clear contract","expected":[0,1,2,3],"passed":true},{"actual":true,"check":"owner-match contract","expected":true,"passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ancestors contract\", \"actual\": [\"c1\", \"r\", \"tools\"], \"expected\": [\"c1\", \"r\", \"tools\"], \"passed\": true}, {\"check\": \"command-count contract\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"disabled-match contract\", \"actual\": [{\"matches\": true, \"enabled\": false, \"id\": 1}], \"expected\": [{\"matches\": true, \"enabled\": false, \"id\": 1}], \"passed\": true}, {\"check\": \"group-header contract\", \"actual\": [\"b\"], \"expected\": [\"b\"], \"passed\": true}, {\"check\": \"query-clear contract\", \"actual\": [0, 1, 2, 3], \"expected\": [0, 1, 2, 3], \"passed\": true}, {\"check\": \"owner-match contract\", \"actual\": true, \"expected\": true, \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}