FA-33421 / Menu interactions / Open access
Before-anchor contribution is placed after its menu anchor · case 01
Before-anchor contribution is placed after its menu anchor.
ROOT CAUSE
The contribution-anchors model applies `p['rows']+[p['id']]` at its before operation instead of the stipulated transformation.
VERIFIED REPAIR
Apply `p['rows'][:p['rows'].index(p['anchor'])]+[p['id']]+p['rows'][p['rows'].index(p['anchor']):]` at before.
Unsuccessful approach: The attempted repair `p['rows'][:p['rows'].index(p['anchor'])+1]+[p['id']]+p['rows'][p['rows'].index(p['anchor'])+1:]` still violates the before oracle.
Case contract
Menu contribution placement uses named before/after anchors and stable fallback slots; the before anchor owns precedence when both are supplied.
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 == 'before':
return p['rows']+[p['id']]
if action == 'fallback-slot':
return p['slots'].get(p['requested'],p['slots']['default'])
if action == 'anchor-owner':
return (p['provider'],p['local'])
if action == 'before-precedence':
return p['before'] if p['before'] is not None else p['after']
if action == 'batch-order':
return p['rows'][:p['at']]+p['batch']+p['rows'][p['at']:]
if action == 'self-anchor':
return p['id']!=p['anchor']
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('before contract', solve('before', {'rows':['a','b'],'anchor':'b','id':N}), ['a',N,'b'])
check('fallback-slot contract', solve('fallback-slot', {'requested':'missing','slots':{'default':N+4,'start':0}}), N+4)
check('anchor-owner contract', solve('anchor-owner', {'provider':'p'+str(N),'local':'tools'}), ('p'+str(N),'tools'))
check('before-precedence contract', solve('before-precedence', {'before':N,'after':N+1}), N)
check('batch-order contract', solve('batch-order', {'rows':['a','b'],'at':1,'batch':[N,N+1]}), ['a',N,N+1,'b'])
check('self-anchor contract', solve('self-anchor', {'id':N,'anchor':N,'registered':[N]}), False)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| before contract | ['a', 'b', 1] | ['a', 1, 'b'] | Failed |
| fallback-slot contract | 5 | 5 | Passed |
| anchor-owner contract | ['p1', 'tools'] | ['p1', 'tools'] | Passed |
| before-precedence contract | 1 | 1 | Passed |
| batch-order contract | ['a', 1, 2, 'b'] | ['a', 1, 2, 'b'] | Passed |
| self-anchor contract | False | False | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 3f3e1db9a42716caac7d43fff1e53a262312c5f7f66992288d8aeeb1cca21c40
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 == 'before':
return p['rows'][:p['rows'].index(p['anchor'])+1]+[p['id']]+p['rows'][p['rows'].index(p['anchor'])+1:]
if action == 'fallback-slot':
return p['slots'].get(p['requested'],p['slots']['default'])
if action == 'anchor-owner':
return (p['provider'],p['local'])
if action == 'before-precedence':
return p['before'] if p['before'] is not None else p['after']
if action == 'batch-order':
return p['rows'][:p['at']]+p['batch']+p['rows'][p['at']:]
if action == 'self-anchor':
return p['id']!=p['anchor']
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('before contract', solve('before', {'rows':['a','b'],'anchor':'b','id':N}), ['a',N,'b'])
check('fallback-slot contract', solve('fallback-slot', {'requested':'missing','slots':{'default':N+4,'start':0}}), N+4)
check('anchor-owner contract', solve('anchor-owner', {'provider':'p'+str(N),'local':'tools'}), ('p'+str(N),'tools'))
check('before-precedence contract', solve('before-precedence', {'before':N,'after':N+1}), N)
check('batch-order contract', solve('batch-order', {'rows':['a','b'],'at':1,'batch':[N,N+1]}), ['a',N,N+1,'b'])
check('self-anchor contract', solve('self-anchor', {'id':N,'anchor':N,'registered':[N]}), False)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| before contract | ['a', 'b', 1] | ['a', 1, 'b'] | Failed |
| fallback-slot contract | 5 | 5 | Passed |
| anchor-owner contract | ['p1', 'tools'] | ['p1', 'tools'] | Passed |
| before-precedence contract | 1 | 1 | Passed |
| batch-order contract | ['a', 1, 2, 'b'] | ['a', 1, 2, 'b'] | Passed |
| self-anchor contract | False | False | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 8bd2032c8a3fed14c7738c79a68f29038df6f97a0a92406f8d2b78f451e64d5a
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 == 'before':
return p['rows'][:p['rows'].index(p['anchor'])]+[p['id']]+p['rows'][p['rows'].index(p['anchor']):]
if action == 'fallback-slot':
return p['slots'].get(p['requested'],p['slots']['default'])
if action == 'anchor-owner':
return (p['provider'],p['local'])
if action == 'before-precedence':
return p['before'] if p['before'] is not None else p['after']
if action == 'batch-order':
return p['rows'][:p['at']]+p['batch']+p['rows'][p['at']:]
if action == 'self-anchor':
return p['id']!=p['anchor']
return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('before contract', solve('before', {'rows':['a','b'],'anchor':'b','id':N}), ['a',N,'b'])
check('fallback-slot contract', solve('fallback-slot', {'requested':'missing','slots':{'default':N+4,'start':0}}), N+4)
check('anchor-owner contract', solve('anchor-owner', {'provider':'p'+str(N),'local':'tools'}), ('p'+str(N),'tools'))
check('before-precedence contract', solve('before-precedence', {'before':N,'after':N+1}), N)
check('batch-order contract', solve('batch-order', {'rows':['a','b'],'at':1,'batch':[N,N+1]}), ['a',N,N+1,'b'])
check('self-anchor contract', solve('self-anchor', {'id':N,'anchor':N,'registered':[N]}), False)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| before contract | ['a', 1, 'b'] | ['a', 1, 'b'] | Passed |
| fallback-slot contract | 5 | 5 | Passed |
| anchor-owner contract | ['p1', 'tools'] | ['p1', 'tools'] | Passed |
| before-precedence contract | 1 | 1 | Passed |
| batch-order contract | ['a', 1, 2, 'b'] | ['a', 1, 2, 'b'] | Passed |
| self-anchor contract | False | False | Passed |
| unknown operation | {'error': 'unsupported menu operation'} | {'error': 'unsupported menu operation'} | Passed |
SHA-256 / 0614ffda1ef68fe8a39545107f5555f7a85446f2168eab25c02a22e423d50f89
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.213744+00:00.
Case digest / 1d10438e7d2ffe2066287a7b926c96ad8beb3f4566c31f61b804e653a2264828