FAILURE MAP
← Case archive

FA-33351 / Menu interactions / Open access

Incomplete marking gesture executes a branch-only menu item · case 01

Incomplete marking gesture executes a branch-only menu item.

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

ROOT CAUSE

The marking-menu-gesture model applies `p['complete']` at its leaf-required operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `p['kind']=='command' and p['complete']` at leaf-required.

Unsuccessful approach: The attempted repair `p['kind']=='command'` still violates the leaf-required oracle.

Case contract

A marking menu resolves completed directional strokes after sufficient displacement. Cardinal directions are 0..3; an opposite segment retraces one level, and subthreshold tail jitter preserves the completed sector.

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 == 'origin':
        return [p['end'][0]-p['start'][0],p['end'][1]-p['start'][1]]
    if action == 'threshold':
        return p['dx']**2+p['dy']**2>=p['threshold']**2
    if action == 'retrace':
        return p['segments'][:-1] if p['direction']==(p['segments'][-1]+2)%4 else p['segments']+[p['direction']]
    if action == 'segment-reset':
        return p['turn'][:]
    if action == 'leaf-required':
        return p['complete']
    if action == 'trailing-jitter':
        return p['completed'][-1] if p['tail_distance']<p['threshold'] else p['tail_sector']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('origin contract', solve('origin', {'start':[N,N+1],'end':[N+3,N+5]}), [3,4])
check('threshold contract', solve('threshold', {'dx':3*N,'dy':4*N,'threshold':6*N}), False)
check('retrace contract', solve('retrace', {'segments':[N%4,(N+1)%4,(N+2)%4],'direction':N%4}), [N%4,(N+1)%4])
check('segment-reset contract', solve('segment-reset', {'turn':[N+2,N+3],'original':[0,0],'last':[N+5,N+6]}), [N+2,N+3])
check('leaf-required contract', solve('leaf-required', {'kind':'submenu','complete':True,'sector':N}), False)
check('trailing-jitter contract', solve('trailing-jitter', {'completed':[N,N+1],'tail_sector':N+2,'tail_distance':1,'threshold':5}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('incomplete command stroke',solve('leaf-required',{'kind':'command','complete':False,'sector':N}),False)
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
origin contract[3, 4][3, 4]Passed
threshold contractFalseFalsePassed
retrace contract[1, 2][1, 2]Passed
segment-reset contract[3, 4][3, 4]Passed
leaf-required contractTrueFalseFailed
trailing-jitter contract22Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
incomplete command strokeFalseFalsePassed

SHA-256 / 281004f1fc80018dfdcbfee14f01410dee2f09a0eacb90636369987ca6d9f9db

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 == 'origin':
        return [p['end'][0]-p['start'][0],p['end'][1]-p['start'][1]]
    if action == 'threshold':
        return p['dx']**2+p['dy']**2>=p['threshold']**2
    if action == 'retrace':
        return p['segments'][:-1] if p['direction']==(p['segments'][-1]+2)%4 else p['segments']+[p['direction']]
    if action == 'segment-reset':
        return p['turn'][:]
    if action == 'leaf-required':
        return p['kind']=='command'
    if action == 'trailing-jitter':
        return p['completed'][-1] if p['tail_distance']<p['threshold'] else p['tail_sector']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('origin contract', solve('origin', {'start':[N,N+1],'end':[N+3,N+5]}), [3,4])
check('threshold contract', solve('threshold', {'dx':3*N,'dy':4*N,'threshold':6*N}), False)
check('retrace contract', solve('retrace', {'segments':[N%4,(N+1)%4,(N+2)%4],'direction':N%4}), [N%4,(N+1)%4])
check('segment-reset contract', solve('segment-reset', {'turn':[N+2,N+3],'original':[0,0],'last':[N+5,N+6]}), [N+2,N+3])
check('leaf-required contract', solve('leaf-required', {'kind':'submenu','complete':True,'sector':N}), False)
check('trailing-jitter contract', solve('trailing-jitter', {'completed':[N,N+1],'tail_sector':N+2,'tail_distance':1,'threshold':5}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('incomplete command stroke',solve('leaf-required',{'kind':'command','complete':False,'sector':N}),False)
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
origin contract[3, 4][3, 4]Passed
threshold contractFalseFalsePassed
retrace contract[1, 2][1, 2]Passed
segment-reset contract[3, 4][3, 4]Passed
leaf-required contractFalseFalsePassed
trailing-jitter contract22Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
incomplete command strokeTrueFalseFailed

SHA-256 / 4ff283f50c68313c6578286a6db28d951caaa7520dfec639100ae68a62c71096

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 == 'origin':
        return [p['end'][0]-p['start'][0],p['end'][1]-p['start'][1]]
    if action == 'threshold':
        return p['dx']**2+p['dy']**2>=p['threshold']**2
    if action == 'retrace':
        return p['segments'][:-1] if p['direction']==(p['segments'][-1]+2)%4 else p['segments']+[p['direction']]
    if action == 'segment-reset':
        return p['turn'][:]
    if action == 'leaf-required':
        return p['kind']=='command' and p['complete']
    if action == 'trailing-jitter':
        return p['completed'][-1] if p['tail_distance']<p['threshold'] else p['tail_sector']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('origin contract', solve('origin', {'start':[N,N+1],'end':[N+3,N+5]}), [3,4])
check('threshold contract', solve('threshold', {'dx':3*N,'dy':4*N,'threshold':6*N}), False)
check('retrace contract', solve('retrace', {'segments':[N%4,(N+1)%4,(N+2)%4],'direction':N%4}), [N%4,(N+1)%4])
check('segment-reset contract', solve('segment-reset', {'turn':[N+2,N+3],'original':[0,0],'last':[N+5,N+6]}), [N+2,N+3])
check('leaf-required contract', solve('leaf-required', {'kind':'submenu','complete':True,'sector':N}), False)
check('trailing-jitter contract', solve('trailing-jitter', {'completed':[N,N+1],'tail_sector':N+2,'tail_distance':1,'threshold':5}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('incomplete command stroke',solve('leaf-required',{'kind':'command','complete':False,'sector':N}),False)
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
origin contract[3, 4][3, 4]Passed
threshold contractFalseFalsePassed
retrace contract[1, 2][1, 2]Passed
segment-reset contract[3, 4][3, 4]Passed
leaf-required contractFalseFalsePassed
trailing-jitter contract22Passed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
incomplete command strokeFalseFalsePassed

SHA-256 / 8825f271e7984158afaa648db7b5f78eade2a1706266fa4e3251b67f17ce1888

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

Case digest / e8c714766357b1d7694ffea293932284d1251fae48bf7af394f0f80f9a90b5ea