FAILURE MAP
← Case archive

FA-32801 / Menu interactions / Open access

Context menu resolution crosses a document ownership boundary · case 01

Context menu resolution crosses a document ownership boundary.

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

ROOT CAUSE

The context-target-resolution model applies `p['path']` at its document operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `[x for x in p['path'] if x['document']==p['document']]` at document.

Unsuccessful approach: The attempted repair `[x for x in p['path'] if x['document']!=p['document']]` still violates the document oracle.

Case contract

Context invocations choose the nearest eligible context owner from a composed target path; nested ownership, exclusions and document boundaries are explicit.

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 == 'nearest':
        return next((x['id'] for x in p if x['context']),None)
    if action == 'exclude':
        return next((x['id'] for x in p if x['context'] and not x['excluded']),None)
    if action == 'document':
        return p['path']
    if action == 'detached':
        return p['connected'] and p['owner_exists']
    if action == 'fallback':
        return p['local'] if p['local'] is not None else p['document']
    if action == 'hit-target':
        return p['captured'] if p['capture_valid'] else p['hit']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest contract', solve('nearest', [{'id':N,'context':True},{'id':N+1,'context':True}]), N)
check('exclude contract', solve('exclude', [{'id':N,'context':True,'excluded':True},{'id':N+1,'context':False,'excluded':False},{'id':N+2,'context':True,'excluded':False}]), N+2)
check('document contract', solve('document', {'document':'a','path':[{'id':N,'document':'a'},{'id':N+1,'document':'b'}]}), [{'id':N,'document':'a'}])
check('detached contract', solve('detached', {'connected':False,'owner_exists':True,'id':N}), False)
check('fallback contract', solve('fallback', {'local':0,'document':N+1}), 0)
check('hit-target contract', solve('hit-target', {'captured':N,'capture_valid':True,'hit':N+1,'capture_owner':'canvas'}), N)
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
nearest contract11Passed
exclude contract33Passed
document contract[{'document': 'a', 'id': 1}, {'document': 'b', 'id': 2}][{'document': 'a', 'id': 1}]Failed
detached contractFalseFalsePassed
fallback contract00Passed
hit-target contract11Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / cac745f173fab7b8636447033c3dc698c51cc266fcedc5dcd478a9f8cee32cea

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 == 'nearest':
        return next((x['id'] for x in p if x['context']),None)
    if action == 'exclude':
        return next((x['id'] for x in p if x['context'] and not x['excluded']),None)
    if action == 'document':
        return [x for x in p['path'] if x['document']!=p['document']]
    if action == 'detached':
        return p['connected'] and p['owner_exists']
    if action == 'fallback':
        return p['local'] if p['local'] is not None else p['document']
    if action == 'hit-target':
        return p['captured'] if p['capture_valid'] else p['hit']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest contract', solve('nearest', [{'id':N,'context':True},{'id':N+1,'context':True}]), N)
check('exclude contract', solve('exclude', [{'id':N,'context':True,'excluded':True},{'id':N+1,'context':False,'excluded':False},{'id':N+2,'context':True,'excluded':False}]), N+2)
check('document contract', solve('document', {'document':'a','path':[{'id':N,'document':'a'},{'id':N+1,'document':'b'}]}), [{'id':N,'document':'a'}])
check('detached contract', solve('detached', {'connected':False,'owner_exists':True,'id':N}), False)
check('fallback contract', solve('fallback', {'local':0,'document':N+1}), 0)
check('hit-target contract', solve('hit-target', {'captured':N,'capture_valid':True,'hit':N+1,'capture_owner':'canvas'}), N)
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
nearest contract11Passed
exclude contract33Passed
document contract[{'document': 'b', 'id': 2}][{'document': 'a', 'id': 1}]Failed
detached contractFalseFalsePassed
fallback contract00Passed
hit-target contract11Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 100e6a097efe8fcaa5d0e008723aa838f48d3aeeacb58cd2d9ef68981d661513

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 == 'nearest':
        return next((x['id'] for x in p if x['context']),None)
    if action == 'exclude':
        return next((x['id'] for x in p if x['context'] and not x['excluded']),None)
    if action == 'document':
        return [x for x in p['path'] if x['document']==p['document']]
    if action == 'detached':
        return p['connected'] and p['owner_exists']
    if action == 'fallback':
        return p['local'] if p['local'] is not None else p['document']
    if action == 'hit-target':
        return p['captured'] if p['capture_valid'] else p['hit']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nearest contract', solve('nearest', [{'id':N,'context':True},{'id':N+1,'context':True}]), N)
check('exclude contract', solve('exclude', [{'id':N,'context':True,'excluded':True},{'id':N+1,'context':False,'excluded':False},{'id':N+2,'context':True,'excluded':False}]), N+2)
check('document contract', solve('document', {'document':'a','path':[{'id':N,'document':'a'},{'id':N+1,'document':'b'}]}), [{'id':N,'document':'a'}])
check('detached contract', solve('detached', {'connected':False,'owner_exists':True,'id':N}), False)
check('fallback contract', solve('fallback', {'local':0,'document':N+1}), 0)
check('hit-target contract', solve('hit-target', {'captured':N,'capture_valid':True,'hit':N+1,'capture_owner':'canvas'}), N)
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
nearest contract11Passed
exclude contract33Passed
document contract[{'document': 'a', 'id': 1}][{'document': 'a', 'id': 1}]Passed
detached contractFalseFalsePassed
fallback contract00Passed
hit-target contract11Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 28b79fd8a0387bbcae7b6edb581aa2b97886e29db0c664846c0810564c809652

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

Case digest / f8c6add51a7e37158517508c30f47f7da69e9e9e51dcee758c58bdbf5b07e17a