FAILURE MAP
← Case archive

FA-33786 / Menu interactions / Open access

Cancelling a menu preview leaves provisional document changes · case 01

Cancelling a menu preview leaves provisional document changes.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The menu-command-preview model applies `p['current']` at its cancel operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `p['base']` at cancel.

Unsuccessful approach: The attempted repair `0` still violates the cancel 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['current']
    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 fixtureActualExpectedOutcome
base contract33Passed
cancel contract41Failed
commit-once contract33Passed
owner-cleanup contract[{'id': 2, 'menu': 'b'}][{'id': 2, 'menu': 'b'}]Passed
supported contractFalseFalsePassed
exit-mode contractrestorerestorePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 01b35fb6b8550233fc940a7bccafdf0060476ed8f4104e6676f018769d7626f6

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 0
    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 fixtureActualExpectedOutcome
base contract33Passed
cancel contract01Failed
commit-once contract33Passed
owner-cleanup contract[{'id': 2, 'menu': 'b'}][{'id': 2, 'menu': 'b'}]Passed
supported contractFalseFalsePassed
exit-mode contractrestorerestorePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 9ac2baef6d7e82986fd2886889879388a58d47fef2a0db783c79fa21e35bb697

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 fixtureActualExpectedOutcome
base contract33Passed
cancel contract11Passed
commit-once contract33Passed
owner-cleanup contract[{'id': 2, 'menu': 'b'}][{'id': 2, 'menu': 'b'}]Passed
supported contractFalseFalsePassed
exit-mode contractrestorerestorePassed
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.732427+00:00.

Case digest / 3fdd62416b31696cfa68e4869068dbeb0ba3da7123ef66f42cbc370f9629907e