FA-32951 / Menu interactions / Open access
Menu filter removes informative unavailable command results · case 01
Menu filter removes informative unavailable command results.
ROOT CAUSE
The filtered-menu-projection model applies `[x for x in p if x['matches'] and x['enabled']]` at its disabled-match operation instead of the stipulated transformation.
THE FAILURE
The filtered-menu-projection model applies `[x for x in p if x['matches'] and x['enabled']]` at its disabled-match operation instead of the stipulated transformation.
Unsuccessful approach: The attempted repair `[x for x in p if x['enabled']]` still violates the disabled-match oracle.
Case contract
Menu filtering retains matching leaves and required ancestor headers, counts only commands, and discards decorations orphaned by filtering.
Why this case matters
Cascading and context menus require coherent command and session state as content changes.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
if action == 'ancestors':
return sorted(set(p['matches']) | {a for x in p['matches'] for a in p['ancestors'][x]})
if action == 'command-count':
return sum(x['kind']=='command' for x in p)
if action == 'disabled-match':
return [x for x in p if x['matches'] and x['enabled']]
if action == 'group-header':
return [x for x in p['headers'] if x in p['surviving_groups']]
if action == 'query-clear':
return p['original']
if action == 'owner-match':
return p['direct_match'] or bool(p['descendant_matches'])
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ancestors contract', solve('ancestors', {'matches':['c'+str(N)],'ancestors':{'c'+str(N):['r','tools']}}), sorted(['c'+str(N),'r','tools']))
check('command-count contract', solve('command-count', [{'kind':'header'},{'kind':'command','id':N},{'kind':'separator'}]), 1)
check('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}])
check('group-header contract', solve('group-header', {'headers':['a','b'],'surviving_groups':['b','c'+str(N)]}), ['b'])
check('query-clear contract', solve('query-clear', {'original':list(range(N+3)),'filtered':[N]}), list(range(N+3)))
check('owner-match contract', solve('owner-match', {'direct_match':False,'descendant_matches':[N]}), True)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| ancestors contract | ['c1', 'r', 'tools'] | ['c1', 'r', 'tools'] | Passed |
| command-count contract | 1 | 1 | Passed |
| disabled-match contract | [] | [{'enabled': False, 'id': 1, 'matches': True}] | Failed |
| group-header contract | ['b'] | ['b'] | Passed |
| query-clear contract | [0, 1, 2, 3] | [0, 1, 2, 3] | Passed |
| owner-match contract | True | True | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 078061c8d85f5fecc3c9d6a3a7e6f68bc837d04072fe922c456156c30b6ad0dc
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
if action == 'ancestors':
return sorted(set(p['matches']) | {a for x in p['matches'] for a in p['ancestors'][x]})
if action == 'command-count':
return sum(x['kind']=='command' for x in p)
if action == 'disabled-match':
return [x for x in p if x['enabled']]
if action == 'group-header':
return [x for x in p['headers'] if x in p['surviving_groups']]
if action == 'query-clear':
return p['original']
if action == 'owner-match':
return p['direct_match'] or bool(p['descendant_matches'])
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ancestors contract', solve('ancestors', {'matches':['c'+str(N)],'ancestors':{'c'+str(N):['r','tools']}}), sorted(['c'+str(N),'r','tools']))
check('command-count contract', solve('command-count', [{'kind':'header'},{'kind':'command','id':N},{'kind':'separator'}]), 1)
check('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}])
check('group-header contract', solve('group-header', {'headers':['a','b'],'surviving_groups':['b','c'+str(N)]}), ['b'])
check('query-clear contract', solve('query-clear', {'original':list(range(N+3)),'filtered':[N]}), list(range(N+3)))
check('owner-match contract', solve('owner-match', {'direct_match':False,'descendant_matches':[N]}), True)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| ancestors contract | ['c1', 'r', 'tools'] | ['c1', 'r', 'tools'] | Passed |
| command-count contract | 1 | 1 | Passed |
| disabled-match contract | [{'enabled': True, 'id': 2, 'matches': False}] | [{'enabled': False, 'id': 1, 'matches': True}] | Failed |
| group-header contract | ['b'] | ['b'] | Passed |
| query-clear contract | [0, 1, 2, 3] | [0, 1, 2, 3] | Passed |
| owner-match contract | True | True | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 7757a02a3f685b949d49041a9776d904ce52be03e791c4db7ad973b39d9cd9a0
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:42:17.625813+00:00.
Case digest / 6bfc67717f7b550fcf7cba4af3dd336e2406a18f277ad360f041c04a1642291c