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 [x['id'] for x in p if x['eligible']]
    if action == 'noop-split':
        return {'run':[x['id'] for x in p],'noop':[]}
    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 x['eligible']]
    if action == 'noop-split':
        return {'run':[],'noop':[x['id'] for x in p]}
    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 plan conflates no-op targets with runnable 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


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 [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 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)

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 == '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 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 sorted(set(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 context menu executes duplicate 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


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 [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 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 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['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:
Atomic batch menu command proceeds on a supported subset.

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 [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['runnable']),'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 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['requested'])}
    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 preview misstates requested versus runnable object counts.

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 == 'missing-prefix':
        return [x for x in p['chain'] if x in p['live']]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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 == 'missing-prefix':
        return p['chain']
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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:
Restored menu cascade skips a missing owner and reopens its orphan descendant.

Restored cascades reopen only a contiguous valid prefix of menu owners. Missing, lazy, reparented or unavailable owners stop restoration; root identity and independent menu windows are retained.

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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain']
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return [x for x in p['chain'] if x not in p['lazy']]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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:
Restored cascade opens descendants of an unresolved lazy submenu.

Restored cascades reopen only a contiguous valid prefix of menu owners. Missing, lazy, reparented or unavailable owners stop restoration; root identity and independent menu windows are retained.

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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain']
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return [x for x in p['chain'] if x in p['parents']]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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 restore follows a child that was moved to a different submenu owner.

Restored cascades reopen only a contiguous valid prefix of menu owners. Missing, lazy, reparented or unavailable owners stop restoration; root identity and independent menu windows are retained.

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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return [x for x in p['chain'] if p['available'].get(x,False)]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain']
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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:
Restored menu passes through an unavailable intermediate owner.

Restored cascades reopen only a contiguous valid prefix of menu owners. Missing, lazy, reparented or unavailable owners stop restoration; root identity and independent menu windows are retained.

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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['path'][0]:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {p[-1]['window']:p[-1]['path']}
    if action == 'owner-remap':
        return [p['mapping'].get(x,x) for x in p['chain']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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:
Restoring independent menu windows merges their identical root definitions.

Restored cascades reopen only a contiguous valid prefix of menu owners. Missing, lazy, reparented or unavailable owners stop restoration; root identity and independent menu windows are retained.

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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return p['chain']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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 == 'missing-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if x not in p['live']),len(p['chain']))]
    if action == 'lazy-boundary':
        return p['chain'][:next((i+1 for i,x in enumerate(p['chain']) if x in p['lazy']),len(p['chain']))]
    if action == 'owner-edge':
        return p['chain'][:next((i+1 for i,(a,b) in enumerate(zip(p['chain'],p['chain'][1:])) if p['parents'].get(b)!=a),len(p['chain']))]
    if action == 'availability-prefix':
        return p['chain'][:next((i for i,x in enumerate(p['chain']) if not p['available'].get(x,False)),len(p['chain']))]
    if action == 'window-paths':
        return {x['window']:x['path'] for x in p}
    if action == 'owner-remap':
        return [p['mapping'].get(p['chain'][0],p['chain'][0])]+p['chain'][1:]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('missing-prefix contract', solve('missing-prefix', {'chain':['root','gone','child'+str(N)],'live':['root','child'+str(N)]}), ['root'])
check('lazy-boundary contract', solve('lazy-boundary', {'chain':['root','lazy','child'+str(N)],'lazy':['lazy']}), ['root','lazy'])
check('owner-edge contract', solve('owner-edge', {'chain':['root','a','b'+str(N)],'parents':{'a':'root','b'+str(N):'other'}}), ['root','a'])
check('availability-prefix contract', solve('availability-prefix', {'chain':['root','locked','b'+str(N)],'available':{'root':True,'locked':False,'b'+str(N):True}}), ['root'])
check('window-paths contract', solve('window-paths', [{'window':N,'path':['root','a']},{'window':N+1,'path':['root','b']}]), {N:['root','a'],N+1:['root','b']})
check('owner-remap contract', solve('owner-remap', {'chain':['root','old'+str(N)],'mapping':{'old'+str(N):'new'+str(N)}}), ['root','new'+str(N)])
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 restore remaps only the root and leaves obsolete descendant presentation IDs.

Restored cascades reopen only a contiguous valid prefix of menu owners. Missing, lazy, reparented or unavailable owners stop restoration; root identity and independent menu windows are retained.

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 == 'primary':
        return {'command':None,'open':True}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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 == 'primary':
        return {'command':p['default'],'open':True}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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:
Primary split-menu action opens the submenu while invoking its default command.

Split menu owners have separate primary command and secondary submenu zones. Their default command is explicit, direct and independently available; the owner label is stable.

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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':p['default'],'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':p['default'],'open':False}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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:
Secondary split-menu zone invokes the default instead of only showing alternatives.

Split menu owners have separate primary command and secondary submenu zones. Their default command is explicit, direct and independently available; the owner label is stable.

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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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:
Split-menu divider hit is assigned to the primary command zone.

Split menu owners have separate primary command and secondary submenu zones. Their default command is explicit, direct and independently available; the owner label is stable.

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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return any(x['available'] for x in p['children'])
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return all(x['available'] for x in p['children'])
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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:
Split-menu default availability is inferred from unrelated alternatives.

Split menu owners have separate primary command and secondary submenu zones. Their default command is explicit, direct and independently available; the owner label is stable.

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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['default_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']+' '+p['default_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':p['default'] is None}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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 split-menu default rewrites the owning submenu label.

Split menu owners have separate primary command and secondary submenu zones. Their default command is explicit, direct and independently available; the owner label is stable.

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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['default'],'open':False}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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 == 'primary':
        return {'command':p['default'],'open':False}
    if action == 'secondary':
        return {'command':None,'open':True}
    if action == 'zone':
        return 'secondary' if p['x']>=p['divider'] else 'primary'
    if action == 'default-availability':
        return next((x['available'] for x in p['children'] if x['command']==p['default']),False)
    if action == 'owner-label':
        return p['owner_label']
    if action == 'primary-empty-default':
        return {'command':p['fallback'],'open':False}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('primary contract', solve('primary', {'default':'run'+str(N)}), {'command':'run'+str(N),'open':False})
check('secondary contract', solve('secondary', {'default':'run'+str(N)}), {'command':None,'open':True})
check('zone contract', solve('zone', {'x':N+20,'divider':N+20}), 'secondary')
check('default-availability contract', solve('default-availability', {'default':'run','children':[{'command':'run','available':True},{'command':'other'+str(N),'available':False}]}), True)
check('owner-label contract', solve('owner-label', {'owner_label':'Export','default_label':'Format '+str(N)}), 'Export')
check('primary-empty-default contract', solve('primary-empty-default', {'default':None,'fallback':'first'+str(N)}), {'command':None,'open':True})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('other available alternatives do not enable default',solve('default-availability',{'default':'run','children':[{'command':'run','available':False},{'command':'other'+str(N),'available':True}]}),False)
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:
Split-menu primary zone with no default guesses an arbitrary alternative command.

Split menu owners have separate primary command and secondary submenu zones. Their default command is explicit, direct and independently available; the owner label is stable.

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 == 'bind':
        return {p['name']:p['value']}
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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 == 'bind':
        return dict({p['name']:p['value']},**p['bound'])
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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:
Parameter submenu loses earlier parent command bindings.

A parameter submenu binds a chosen parameter to a parent command while preserving other bindings; cancel discards provisional parameters and commit requires all required fields.

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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['row_id']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['submenu_id']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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:
Parameter row dispatches itself instead of its parent menu command.

A parameter submenu binds a chosen parameter to a parent command while preserving other bindings; cancel discards provisional parameters and commit requires all required fields.

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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['provisional']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return {}
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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:
Cancelling a parameter submenu commits unfinished arguments.

A parameter submenu binds a chosen parameter to a parent command while preserving other bindings; cancel discards provisional parameters and commit requires all required fields.

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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return bool(p['bound'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return any(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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:
Parameter submenu enables commit with missing required bindings.

A parameter submenu binds a chosen parameter to a parent command while preserving other bindings; cancel discards provisional parameters and commit requires all required fields.

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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['label']
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return str(p['value'])
    if action == 'return-path':
        return p['path'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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:
Parameter menu binds the display label instead of typed value.

A parameter submenu binds a chosen parameter to a parent command while preserving other bindings; cancel discards provisional parameters and commit requires all required fields.

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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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 == 'bind':
        return dict(p['bound'],**{p['name']:p['value']})
    if action == 'parent-command':
        return p['parent_command']
    if action == 'cancel':
        return p['committed']
    if action == 'required-fields':
        return all(k in p['bound'] for k in p['required'])
    if action == 'value-identity':
        return p['value']
    if action == 'return-path':
        return p['path'][:-2]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('bind contract', solve('bind', {'bound':{'format':'old','target':'doc'},'name':'format','value':'new'+str(N)}), {'format':'new'+str(N),'target':'doc'})
check('parent-command contract', solve('parent-command', {'parent_command':'export'+str(N),'row_id':'pdf','submenu_id':'formats'}), 'export'+str(N))
check('cancel contract', solve('cancel', {'committed':{'size':N},'provisional':{'size':N+1}}), {'size':N})
check('required-fields contract', solve('required-fields', {'bound':{'format':'pdf','scale':N},'required':['format','destination']}), False)
check('value-identity contract', solve('value-identity', {'value':N,'label':'Size '+str(N)}), N)
check('return-path contract', solve('return-path', {'path':['root','export','size'+str(N)]}), ['root','export'])
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:
Parameter submenu completion skips its owning command menu.

A parameter submenu binds a chosen parameter to a parent command while preserving other bindings; cancel discards provisional parameters and commit requires all required fields.

split: open-access