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 == 'dedupe-context':
        return list(dict.fromkeys(x['command'] for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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 == 'dedupe-context':
        return list(dict.fromkeys(x['context'] for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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:
Recent menu merges different context-bound uses of one command.

Recent command menus key history by command and context, rank by descending last-use time with use-count tie break, and exclude retired commands from presentation.

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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return p['history']+[p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+p['history']
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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:
Recent menu promotion leaves duplicate history entries.

Recent command menus key history by command and context, rank by descending last-use time with use-count tie break, and exclude retired commands from presentation.

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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:-x['uses'])]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in p]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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:
Recent command menu ranks frequent old commands above newer invocations.

Recent command menus key history by command and context, rank by descending last-use time with use-count tie break, and exclude retired commands from presentation.

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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return p['history']
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return p['commands']
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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:
Recent menu exposes commands removed from the registry.

Recent command menus key history by command and context, rank by descending last-use time with use-count tie break, and exclude retired commands from presentation.

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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][-p['limit']:]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']+1]
    if action == 'private-context':
        return [x for x in p if not x['private']]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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:
Recent menu capacity retains oldest entries instead of newest.

Recent command menus key history by command and context, rank by descending last-use time with use-count tie break, and exclude retired commands from presentation.

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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return p
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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 == 'dedupe-context':
        return list(dict.fromkeys((x['command'],x['context']) for x in p))
    if action == 'promote':
        return [p['id']]+[x for x in p['history'] if x!=p['id']]
    if action == 'recent-rank':
        return [x['id'] for x in sorted(p,key=lambda x:(-x['last_used'],-x['uses']))]
    if action == 'retired':
        return [x for x in p['history'] if x in p['commands']]
    if action == 'limit':
        return p['history'][:p['limit']]
    if action == 'private-context':
        return [dict(x,context=None) for x in p]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('dedupe-context contract', solve('dedupe-context', [{'command':'open','context':N},{'command':'open','context':N+1}]), [('open',N),('open',N+1)])
check('promote contract', solve('promote', {'id':N,'history':[N+1,N]}), [N,N+1])
check('recent-rank contract', solve('recent-rank', [{'id':'old','last_used':N,'uses':20},{'id':'new','last_used':N+5,'uses':1}]), ['new','old'])
check('retired contract', solve('retired', {'history':[N,N+1],'commands':[N+1,N+2]}), [N+1])
check('limit contract', solve('limit', {'history':list(range(N+4)),'limit':2}), [0,1])
check('private-context contract', solve('private-context', [{'id':N,'private':True,'context':'secret'},{'id':N+1,'private':False,'context':'public'}]), [{'id':N+1,'private':False,'context':'public'}])
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:
Private context command appears in the persistent recent menu.

Recent command menus key history by command and context, rank by descending last-use time with use-count tie break, and exclude retired commands from presentation.

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 == 'success-receipt':
        return p['receipt']
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'success-receipt':
        return p['receipt'] if p['attempted'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Uncommitted menu action produces an undo receipt.

Menu command receipts retain committed effects, invocation identity and reversible scope; receipt generation does not imply successful mutation.

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 == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return p
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return sorted(p)
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menu command rollback executes effects in forward order.

Menu command receipts retain committed effects, invocation identity and reversible scope; receipt generation does not imply successful mutation.

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 == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return p['effects']
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['document']==p['document']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menu undo receipt captures another action on the same document.

Menu command receipts retain committed effects, invocation identity and reversible scope; receipt generation does not imply successful mutation.

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 == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['live_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['command_id']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Undo menu label changes retroactively after command relabeling.

Menu command receipts retain committed effects, invocation identity and reversible scope; receipt generation does not imply successful mutation.

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 == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return {} if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['context']==p['previous_context'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
No-op menu action adds a meaningless undo entry.

Menu command receipts retain committed effects, invocation identity and reversible scope; receipt generation does not imply successful mutation.

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 == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'success-receipt':
        return p['receipt'] if p['committed'] else None
    if action == 'effect-order':
        return list(reversed(p))
    if action == 'scope':
        return [x for x in p['effects'] if x['transaction']==p['transaction']]
    if action == 'description':
        return p['captured_label']
    if action == 'noop':
        return None if p['before']==p['after'] else {'before':p['before'],'after':p['after']}
    if action == 'merge-window':
        return p['command']==p['previous_command'] and p['elapsed']<=p['window']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('success-receipt contract', solve('success-receipt', {'receipt':N,'committed':False,'attempted':True}), None)
check('effect-order contract', solve('effect-order', ['create','write'+str(N),'rename']), ['rename','write'+str(N),'create'])
check('scope contract', solve('scope', {'transaction':N,'document':'d','effects':[{'transaction':N,'document':'d'},{'transaction':N+1,'document':'d'}]}), [{'transaction':N,'document':'d'}])
check('description contract', solve('description', {'captured_label':'Move '+str(N),'live_label':'Copy','command_id':'edit'}), 'Move '+str(N))
check('noop contract', solve('noop', {'before':N,'after':N}), None)
check('merge-window contract', solve('merge-window', {'command':'rename','previous_command':'rename','context':N,'previous_context':N+1,'elapsed':1,'window':5}), False)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menu history merges identical commands from different context targets.

Menu command receipts retain committed effects, invocation identity and reversible scope; receipt generation does not imply successful mutation.

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 == 'initial':
        return p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'initial':
        return ['loading']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Initial lazy submenu shows an empty list while content is pending.

Lazy submenu presentation distinguishes first load, refresh, stale content, retryable failure and empty success without disguising provider state as commands.

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 == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return ['loading'] if p['loading'] else p['rows']
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Refreshing submenu discards usable existing commands.

Lazy submenu presentation distinguishes first load, refresh, stale content, retryable failure and empty success without disguising provider state as commands.

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 == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['retry']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Retryable submenu failure omits its retry affordance.

Lazy submenu presentation distinguishes first load, refresh, stale content, retryable failure and empty success without disguising provider state as commands.

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 == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return ['error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Failed menu refresh presents cached content as current.

Lazy submenu presentation distinguishes first load, refresh, stale content, retryable failure and empty success without disguising provider state as commands.

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 == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['loading'] if not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']=='command']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Successful empty provider is confused with pending menu content.

Lazy submenu presentation distinguishes first load, refresh, stale content, retryable failure and empty success without disguising provider state as commands.

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 == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return p
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'initial':
        return ['loading'] if p['loading'] and not p['rows'] else p['rows']
    if action == 'refresh':
        return p['rows']+(['refreshing'] if p['loading'] else [])
    if action == 'retryable':
        return ['error', 'retry'] if p['retryable'] else ['error']
    if action == 'stale-error':
        return p['rows']+['stale','error']
    if action == 'empty-success':
        return ['empty'] if p['completed'] and not p['rows'] else p['rows']
    if action == 'status-actionable':
        return [x for x in p if x['kind']!='loading']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial contract', solve('initial', {'loading':True,'rows':[],'generation':N}), ['loading'])
check('refresh contract', solve('refresh', {'loading':True,'rows':[N,N+1]}), [N,N+1,'refreshing'])
check('retryable contract', solve('retryable', {'retryable':True,'code':N}), ['error','retry'])
check('stale-error contract', solve('stale-error', {'rows':[N],'error':'offline'}), [N,'stale','error'])
check('empty-success contract', solve('empty-success', {'completed':True,'rows':[],'version':N}), ['empty'])
check('status-actionable contract', solve('status-actionable', [{'kind':'error','id':N},{'kind':'command','id':N+1}]), [{'kind':'command','id':N+1}])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
check('initial content ready',solve('initial',{'loading':False,'rows':[N]}),[N])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Provider error status row is treated as a menu command.

Lazy submenu presentation distinguishes first load, refresh, stale content, retryable failure and empty success without disguising provider state as commands.

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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 == 'hidden':
        return p['rows']
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 customization hides a required recovery command.

User menu customization applies stable command IDs, protects mandatory commands and resets only the requested customization layer.

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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['label']
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return next(iter(p['names'].values()),p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 display rename is applied to the wrong command ID.

User menu customization applies stable command IDs, protects mandatory commands and resets only the requested customization layer.

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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return []
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return p['hidden']
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 one hidden menu command resets all hidden commands.

User menu customization applies stable command IDs, protects mandatory commands and resets only the requested customization layer.

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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return p['layers']
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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:
Resetting menu customizations deletes organization policy settings.

User menu customization applies stable command IDs, protects mandatory commands and resets only the requested customization layer.

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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['live']
    if action == 'obsolete-config':
        return {k:v for k,v in p['settings'].items() if k in p['live']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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:
Saved menu order makes newly installed commands unreachable.

User menu customization applies stable command IDs, protects mandatory commands and resets only the requested customization layer.

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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return p['settings']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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 == 'hidden':
        return [x for x in p['rows'] if x['id'] not in p['hidden'] or x['mandatory']]
    if action == 'rename':
        return p['names'].get(p['id'],p['label'])
    if action == 'restore-hidden':
        return [x for x in p['hidden'] if x!=p['id']]
    if action == 'reset-layer':
        return {k:v for k,v in p['layers'].items() if k!=p['layer']}
    if action == 'append-new':
        return p['saved']+[x for x in p['live'] if x not in p['saved']]
    if action == 'obsolete-config':
        return {}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden contract', solve('hidden', {'rows':[{'id':N,'mandatory':True},{'id':N+1,'mandatory':False}],'hidden':[N,N+1]}), [{'id':N,'mandatory':True}])
check('rename contract', solve('rename', {'id':N+1,'label':'Original','names':{N:'Other',N+1:'Mine'}}), 'Mine')
check('restore-hidden contract', solve('restore-hidden', {'hidden':[N,N+1],'id':N}), [N+1])
check('reset-layer contract', solve('reset-layer', {'layers':{'user':N,'policy':N+1},'layer':'user'}), {'policy':N+1})
check('append-new contract', solve('append-new', {'saved':[N+1,N],'live':[N,N+1,N+2]}), [N+1,N,N+2])
check('obsolete-config contract', solve('obsolete-config', {'settings':{N:'x',N+1:'y'},'live':[N+1]}), {N+1:'y'})
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:
Retired command customization migrates onto stale menu entries.

User menu customization applies stable command IDs, protects mandatory commands and resets only the requested customization layer.

split: open-access