FA-33796 / Menu interactions / Open access
Menu preview cleanup removes overlays owned by another menu · case 01
Menu preview cleanup removes overlays owned by another menu.
ROOT CAUSE
The menu-command-preview model applies `[]` at its owner-cleanup operation instead of the stipulated transformation.
VERIFIED REPAIR
Apply `[x for x in p['overlays'] if x['menu']!=p['menu']]` at owner-cleanup.
Unsuccessful approach: The attempted repair `p['overlays']` still violates the owner-cleanup oracle.
Case contract
Hover previews are provisional document overlays; changing preview restores the base, commit applies the actual command once and cancellation removes only the menu-owned preview.
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 == 'base':
return p['base']+p['delta']
if action == 'cancel':
return p['base']
if action == 'commit-once':
return p['base']+p['delta']
if action == 'owner-cleanup':
return []
if action == 'supported':
return p['previewable'] and p['reversible']
if action == 'exit-mode':
return 'commit' if p['reason']=='execute' else 'restore'
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('base contract', solve('base', {'base':N,'current_preview':N+5,'delta':2}), N+2)
check('cancel contract', solve('cancel', {'base':N,'current':N+3}), N)
check('commit-once contract', solve('commit-once', {'base':N,'preview':N+2,'delta':2}), N+2)
check('owner-cleanup contract', solve('owner-cleanup', {'overlays':[{'menu':'a','id':N},{'menu':'b','id':N+1}],'menu':'a'}), [{'menu':'b','id':N+1}])
check('supported contract', solve('supported', {'previewable':True,'reversible':False,'command':N}), False)
check('exit-mode contract', solve('exit-mode', {'reason':'leave','owner':N}), 'restore')
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 |
|---|---|---|---|
| base contract | 3 | 3 | Passed |
| cancel contract | 1 | 1 | Passed |
| commit-once contract | 3 | 3 | Passed |
| owner-cleanup contract | [] | [{'id': 2, 'menu': 'b'}] | Failed |
| supported contract | False | False | Passed |
| exit-mode contract | restore | restore | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 9963b7710d713d9a6f18213cc7431d6ee52d7e65b8e084b4fd5314fbf6479969
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 == 'base':
return p['base']+p['delta']
if action == 'cancel':
return p['base']
if action == 'commit-once':
return p['base']+p['delta']
if action == 'owner-cleanup':
return p['overlays']
if action == 'supported':
return p['previewable'] and p['reversible']
if action == 'exit-mode':
return 'commit' if p['reason']=='execute' else 'restore'
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('base contract', solve('base', {'base':N,'current_preview':N+5,'delta':2}), N+2)
check('cancel contract', solve('cancel', {'base':N,'current':N+3}), N)
check('commit-once contract', solve('commit-once', {'base':N,'preview':N+2,'delta':2}), N+2)
check('owner-cleanup contract', solve('owner-cleanup', {'overlays':[{'menu':'a','id':N},{'menu':'b','id':N+1}],'menu':'a'}), [{'menu':'b','id':N+1}])
check('supported contract', solve('supported', {'previewable':True,'reversible':False,'command':N}), False)
check('exit-mode contract', solve('exit-mode', {'reason':'leave','owner':N}), 'restore')
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 |
|---|---|---|---|
| base contract | 3 | 3 | Passed |
| cancel contract | 1 | 1 | Passed |
| commit-once contract | 3 | 3 | Passed |
| owner-cleanup contract | [{'id': 1, 'menu': 'a'}, {'id': 2, 'menu': 'b'}] | [{'id': 2, 'menu': 'b'}] | Failed |
| supported contract | False | False | Passed |
| exit-mode contract | restore | restore | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / e0c70df2cbfad3bf9aa4793d77a97bcf180fd45bf59e53b49d44f4b170d38591
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
if action == 'base':
return p['base']+p['delta']
if action == 'cancel':
return p['base']
if action == 'commit-once':
return p['base']+p['delta']
if action == 'owner-cleanup':
return [x for x in p['overlays'] if x['menu']!=p['menu']]
if action == 'supported':
return p['previewable'] and p['reversible']
if action == 'exit-mode':
return 'commit' if p['reason']=='execute' else 'restore'
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('base contract', solve('base', {'base':N,'current_preview':N+5,'delta':2}), N+2)
check('cancel contract', solve('cancel', {'base':N,'current':N+3}), N)
check('commit-once contract', solve('commit-once', {'base':N,'preview':N+2,'delta':2}), N+2)
check('owner-cleanup contract', solve('owner-cleanup', {'overlays':[{'menu':'a','id':N},{'menu':'b','id':N+1}],'menu':'a'}), [{'menu':'b','id':N+1}])
check('supported contract', solve('supported', {'previewable':True,'reversible':False,'command':N}), False)
check('exit-mode contract', solve('exit-mode', {'reason':'leave','owner':N}), 'restore')
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 |
|---|---|---|---|
| base contract | 3 | 3 | Passed |
| cancel contract | 1 | 1 | Passed |
| commit-once contract | 3 | 3 | Passed |
| owner-cleanup contract | [{'id': 2, 'menu': 'b'}] | [{'id': 2, 'menu': 'b'}] | Passed |
| supported contract | False | False | Passed |
| exit-mode contract | restore | restore | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / a94eb917d71e65759bb62865cdf7cdb2ab233f02531386709d26b07b4e0453b8
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:25.778869+00:00.
Case digest / a24b7a397680c65d8fcfc8b5829e22acd7c1a8b5135dc8153cb21371cbef3a73