FAILURE MAP
← Case archive

FA-33291 / Menu interactions / Open access

Touch submenu Back loses its original document context · case 01

Touch submenu Back loses its original document context.

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

ROOT CAUSE

The touch-submenu-sheet model applies `{'stack':p['stack'][:-1],'context':None}` at its back-context operation instead of the stipulated transformation.

VERIFIED REPAIR

Apply `{'stack':p['stack'][:-1],'context':p['context']}` at back-context.

Unsuccessful approach: The attempted repair `{'stack':p['stack'][:-1],'context':p['ambient']}` still violates the back-context oracle.

Case contract

A compact touch menu displays one submenu sheet at a time with a reversible page stack; dismissal removes the entire stack and back preserves the context.

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 == 'push':
        return p['stack']+[p['page']]
    if action == 'back':
        return p[:-1] if len(p)>1 else p
    if action == 'visible':
        return p[-1:]
    if action == 'dismiss':
        return []
    if action == 'back-context':
        return {'stack':p['stack'][:-1],'context':None}
    if action == 'root-back':
        return 'dismiss' if len(p)==1 else 'pop'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('push contract', solve('push', {'stack':['root'],'page':'child'+str(N)}), ['root','child'+str(N)])
check('back contract', solve('back', ['root','child'+str(N)]), ['root'])
check('visible contract', solve('visible', ['root','child'+str(N)]), ['child'+str(N)])
check('dismiss contract', solve('dismiss', ['root','a','b'+str(N)]), [])
check('back-context contract', solve('back-context', {'stack':['r','a'],'context':N,'ambient':N+1}), {'stack':['r'],'context':N})
check('root-back contract', solve('root-back', ['root'+str(N)]), 'dismiss')
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
push contract['root', 'child1']['root', 'child1']Passed
back contract['root']['root']Passed
visible contract['child1']['child1']Passed
dismiss contract[][]Passed
back-context contract{'context': None, 'stack': ['r']}{'context': 1, 'stack': ['r']}Failed
root-back contractdismissdismissPassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 788f4a4c1533fe4e692d08366118c5e7aab8435a006410320a29ccd63b63c4f3

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 == 'push':
        return p['stack']+[p['page']]
    if action == 'back':
        return p[:-1] if len(p)>1 else p
    if action == 'visible':
        return p[-1:]
    if action == 'dismiss':
        return []
    if action == 'back-context':
        return {'stack':p['stack'][:-1],'context':p['ambient']}
    if action == 'root-back':
        return 'dismiss' if len(p)==1 else 'pop'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('push contract', solve('push', {'stack':['root'],'page':'child'+str(N)}), ['root','child'+str(N)])
check('back contract', solve('back', ['root','child'+str(N)]), ['root'])
check('visible contract', solve('visible', ['root','child'+str(N)]), ['child'+str(N)])
check('dismiss contract', solve('dismiss', ['root','a','b'+str(N)]), [])
check('back-context contract', solve('back-context', {'stack':['r','a'],'context':N,'ambient':N+1}), {'stack':['r'],'context':N})
check('root-back contract', solve('root-back', ['root'+str(N)]), 'dismiss')
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
push contract['root', 'child1']['root', 'child1']Passed
back contract['root']['root']Passed
visible contract['child1']['child1']Passed
dismiss contract[][]Passed
back-context contract{'context': 2, 'stack': ['r']}{'context': 1, 'stack': ['r']}Failed
root-back contractdismissdismissPassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / ef1f271aa9645ea0f7e58133d8f627b662214918f9bc1e410f3ad99e86b8ffa0

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 == 'push':
        return p['stack']+[p['page']]
    if action == 'back':
        return p[:-1] if len(p)>1 else p
    if action == 'visible':
        return p[-1:]
    if action == 'dismiss':
        return []
    if action == 'back-context':
        return {'stack':p['stack'][:-1],'context':p['context']}
    if action == 'root-back':
        return 'dismiss' if len(p)==1 else 'pop'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('push contract', solve('push', {'stack':['root'],'page':'child'+str(N)}), ['root','child'+str(N)])
check('back contract', solve('back', ['root','child'+str(N)]), ['root'])
check('visible contract', solve('visible', ['root','child'+str(N)]), ['child'+str(N)])
check('dismiss contract', solve('dismiss', ['root','a','b'+str(N)]), [])
check('back-context contract', solve('back-context', {'stack':['r','a'],'context':N,'ambient':N+1}), {'stack':['r'],'context':N})
check('root-back contract', solve('root-back', ['root'+str(N)]), 'dismiss')
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
push contract['root', 'child1']['root', 'child1']Passed
back contract['root']['root']Passed
visible contract['child1']['child1']Passed
dismiss contract[][]Passed
back-context contract{'context': 1, 'stack': ['r']}{'context': 1, 'stack': ['r']}Passed
root-back contractdismissdismissPassed
unknown operation{'error': 'unsupported menu operation'}{'error': 'unsupported menu operation'}Passed

SHA-256 / 132b35730e68d499733cf6dbaca7a81ffd87981e65f2995af1eb474295ab635b

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

Case digest / 8a0ae7d755d51036aaa17cb6b663e1cf93a37315ddd46569ec7ff5662a4a905b