{"abstract":"Touch submenu Back loses its original document context.","category":"Menu interactions","checks":7,"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.","evaluation_group":"s3-menu-interactions-touch-submenu-sheet","failed_approach":"The attempted repair `{'stack':p['stack'][:-1],'context':p['ambient']}` still violates the back-context oracle.","family":"s3-menu-interactions-touch-submenu-sheet-back-context","id":"FA-33291","implementations":{"attempt":{"sha256":"ef1f271aa9645ea0f7e58133d8f627b662214918f9bc1e410f3ad99e86b8ffa0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport unicodedata\nN = 1\nobservations = []\ndef solve(action, p):\n    if action == 'push':\n        return p['stack']+[p['page']]\n    if action == 'back':\n        return p[:-1] if len(p)>1 else p\n    if action == 'visible':\n        return p[-1:]\n    if action == 'dismiss':\n        return []\n    if action == 'back-context':\n        return {'stack':p['stack'][:-1],'context':p['ambient']}\n    if action == 'root-back':\n        return 'dismiss' if len(p)==1 else 'pop'\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('push contract', solve('push', {'stack':['root'],'page':'child'+str(N)}), ['root','child'+str(N)])\ncheck('back contract', solve('back', ['root','child'+str(N)]), ['root'])\ncheck('visible contract', solve('visible', ['root','child'+str(N)]), ['child'+str(N)])\ncheck('dismiss contract', solve('dismiss', ['root','a','b'+str(N)]), [])\ncheck('back-context contract', solve('back-context', {'stack':['r','a'],'context':N,'ambient':N+1}), {'stack':['r'],'context':N})\ncheck('root-back contract', solve('root-back', ['root'+str(N)]), 'dismiss')\ncheck('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"788f4a4c1533fe4e692d08366118c5e7aab8435a006410320a29ccd63b63c4f3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport unicodedata\nN = 1\nobservations = []\ndef solve(action, p):\n    if action == 'push':\n        return p['stack']+[p['page']]\n    if action == 'back':\n        return p[:-1] if len(p)>1 else p\n    if action == 'visible':\n        return p[-1:]\n    if action == 'dismiss':\n        return []\n    if action == 'back-context':\n        return {'stack':p['stack'][:-1],'context':None}\n    if action == 'root-back':\n        return 'dismiss' if len(p)==1 else 'pop'\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('push contract', solve('push', {'stack':['root'],'page':'child'+str(N)}), ['root','child'+str(N)])\ncheck('back contract', solve('back', ['root','child'+str(N)]), ['root'])\ncheck('visible contract', solve('visible', ['root','child'+str(N)]), ['child'+str(N)])\ncheck('dismiss contract', solve('dismiss', ['root','a','b'+str(N)]), [])\ncheck('back-context contract', solve('back-context', {'stack':['r','a'],'context':N,'ambient':N+1}), {'stack':['r'],'context':N})\ncheck('root-back contract', solve('root-back', ['root'+str(N)]), 'dismiss')\ncheck('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"132b35730e68d499733cf6dbaca7a81ffd87981e65f2995af1eb474295ab635b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport unicodedata\nN = 1\nobservations = []\ndef solve(action, p):\n    if action == 'push':\n        return p['stack']+[p['page']]\n    if action == 'back':\n        return p[:-1] if len(p)>1 else p\n    if action == 'visible':\n        return p[-1:]\n    if action == 'dismiss':\n        return []\n    if action == 'back-context':\n        return {'stack':p['stack'][:-1],'context':p['context']}\n    if action == 'root-back':\n        return 'dismiss' if len(p)==1 else 'pop'\n    return {'error': 'unsupported menu operation'}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('push contract', solve('push', {'stack':['root'],'page':'child'+str(N)}), ['root','child'+str(N)])\ncheck('back contract', solve('back', ['root','child'+str(N)]), ['root'])\ncheck('visible contract', solve('visible', ['root','child'+str(N)]), ['child'+str(N)])\ncheck('dismiss contract', solve('dismiss', ['root','a','b'+str(N)]), [])\ncheck('back-context contract', solve('back-context', {'stack':['r','a'],'context':N,'ambient':N+1}), {'stack':['r'],'context':N})\ncheck('root-back contract', solve('root-back', ['root'+str(N)]), 'dismiss')\ncheck('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-menu-interactions-touch-submenu-sheet-back-context","generated_at":"2026-09-29T14:42:20.891577+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Cascading and context menus require coherent command and session state as content changes.","repair":"Apply `{'stack':p['stack'][:-1],'context':p['context']}` at back-context.","root_cause":"The touch-submenu-sheet model applies `{'stack':p['stack'][:-1],'context':None}` at its back-context operation instead of the stipulated transformation.","sha256":"8a0ae7d755d51036aaa17cb6b663e1cf93a37315ddd46569ec7ff5662a4a905b","title":"Touch submenu Back loses its original document context · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":47.746,"exit_code":1,"observations":[{"actual":["root","child1"],"check":"push contract","expected":["root","child1"],"passed":true},{"actual":["root"],"check":"back contract","expected":["root"],"passed":true},{"actual":["child1"],"check":"visible contract","expected":["child1"],"passed":true},{"actual":[],"check":"dismiss contract","expected":[],"passed":true},{"actual":{"context":2,"stack":["r"]},"check":"back-context contract","expected":{"context":1,"stack":["r"]},"passed":false},{"actual":"dismiss","check":"root-back contract","expected":"dismiss","passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"push contract\", \"actual\": [\"root\", \"child1\"], \"expected\": [\"root\", \"child1\"], \"passed\": true}, {\"check\": \"back contract\", \"actual\": [\"root\"], \"expected\": [\"root\"], \"passed\": true}, {\"check\": \"visible contract\", \"actual\": [\"child1\"], \"expected\": [\"child1\"], \"passed\": true}, {\"check\": \"dismiss contract\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"back-context contract\", \"actual\": {\"stack\": [\"r\"], \"context\": 2}, \"expected\": {\"stack\": [\"r\"], \"context\": 1}, \"passed\": false}, {\"check\": \"root-back contract\", \"actual\": \"dismiss\", \"expected\": \"dismiss\", \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.924,"exit_code":1,"observations":[{"actual":["root","child1"],"check":"push contract","expected":["root","child1"],"passed":true},{"actual":["root"],"check":"back contract","expected":["root"],"passed":true},{"actual":["child1"],"check":"visible contract","expected":["child1"],"passed":true},{"actual":[],"check":"dismiss contract","expected":[],"passed":true},{"actual":{"context":null,"stack":["r"]},"check":"back-context contract","expected":{"context":1,"stack":["r"]},"passed":false},{"actual":"dismiss","check":"root-back contract","expected":"dismiss","passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"push contract\", \"actual\": [\"root\", \"child1\"], \"expected\": [\"root\", \"child1\"], \"passed\": true}, {\"check\": \"back contract\", \"actual\": [\"root\"], \"expected\": [\"root\"], \"passed\": true}, {\"check\": \"visible contract\", \"actual\": [\"child1\"], \"expected\": [\"child1\"], \"passed\": true}, {\"check\": \"dismiss contract\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"back-context contract\", \"actual\": {\"stack\": [\"r\"], \"context\": null}, \"expected\": {\"stack\": [\"r\"], \"context\": 1}, \"passed\": false}, {\"check\": \"root-back contract\", \"actual\": \"dismiss\", \"expected\": \"dismiss\", \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.784,"exit_code":0,"observations":[{"actual":["root","child1"],"check":"push contract","expected":["root","child1"],"passed":true},{"actual":["root"],"check":"back contract","expected":["root"],"passed":true},{"actual":["child1"],"check":"visible contract","expected":["child1"],"passed":true},{"actual":[],"check":"dismiss contract","expected":[],"passed":true},{"actual":{"context":1,"stack":["r"]},"check":"back-context contract","expected":{"context":1,"stack":["r"]},"passed":true},{"actual":"dismiss","check":"root-back contract","expected":"dismiss","passed":true},{"actual":{"error":"unsupported menu operation"},"check":"unknown operation","expected":{"error":"unsupported menu operation"},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"push contract\", \"actual\": [\"root\", \"child1\"], \"expected\": [\"root\", \"child1\"], \"passed\": true}, {\"check\": \"back contract\", \"actual\": [\"root\"], \"expected\": [\"root\"], \"passed\": true}, {\"check\": \"visible contract\", \"actual\": [\"child1\"], \"expected\": [\"child1\"], \"passed\": true}, {\"check\": \"dismiss contract\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"back-context contract\", \"actual\": {\"stack\": [\"r\"], \"context\": 1}, \"expected\": {\"stack\": [\"r\"], \"context\": 1}, \"passed\": true}, {\"check\": \"root-back contract\", \"actual\": \"dismiss\", \"expected\": \"dismiss\", \"passed\": true}, {\"check\": \"unknown operation\", \"actual\": {\"error\": \"unsupported menu operation\"}, \"expected\": {\"error\": \"unsupported menu operation\"}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}