FAILURE MAP
← Case archive

FA-32871 / Menu interactions / Open access

Menu refresh keeps a cascade whose child was reparented · case 01

Menu refresh keeps a cascade whose child was reparented.

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

ROOT CAUSE

The menu-snapshot-refresh model applies `all(x in p['parents'] for x in p['chain'][1:])` at its path-valid operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `all(x in p['parents'] and p['parents'][x]==y for y,x in zip(p['chain'],p['chain'][1:]))` at path-valid.

Unsuccessful approach: The attempted repair `True` still violates the path-valid oracle.

Case contract

Refreshing an open menu reconciles immutable command IDs, provider revisions and annotations without confusing display positions with identity.

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 == 'retain-live':
        return [x for x in p['old'] if x in p['new']]
    if action == 'new-order':
        return [x for x in p['new'] if x in p['old']]
    if action == 'annotation':
        return {x:p['annotations'][x] for x in p['new'] if x in p['annotations']}
    if action == 'provider-version':
        return p['incoming']>p['current']
    if action == 'path-valid':
        return all(x in p['parents'] for x in p['chain'][1:])
    if action == 'anchor-id':
        return next((i for i,x in enumerate(p['rows']) if x==p['owner']),None)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('retain-live contract', solve('retain-live', {'old':[N,N+1],'new':[N+1,N+2]}), [N+1])
check('new-order contract', solve('new-order', {'old':[N,N+1],'new':[N+1,N]}), [N+1,N])
check('annotation contract', solve('annotation', {'new':['a'],'annotations':{'a':N,'gone':N+1}}), {'a':N})
check('provider-version contract', solve('provider-version', {'incoming':N,'current':N}), False)
check('path-valid contract', solve('path-valid', {'chain':['r','a',str(N)],'parents':{'a':'r',str(N):'other'}}), False)
check('anchor-id contract', solve('anchor-id', {'rows':['x','y','owner'+str(N)],'owner':'owner'+str(N),'old_index':1}), 2)
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
retain-live contract[2][2]Passed
new-order contract[2, 1][2, 1]Passed
annotation contract{'a': 1}{'a': 1}Passed
provider-version contractFalseFalsePassed
path-valid contractTrueFalseFailed
anchor-id contract22Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 34882dacd77a5e803678b54dbf481470824490584f9935992ed5180aa4cb5305

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 == 'retain-live':
        return [x for x in p['old'] if x in p['new']]
    if action == 'new-order':
        return [x for x in p['new'] if x in p['old']]
    if action == 'annotation':
        return {x:p['annotations'][x] for x in p['new'] if x in p['annotations']}
    if action == 'provider-version':
        return p['incoming']>p['current']
    if action == 'path-valid':
        return True
    if action == 'anchor-id':
        return next((i for i,x in enumerate(p['rows']) if x==p['owner']),None)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('retain-live contract', solve('retain-live', {'old':[N,N+1],'new':[N+1,N+2]}), [N+1])
check('new-order contract', solve('new-order', {'old':[N,N+1],'new':[N+1,N]}), [N+1,N])
check('annotation contract', solve('annotation', {'new':['a'],'annotations':{'a':N,'gone':N+1}}), {'a':N})
check('provider-version contract', solve('provider-version', {'incoming':N,'current':N}), False)
check('path-valid contract', solve('path-valid', {'chain':['r','a',str(N)],'parents':{'a':'r',str(N):'other'}}), False)
check('anchor-id contract', solve('anchor-id', {'rows':['x','y','owner'+str(N)],'owner':'owner'+str(N),'old_index':1}), 2)
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
retain-live contract[2][2]Passed
new-order contract[2, 1][2, 1]Passed
annotation contract{'a': 1}{'a': 1}Passed
provider-version contractFalseFalsePassed
path-valid contractTrueFalseFailed
anchor-id contract22Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 7b9e41fb92835c4c7bdc2ddde0aa57de1f35cb1181e2a1ab12c794aada2fd02b

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 == 'retain-live':
        return [x for x in p['old'] if x in p['new']]
    if action == 'new-order':
        return [x for x in p['new'] if x in p['old']]
    if action == 'annotation':
        return {x:p['annotations'][x] for x in p['new'] if x in p['annotations']}
    if action == 'provider-version':
        return p['incoming']>p['current']
    if action == 'path-valid':
        return all(x in p['parents'] and p['parents'][x]==y for y,x in zip(p['chain'],p['chain'][1:]))
    if action == 'anchor-id':
        return next((i for i,x in enumerate(p['rows']) if x==p['owner']),None)
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('retain-live contract', solve('retain-live', {'old':[N,N+1],'new':[N+1,N+2]}), [N+1])
check('new-order contract', solve('new-order', {'old':[N,N+1],'new':[N+1,N]}), [N+1,N])
check('annotation contract', solve('annotation', {'new':['a'],'annotations':{'a':N,'gone':N+1}}), {'a':N})
check('provider-version contract', solve('provider-version', {'incoming':N,'current':N}), False)
check('path-valid contract', solve('path-valid', {'chain':['r','a',str(N)],'parents':{'a':'r',str(N):'other'}}), False)
check('anchor-id contract', solve('anchor-id', {'rows':['x','y','owner'+str(N)],'owner':'owner'+str(N),'old_index':1}), 2)
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
retain-live contract[2][2]Passed
new-order contract[2, 1][2, 1]Passed
annotation contract{'a': 1}{'a': 1}Passed
provider-version contractFalseFalsePassed
path-valid contractFalseFalsePassed
anchor-id contract22Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / e5e786fe9f306d2f561b29e4fc91cac9805d2ffe825254ca3106b58c592f5932

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

Case digest / 1dd549a48ab7858997b13206eeac627edfc52f4910810140e897834157328ae3