FAILURE MAP
← Case archive

FA-32771 / Menu interactions / Open access

Clipped submenu chooses the smaller side when neither side fits · case 01

Clipped submenu chooses the smaller side when neither side fits.

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

ROOT CAUSE

The submenu-edge-placement model applies `'right'` at its side operation instead of the stipulated transformation.

THE FAILURE

The submenu-edge-placement model applies `'right'` at its side operation instead of the stipulated transformation.

Unsuccessful approach: The attempted repair `'left' if p['right']<p['width'] else 'right'` still violates the side oracle.

Case contract

Submenu placement uses owner edges, overlap compensation, available side space and root-relative coordinates under a stipulated rectangular layout.

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 == 'right':
        return p['x']+p['width']-p['overlap']
    if action == 'left':
        return p['x']-p['submenu']+p['overlap']
    if action == 'side':
        return 'right'
    if action == 'row-align':
        return p['row_y']-p['padding']
    if action == 'root-relative':
        return [p['screen'][0]-p['root'][0],p['screen'][1]-p['root'][1]]
    if action == 'gap-hit':
        return p['owner_right']<=p['x']<=p['menu_left'] and p['top']<=p['y']<=p['bottom']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('right contract', solve('right', {'x':N,'width':20,'overlap':2}), N+18)
check('left contract', solve('left', {'x':N+30,'submenu':10,'overlap':2}), N+22)
check('side contract', solve('side', {'right':N+5,'left':N+2,'width':N+10}), 'right')
check('row-align contract', solve('row-align', {'row_y':N+20,'padding':3}), N+17)
check('root-relative contract', solve('root-relative', {'screen':[10*N,20*N],'root':[N,2*N]}), [9*N,18*N])
check('gap-hit contract', solve('gap-hit', {'owner_right':N+5,'menu_left':N+8,'x':N,'top':0,'bottom':10,'y':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('only left fits',solve('side',{'right':N,'left':N+10,'width':N+5}),'left')
check('bridge vertical miss',solve('gap-hit',{'owner_right':N,'menu_left':N+4,'x':N+2,'top':3,'bottom':8,'y':10}),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
right contract1919Passed
left contract2323Passed
side contractrightrightPassed
row-align contract1818Passed
root-relative contract[9, 18][9, 18]Passed
gap-hit contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
only left fitsrightleftFailed
bridge vertical missFalseFalsePassed

SHA-256 / 589b2eb58456ea988819b54fc262542c09001f3e20d3e28d7c4fb2c7db8a35da

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 == 'right':
        return p['x']+p['width']-p['overlap']
    if action == 'left':
        return p['x']-p['submenu']+p['overlap']
    if action == 'side':
        return 'left' if p['right']<p['width'] else 'right'
    if action == 'row-align':
        return p['row_y']-p['padding']
    if action == 'root-relative':
        return [p['screen'][0]-p['root'][0],p['screen'][1]-p['root'][1]]
    if action == 'gap-hit':
        return p['owner_right']<=p['x']<=p['menu_left'] and p['top']<=p['y']<=p['bottom']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('right contract', solve('right', {'x':N,'width':20,'overlap':2}), N+18)
check('left contract', solve('left', {'x':N+30,'submenu':10,'overlap':2}), N+22)
check('side contract', solve('side', {'right':N+5,'left':N+2,'width':N+10}), 'right')
check('row-align contract', solve('row-align', {'row_y':N+20,'padding':3}), N+17)
check('root-relative contract', solve('root-relative', {'screen':[10*N,20*N],'root':[N,2*N]}), [9*N,18*N])
check('gap-hit contract', solve('gap-hit', {'owner_right':N+5,'menu_left':N+8,'x':N,'top':0,'bottom':10,'y':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('only left fits',solve('side',{'right':N,'left':N+10,'width':N+5}),'left')
check('bridge vertical miss',solve('gap-hit',{'owner_right':N,'menu_left':N+4,'x':N+2,'top':3,'bottom':8,'y':10}),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
right contract1919Passed
left contract2323Passed
side contractleftrightFailed
row-align contract1818Passed
root-relative contract[9, 18][9, 18]Passed
gap-hit contractFalseFalsePassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed
only left fitsleftleftPassed
bridge vertical missFalseFalsePassed

SHA-256 / 30b4c938e7ee3f990e28e2ab766bd9de78eba43803a3af098a37c514be651a68

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 9 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:15.683367+00:00.

Case digest / 5fc84f40cd97dc29cfd1e57e0b77d98a17b592f5179514f34bdaf4a1750a3fdc