FA-33416 / Menu interactions / Open access
Menu patch revision advances once per operation instead of commit · case 01
Menu patch revision advances once per operation instead of commit.
ROOT CAUSE
The menu-patch-transaction model applies `p['base']+1` at its revision-step operation instead of the stipulated transformation.
VERIFIED REPAIR
Apply `p['base']+int(p['committed'])` at revision-step.
Unsuccessful approach: The attempted repair `p['base']+p['operation_count']` still violates the revision-step oracle.
Case contract
Provider menu patches apply to one base revision atomically; row edits use stable IDs and insertion anchors, while missing anchors reject the patch.
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 == 'base':
return p['base']==p['revision']
if action == 'insert-after':
return p['rows'][:p['rows'].index(p['anchor'])+1]+[p['new']]+p['rows'][p['rows'].index(p['anchor'])+1:]
if action == 'missing-anchor':
return 'reject' if p['anchor'] not in p['rows'] else 'apply'
if action == 'rollback':
return p['before'] if p['failed'] else p['working']
if action == 'replace-kind':
return dict(p['replacement'],id=p['old']['id'])
if action == 'revision-step':
return p['base']+1
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('base contract', solve('base', {'base':N,'revision':N+1}), False)
check('insert-after contract', solve('insert-after', {'rows':['a','b'],'anchor':'a','new':N}), ['a',N,'b'])
check('missing-anchor contract', solve('missing-anchor', {'rows':[N],'anchor':N+1}), 'reject')
check('rollback contract', solve('rollback', {'before':[N,N+1],'working':[N+2],'failed':True}), [N,N+1])
check('replace-kind contract', solve('replace-kind', {'old':{'id':N,'kind':'command','handler':'old'},'replacement':{'kind':'submenu','children':[N+1]}}), {'id':N,'kind':'submenu','children':[N+1]})
check('revision-step contract', solve('revision-step', {'base':N,'committed':True,'operation_count':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('failed patch retains revision',solve('revision-step',{'base':N,'committed':False,'operation_count':2}),N)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| base contract | False | False | Passed |
| insert-after contract | ['a', 1, 'b'] | ['a', 1, 'b'] | Passed |
| missing-anchor contract | reject | reject | Passed |
| rollback contract | [1, 2] | [1, 2] | Passed |
| replace-kind contract | {'children': [2], 'id': 1, 'kind': 'submenu'} | {'children': [2], 'id': 1, 'kind': 'submenu'} | Passed |
| revision-step contract | 2 | 2 | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
| failed patch retains revision | 2 | 1 | Failed |
SHA-256 / 5c5e73c98306969307f9bde6383bfff302f068d6c0c97e915a639d2a5e6ddb03
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 == 'base':
return p['base']==p['revision']
if action == 'insert-after':
return p['rows'][:p['rows'].index(p['anchor'])+1]+[p['new']]+p['rows'][p['rows'].index(p['anchor'])+1:]
if action == 'missing-anchor':
return 'reject' if p['anchor'] not in p['rows'] else 'apply'
if action == 'rollback':
return p['before'] if p['failed'] else p['working']
if action == 'replace-kind':
return dict(p['replacement'],id=p['old']['id'])
if action == 'revision-step':
return p['base']+p['operation_count']
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('base contract', solve('base', {'base':N,'revision':N+1}), False)
check('insert-after contract', solve('insert-after', {'rows':['a','b'],'anchor':'a','new':N}), ['a',N,'b'])
check('missing-anchor contract', solve('missing-anchor', {'rows':[N],'anchor':N+1}), 'reject')
check('rollback contract', solve('rollback', {'before':[N,N+1],'working':[N+2],'failed':True}), [N,N+1])
check('replace-kind contract', solve('replace-kind', {'old':{'id':N,'kind':'command','handler':'old'},'replacement':{'kind':'submenu','children':[N+1]}}), {'id':N,'kind':'submenu','children':[N+1]})
check('revision-step contract', solve('revision-step', {'base':N,'committed':True,'operation_count':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('failed patch retains revision',solve('revision-step',{'base':N,'committed':False,'operation_count':2}),N)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| base contract | False | False | Passed |
| insert-after contract | ['a', 1, 'b'] | ['a', 1, 'b'] | Passed |
| missing-anchor contract | reject | reject | Passed |
| rollback contract | [1, 2] | [1, 2] | Passed |
| replace-kind contract | {'children': [2], 'id': 1, 'kind': 'submenu'} | {'children': [2], 'id': 1, 'kind': 'submenu'} | Passed |
| revision-step contract | 4 | 2 | Failed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
| failed patch retains revision | 3 | 1 | Failed |
SHA-256 / 0625aea036677c283f99e0f2a47512866f00b88c7630f121344d4026b0abfaa5
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 == 'base':
return p['base']==p['revision']
if action == 'insert-after':
return p['rows'][:p['rows'].index(p['anchor'])+1]+[p['new']]+p['rows'][p['rows'].index(p['anchor'])+1:]
if action == 'missing-anchor':
return 'reject' if p['anchor'] not in p['rows'] else 'apply'
if action == 'rollback':
return p['before'] if p['failed'] else p['working']
if action == 'replace-kind':
return dict(p['replacement'],id=p['old']['id'])
if action == 'revision-step':
return p['base']+int(p['committed'])
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('base contract', solve('base', {'base':N,'revision':N+1}), False)
check('insert-after contract', solve('insert-after', {'rows':['a','b'],'anchor':'a','new':N}), ['a',N,'b'])
check('missing-anchor contract', solve('missing-anchor', {'rows':[N],'anchor':N+1}), 'reject')
check('rollback contract', solve('rollback', {'before':[N,N+1],'working':[N+2],'failed':True}), [N,N+1])
check('replace-kind contract', solve('replace-kind', {'old':{'id':N,'kind':'command','handler':'old'},'replacement':{'kind':'submenu','children':[N+1]}}), {'id':N,'kind':'submenu','children':[N+1]})
check('revision-step contract', solve('revision-step', {'base':N,'committed':True,'operation_count':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('failed patch retains revision',solve('revision-step',{'base':N,'committed':False,'operation_count':2}),N)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| base contract | False | False | Passed |
| insert-after contract | ['a', 1, 'b'] | ['a', 1, 'b'] | Passed |
| missing-anchor contract | reject | reject | Passed |
| rollback contract | [1, 2] | [1, 2] | Passed |
| replace-kind contract | {'children': [2], 'id': 1, 'kind': 'submenu'} | {'children': [2], 'id': 1, 'kind': 'submenu'} | Passed |
| revision-step contract | 2 | 2 | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
| failed patch retains revision | 1 | 1 | Passed |
SHA-256 / 4341cb1e599737923927c9d3369e6fa374b1b9fe48279893021dda6e66841324
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:22.140589+00:00.
Case digest / ab6ae55da4ec239b0d0c2822e90d164fbc2d2a368012bcf46c5f2296837ce071