broken_source:
"""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 '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)

source:
"""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 'append' 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)

prompt:
Menu patch silently appends content after its anchor disappeared.

Provider menu patches apply to one base revision atomically; row edits use stable IDs and insertion anchors, while missing anchors reject the patch.

split: open-access


broken_source:
"""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['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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""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 [] 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)

prompt:
Failed provider menu patch leaks partial row mutations.

Provider menu patches apply to one base revision atomically; row edits use stable IDs and insertion anchors, while missing anchors reject the patch.

split: open-access


broken_source:
"""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['old'],**p['replacement'])
    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)

source:
"""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 p['old']
    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)

prompt:
Changing submenu row kind retains obsolete command fields.

Provider menu patches apply to one base revision atomically; row edits use stable IDs and insertion anchors, while missing anchors reject the patch.

split: open-access


broken_source:
"""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)

source:
"""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)

prompt:
Menu patch revision advances once per operation instead of commit.

Provider menu patches apply to one base revision atomically; row edits use stable IDs and insertion anchors, while missing anchors reject the patch.

split: open-access


broken_source:
"""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)

source:
"""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)

prompt:
Before-anchor contribution is placed after its menu anchor.

Menu contribution placement uses named before/after anchors and stable fallback slots; the before anchor owns precedence when both are supplied.

split: open-access


broken_source:
"""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 0
    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)

