FAILURE MAP
← Case archive

FA-33231 / Menu interactions / Open access

Reattached tear-off keeps an independent lifetime flag · case 01

Reattached tear-off keeps an independent lifetime flag.

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

ROOT CAUSE

The tearoff-menus model applies `{'parent':p['destination'],'independent':True,'context':p['context']}` at its reattach operation instead of the stipulated transformation.

THE FAILURE

The tearoff-menus model applies `{'parent':p['destination'],'independent':True,'context':p['context']}` at its reattach operation instead of the stipulated transformation.

Unsuccessful approach: The attempted repair `{'parent':p['destination'],'independent':False,'context':None}` still violates the reattach oracle.

Case contract

A tear-off menu retains a frozen command context while acquiring an independent surface lifetime; its geometry and closure no longer follow the source popup.

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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':True,'context':p['context']}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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
copy-context contract{'document': 1}{'document': 1}Passed
lifetime contractNoneNonePassed
translate contract[11, 22][11, 22]Passed
source-close contract[1][1]Passed
reattach contract{'context': 'doc', 'independent': True, 'parent': 'menu1'}{'context': 'doc', 'independent': False, 'parent': 'menu1'}Failed
closed-record contract[{'id': 2}][{'id': 2}]Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / ba8dd4678bf48538c456194f3b1d69fc5db5fece0782a5bab7689ea6d33a34d8

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 == 'copy-context':
        return dict(p['context'])
    if action == 'lifetime':
        return None
    if action == 'translate':
        return [p['popup'][0]+p['offset'][0],p['popup'][1]+p['offset'][1]]
    if action == 'source-close':
        return p['torn'] if p['independent'] else []
    if action == 'reattach':
        return {'parent':p['destination'],'independent':False,'context':None}
    if action == 'closed-record':
        return [x for x in p['windows'] if x['id']!=p['id']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('copy-context contract', solve('copy-context', {'context':{'document':N},'ambient':{'document':N+1}}), {'document':N})
check('lifetime contract', solve('lifetime', {'parent_session':N,'root_session':N+1}), None)
check('translate contract', solve('translate', {'popup':[N,2*N],'offset':[10,20]}), [N+10,2*N+20])
check('source-close contract', solve('source-close', {'torn':[N],'independent':True,'source':['old']}), [N])
check('reattach contract', solve('reattach', {'destination':'menu'+str(N),'context':'doc'}), {'parent':'menu'+str(N),'independent':False,'context':'doc'})
check('closed-record contract', solve('closed-record', {'windows':[{'id':N},{'id':N+1}],'id':N}), [{'id':N+1}])
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
copy-context contract{'document': 1}{'document': 1}Passed
lifetime contractNoneNonePassed
translate contract[11, 22][11, 22]Passed
source-close contract[1][1]Passed
reattach contract{'context': None, 'independent': False, 'parent': 'menu1'}{'context': 'doc', 'independent': False, 'parent': 'menu1'}Failed
closed-record contract[{'id': 2}][{'id': 2}]Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 4845121178aaa9dbc1648007ae8032d00c24101d73e3b9a7b732213de92d0882

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:20.309372+00:00.

Case digest / a0b4ee5516dfdc49fd225552f9312da8c9141d6f39f3c8de2ecf81c4bd1b7980