source:
"""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'],len(p['slots']))
    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)

prompt:
Unresolved menu contribution anchor ignores the default slot.

Menu contribution placement uses named before/after anchors and stable fallback slots; the before anchor owns precedence when both are supplied.

split: open-access


broken_source:
"""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['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)

source:
"""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']
    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)

prompt:
Menu contribution anchor loses provider namespace identity.

Menu contribution placement uses named before/after anchors and stable fallback slots; the before anchor owns precedence when both are supplied.

split: open-access


broken_source:
"""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['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)

source:
"""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 None
    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)

prompt:
Conflicting menu placement hints ignore before-anchor precedence.

Menu contribution placement uses named before/after anchors and stable fallback slots; the before anchor owns precedence when both are supplied.

split: open-access


broken_source:
"""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']]+list(reversed(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)

source:
"""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['batch']+p['rows']
    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)

prompt:
Sequential anchor insertion reverses contributed menu rows.

Menu contribution placement uses named before/after anchors and stable fallback slots; the before anchor owns precedence when both are supplied.

split: open-access


broken_source:
"""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 True
    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)

source:
"""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'] in p['registered']
    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)

prompt:
Menu contribution accepts itself as its placement anchor.

Menu contribution placement uses named before/after anchors and stable fallback slots; the before anchor owns precedence when both are supplied.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened']
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

prompt:
No-op menu open transition emits duplicate opened events.

Menu lifecycle notifications report committed transitions once, retain close reasons, and deliver descendant closure before parent closure.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return 'dismiss'
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['previous_reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

prompt:
Menu close notification replaces a command close reason with dismissal.

Menu lifecycle notifications report committed transitions once, retain close reasons, and deliver descendant closure before parent closure.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return p
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return p[:1]
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

prompt:
Parent menu close notification precedes its owned descendants.

Menu lifecycle notifications report committed transitions once, retain close reasons, and deliver descendant closure before parent closure.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return ['closed'] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

prompt:
Vetoed menu opening emits an opened or closed notification.

Menu lifecycle notifications report committed transitions once, retain close reasons, and deliver descendant closure before parent closure.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['root'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':None}
    if action == 'unmount-reason':
        return 'owner-removed'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

prompt:
Menu lifecycle event attributes a child transition to the root owner.

Menu lifecycle notifications report committed transitions once, retain close reasons, and deliver descendant closure before parent closure.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return p['last_reason']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'open-event':
        return ['opened'] if not p['before'] and p['after'] else []
    if action == 'close-reason':
        return p['reason']
    if action == 'close-order':
        return list(reversed(p))
    if action == 'cancel-open':
        return [] if p['prevented'] else ['opened']
    if action == 'event-context':
        return {'session':p['session'],'owner':p['owner'],'reason':p['reason']}
    if action == 'unmount-reason':
        return 'command'
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('open-event contract', solve('open-event', {'before':True,'after':True,'session':N}), [])
check('close-reason contract', solve('close-reason', {'reason':'command'+str(N),'previous_reason':'outside'}), 'command'+str(N))
check('close-order contract', solve('close-order', ['root','child'+str(N)]), ['child'+str(N),'root'])
check('cancel-open contract', solve('cancel-open', {'prevented':True,'session':N}), [])
check('event-context contract', solve('event-context', {'session':N,'owner':'child','root':'root','reason':'replace'}), {'session':N,'owner':'child','reason':'replace'})
check('unmount-reason contract', solve('unmount-reason', {'last_reason':'outside'+str(N)}), 'owner-removed')
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)

prompt:
Owner removal reuses the previous menu close reason.

Menu lifecycle notifications report committed transitions once, retain close reasons, and deliver descendant closure before parent closure.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain']
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

prompt:
Branch-scoped menu command closes the entire menu session.

Menu dismissal reasons map to explicit close scopes; command completion, owner removal and outside dismissal do not share a universal policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] or not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

prompt:
Vetoed menu dismissal still removes the popup.

Menu dismissal reasons map to explicit close scopes; command completion, owner removal and outside dismissal do not share a universal policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] and not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

prompt:
Dismissal veto leaves a menu attached to a removed owner.

Menu dismissal reasons map to explicit close scopes; command completion, owner removal and outside dismissal do not share a universal policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return p[0]
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return p[-1]
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

prompt:
Simultaneous menu dismissal reasons use arrival order instead of policy.

Menu dismissal reasons map to explicit close scopes; command completion, owner removal and outside dismissal do not share a universal policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='command' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

prompt:
Menu ownership transfer cancels an intentionally retained command.

Menu dismissal reasons map to explicit close scopes; command completion, owner removal and outside dismissal do not share a universal policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'leaf-scope':
        return p['chain'][:p['depth']] if p['scope']=='branch' else []
    if action == 'veto':
        return p['requested'] and not p['vetoed']
    if action == 'mandatory-teardown':
        return p['owner_removed'] or not p['vetoed']
    if action == 'reason-priority':
        return next(x for x in ['owner-removed','command','outside'] if x in p)
    if action == 'pending-command':
        return p['pending'] if p['reason']=='transfer' else []
    if action == 'nested-boundary':
        return p['chain'][:p['boundary']+1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('leaf-scope contract', solve('leaf-scope', {'chain':['root','sub',str(N)],'depth':1,'scope':'branch'}), ['root'])
check('veto contract', solve('veto', {'requested':True,'vetoed':True,'owner':N}), False)
check('mandatory-teardown contract', solve('mandatory-teardown', {'owner_removed':True,'vetoed':True,'id':N}), True)
check('reason-priority contract', solve('reason-priority', ['outside','owner-removed','command']), 'owner-removed')
check('pending-command contract', solve('pending-command', {'pending':[N],'reason':'transfer'}), [N])
check('nested-boundary contract', solve('nested-boundary', {'chain':['outer','local','child'+str(N)],'boundary':1}), ['outer'])
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)

prompt:
Scoped context menu dismissal crosses its declared root boundary.

Menu dismissal reasons map to explicit close scopes; command completion, owner removal and outside dismissal do not share a universal policy.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'intersection':
        return sorted(set.union(*(set(x) for x in p))) if p else []
    if action == 'eligible-order':
        return [x['id'] for x in p if x['eligible']]
    if action == 'noop-split':
        return {'run':[x['id'] for x in p if x['change']], 'noop':[x['id'] for x in p if not x['change']]}
    if action == 'duplicate-doc':
        return list(dict.fromkeys(p))
    if action == 'partial-policy':
        return p['supported'] if p['allow_partial'] else (p['supported'] if not p['unsupported'] else [])
    if action == 'summary':
        return {'requested':len(p['requested']),'runnable':len(p['runnable'])}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intersection contract', solve('intersection', [['open','edit'+str(N)],['open','print']]), ['open'])
check('eligible-order contract', solve('eligible-order', [{'id':N+2,'eligible':True},{'id':N,'eligible':True},{'id':N+1,'eligible':False}]), [N+2,N])
check('noop-split contract', solve('noop-split', [{'id':N,'change':False},{'id':N+1,'change':True}]), {'run':[N+1],'noop':[N]})
check('duplicate-doc contract', solve('duplicate-doc', [N+1,N,N+1]), [N+1,N])
check('partial-policy contract', solve('partial-policy', {'supported':[N],'unsupported':[N+1],'allow_partial':False}), [])
check('summary contract', solve('summary', {'requested':list(range(N+2)),'runnable':[0]}), {'requested':N+2,'runnable':1})
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'intersection':
        return p[0] if p else []
    if action == 'eligible-order':
        return [x['id'] for x in p if x['eligible']]
    if action == 'noop-split':
        return {'run':[x['id'] for x in p if x['change']], 'noop':[x['id'] for x in p if not x['change']]}
    if action == 'duplicate-doc':
        return list(dict.fromkeys(p))
    if action == 'partial-policy':
        return p['supported'] if p['allow_partial'] else (p['supported'] if not p['unsupported'] else [])
    if action == 'summary':
        return {'requested':len(p['requested']),'runnable':len(p['runnable'])}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intersection contract', solve('intersection', [['open','edit'+str(N)],['open','print']]), ['open'])
check('eligible-order contract', solve('eligible-order', [{'id':N+2,'eligible':True},{'id':N,'eligible':True},{'id':N+1,'eligible':False}]), [N+2,N])
check('noop-split contract', solve('noop-split', [{'id':N,'change':False},{'id':N+1,'change':True}]), {'run':[N+1],'noop':[N]})
check('duplicate-doc contract', solve('duplicate-doc', [N+1,N,N+1]), [N+1,N])
check('partial-policy contract', solve('partial-policy', {'supported':[N],'unsupported':[N+1],'allow_partial':False}), [])
check('summary contract', solve('summary', {'requested':list(range(N+2)),'runnable':[0]}), {'requested':N+2,'runnable':1})
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)

prompt:
Batch menu advertises commands supported by only one target.

A batch context menu plans command work per document capability, preserves document order and separates unsupported, no-op and runnable targets.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'intersection':
        return sorted(set.intersection(*(set(x) for x in p))) if p else []
    if action == 'eligible-order':
        return sorted(x['id'] for x in p if x['eligible'])
    if action == 'noop-split':
        return {'run':[x['id'] for x in p if x['change']], 'noop':[x['id'] for x in p if not x['change']]}
    if action == 'duplicate-doc':
        return list(dict.fromkeys(p))
    if action == 'partial-policy':
        return p['supported'] if p['allow_partial'] else (p['supported'] if not p['unsupported'] else [])
    if action == 'summary':
        return {'requested':len(p['requested']),'runnable':len(p['runnable'])}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intersection contract', solve('intersection', [['open','edit'+str(N)],['open','print']]), ['open'])
check('eligible-order contract', solve('eligible-order', [{'id':N+2,'eligible':True},{'id':N,'eligible':True},{'id':N+1,'eligible':False}]), [N+2,N])
check('noop-split contract', solve('noop-split', [{'id':N,'change':False},{'id':N+1,'change':True}]), {'run':[N+1],'noop':[N]})
check('duplicate-doc contract', solve('duplicate-doc', [N+1,N,N+1]), [N+1,N])
check('partial-policy contract', solve('partial-policy', {'supported':[N],'unsupported':[N+1],'allow_partial':False}), [])
check('summary contract', solve('summary', {'requested':list(range(N+2)),'runnable':[0]}), {'requested':N+2,'runnable':1})
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'intersection':
        return sorted(set.intersection(*(set(x) for x in p))) if p else []
    if action == 'eligible-order':
        return [x['id'] for x in p]
    if action == 'noop-split':
        return {'run':[x['id'] for x in p if x['change']], 'noop':[x['id'] for x in p if not x['change']]}
    if action == 'duplicate-doc':
        return list(dict.fromkeys(p))
    if action == 'partial-policy':
        return p['supported'] if p['allow_partial'] else (p['supported'] if not p['unsupported'] else [])
    if action == 'summary':
        return {'requested':len(p['requested']),'runnable':len(p['runnable'])}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intersection contract', solve('intersection', [['open','edit'+str(N)],['open','print']]), ['open'])
check('eligible-order contract', solve('eligible-order', [{'id':N+2,'eligible':True},{'id':N,'eligible':True},{'id':N+1,'eligible':False}]), [N+2,N])
check('noop-split contract', solve('noop-split', [{'id':N,'change':False},{'id':N+1,'change':True}]), {'run':[N+1],'noop':[N]})
check('duplicate-doc contract', solve('duplicate-doc', [N+1,N,N+1]), [N+1,N])
check('partial-policy contract', solve('partial-policy', {'supported':[N],'unsupported':[N+1],'allow_partial':False}), [])
check('summary contract', solve('summary', {'requested':list(range(N+2)),'runnable':[0]}), {'requested':N+2,'runnable':1})
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)

prompt:
Batch menu planner reorders supported document targets.

A batch context menu plans command work per document capability, preserves document order and separates unsupported, no-op and runnable targets.

split: open-access