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 == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['ambient']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'enqueue-snapshot':
        return [{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Queued menu invocation rebinds its context at enqueue time.

Queued menu commands preserve invocation snapshots and FIFO order; cancellation and completion act on transaction identity without blocking unrelated command lanes.

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 == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[-1],p[:-1])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[:-1])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menu command queue removes a different invocation than it executes.

Queued menu commands preserve invocation snapshots and FIFO order; cancellation and completion act on transaction identity without blocking unrelated command lanes.

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 == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return []
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['command']!=p['command']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Cancelling one queued menu transaction removes same-command siblings.

Queued menu commands preserve invocation snapshots and FIFO order; cancellation and completion act on transaction identity without blocking unrelated command lanes.

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 == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [] if p['busy'] else p['queue']
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return p['queue']
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Busy document menu lane blocks unrelated document commands.

Queued menu commands preserve invocation snapshots and FIFO order; cancellation and completion act on transaction identity without blocking unrelated command lanes.

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 == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return []
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['failed']+p['remaining']
    if action == 'close-policy':
        return p['queue'] if p['survive_close'] else []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Recoverable menu command failure discards remaining queued work.

Queued menu commands preserve invocation snapshots and FIFO order; cancellation and completion act on transaction identity without blocking unrelated command lanes.

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 == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return []
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'enqueue-snapshot':
        return p['queue']+[{'id':p['id'],'context':p['captured']}]
    if action == 'dequeue':
        return (p[0],p[1:])
    if action == 'cancel-id':
        return [x for x in p['queue'] if x['id']!=p['id']]
    if action == 'lane':
        return [x for x in p['queue'] if x['lane'] not in p['busy']]
    if action == 'failure-next':
        return p['remaining'] if p['continue_on_error'] else []
    if action == 'close-policy':
        return p['queue'][:-1]
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('enqueue-snapshot contract', solve('enqueue-snapshot', {'queue':[{'id':0,'context':'old'}],'id':N,'captured':'doc','ambient':'other'}), [{'id':0,'context':'old'},{'id':N,'context':'doc'}])
check('dequeue contract', solve('dequeue', [N,N+1,N+2]), (N,[N+1,N+2]))
check('cancel-id contract', solve('cancel-id', {'queue':[{'id':N,'command':'copy'},{'id':N+1,'command':'copy'}],'id':N,'command':'copy'}), [{'id':N+1,'command':'copy'}])
check('lane contract', solve('lane', {'queue':[{'lane':'a','id':N},{'lane':'b','id':N+1}],'busy':['a']}), [{'lane':'b','id':N+1}])
check('failure-next contract', solve('failure-next', {'remaining':[N+1],'failed':[N],'continue_on_error':True}), [N+1])
check('close-policy contract', solve('close-policy', {'queue':[N,N+1],'survive_close':True}), [N,N+1])
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Closing popup cancels explicitly detached queued menu commands.

Queued menu commands preserve invocation snapshots and FIFO order; cancellation and completion act on transaction identity without blocking unrelated command lanes.

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 == 'isolate':
        return []
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'isolate':
        return p['rows']
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
One failed menu provider removes every provider section.

A failed menu provider is isolated to its owned section; fallback content and error records are distinct, and recovery clears only that provider error.

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 == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return [] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menu provider failure ignores its declared offline fallback commands.

A failed menu provider is isolated to its owned section; fallback content and error records are distinct, and recovery clears only that provider error.

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 == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['root'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':None,'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menu provider error is attributed to the root menu provider.

A failed menu provider is isolated to its owned section; fallback content and error records are distinct, and recovery clears only that provider error.

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 == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return p['errors']
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Recovering one menu provider clears unrelated provider errors.

A failed menu provider is isolated to its owned section; fallback content and error records are distinct, and recovery clears only that provider error.

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 == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback']
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return [] if not p['fatal'] else p['fallback']
    if action == 'retry-budget':
        return max(0,p['budget']-p['attempts'])
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Fatal malformed menu definition is replaced with unsafe stale content.

A failed menu provider is isolated to its owned section; fallback content and error records are distinct, and recovery clears only that provider error.

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 == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return p['budget']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'isolate':
        return [x for x in p['rows'] if x['provider']!=p['failed']]
    if action == 'fallback':
        return p['fallback'] if p['failed'] else p['content']
    if action == 'error-record':
        return {'provider':p['provider'],'code':p['code'],'generation':p['generation']}
    if action == 'recovery':
        return {k:v for k,v in p['errors'].items() if k!=p['provider']}
    if action == 'fatal':
        return p['fallback'] if not p['fatal'] else []
    if action == 'retry-budget':
        return p['budget']-1
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('isolate contract', solve('isolate', {'rows':[{'provider':'a','id':N},{'provider':'b','id':N+1}],'failed':'a'}), [{'provider':'b','id':N+1}])
check('fallback contract', solve('fallback', {'failed':True,'fallback':[N],'content':[N+1]}), [N])
check('error-record contract', solve('error-record', {'provider':'child','root':'root','code':'parse','generation':N}), {'provider':'child','code':'parse','generation':N})
check('recovery contract', solve('recovery', {'errors':{'a':N,'b':N+1},'provider':'a'}), {'b':N+1})
check('fatal contract', solve('fatal', {'fallback':[N],'fatal':True}), [])
check('retry-budget contract', solve('retry-budget', {'budget':N+4,'attempts':3}), N+1)
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Menu retry control forgets consumed provider retry attempts.

A failed menu provider is isolated to its owned section; fallback content and error records are distinct, and recovery clears only that provider error.

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 == 'intent':
        return {'command':p['command'],'targets':p['current'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':{}}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 confirmation loses the captured invocation intent.

A confirmation launched from a menu freezes command intent; confirm executes exactly that intent, cancellation discards it, and stale documents require reconfirmation.

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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return p['pending']
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return {'cancelled':True,'intent':p['pending']}
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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:
Cancelled menu confirmation leaves an executable pending intent.

A confirmation launched from a menu freezes command intent; confirm executes exactly that intent, cancellation discards it, and stale documents require reconfirmation.

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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':p['intent']}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':None,'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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:
Confirmed menu intent remains pending for a second execution.

A confirmation launched from a menu freezes command intent; confirm executes exactly that intent, cancellation discards it, and stale documents require reconfirmation.

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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']<=p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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:
Changed document executes an obsolete menu confirmation.

A confirmation launched from a menu freezes command intent; confirm executes exactly that intent, cancellation discards it, and stale documents require reconfirmation.

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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return len(p)
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return int(any(x['destructive'] for x in p))
    if action == 'return-menu':
        return p['menu'] if p['menu_live'] else None
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 confirmation miscounts destructive effects in a mixed plan.

A confirmation launched from a menu freezes command intent; confirm executes exactly that intent, cancellation discards it, and stale documents require reconfirmation.

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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['menu']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 == 'intent':
        return {'command':p['command'],'targets':p['captured'],'arguments':p['arguments']}
    if action == 'cancel':
        return None
    if action == 'consume':
        return {'execute':p['intent'],'pending':None}
    if action == 'revision':
        return 'execute' if p['captured_revision']==p['live_revision'] else 'reconfirm'
    if action == 'destructive-count':
        return sum(x['destructive'] for x in p)
    if action == 'return-menu':
        return p['fallback']
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('intent contract', solve('intent', {'command':'delete','captured':[N],'current':[N+1],'arguments':{'permanent':True}}), {'command':'delete','targets':[N],'arguments':{'permanent':True}})
check('cancel contract', solve('cancel', {'pending':{'target':N}}), None)
check('consume contract', solve('consume', {'intent':{'id':N}}), {'execute':{'id':N},'pending':None})
check('revision contract', solve('revision', {'captured_revision':N,'live_revision':N+1}), 'reconfirm')
check('destructive-count contract', solve('destructive-count', [{'destructive':True,'id':N},{'destructive':True,'id':N+1},{'destructive':False,'id':N+2}]), 2)
check('return-menu contract', solve('return-menu', {'menu':N,'menu_live':False,'fallback':'root'}), None)
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 confirmation returns to an already disposed source popup.

A confirmation launched from a menu freezes command intent; confirm executes exactly that intent, cancellation discards it, and stale documents require reconfirmation.

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 == 'remaining-rows':
        return p['budget']
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'remaining-rows':
        return max(0,p['budget']-p['local_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Nested menu provider receives the full root row budget.

Nested menu providers consume shared row and depth budgets and charge visible descendants exactly once; cached rows still occupy presentation budget.

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 == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return p['maximum']
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return p['depth']
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Nested provider depth allowance ignores consumed ancestors.

Nested menu providers consume shared row and depth budgets and charge visible descendants exactly once; cached rows still occupy presentation budget.

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 == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Cached submenu commands bypass the menu presentation row budget.

Nested menu providers consume shared row and depth budgets and charge visible descendants exactly once; cached rows still occupy presentation budget.

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 == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':False}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'],'truncated':True}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Budget-truncated submenu lacks a visible truncation state.

Nested menu providers consume shared row and depth budgets and charge visible descendants exactly once; cached rows still occupy presentation budget.

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 == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return p['available']
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-max(p['reservations'].values()))
    if action == 'release-reservation':
        return {k:v for k,v in p['reservations'].items() if k!=p['provider']}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Parallel submenu providers overbook a shared row reservation.

Nested menu providers consume shared row and depth budgets and charge visible descendants exactly once; cached rows still occupy presentation budget.

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 == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return {}
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import unicodedata
N = 1
observations = []
def solve(action, p):
    if action == 'remaining-rows':
        return max(0,p['budget']-p['ancestor_rows'])
    if action == 'remaining-depth':
        return max(0,p['maximum']-p['depth'])
    if action == 'charge-cache':
        return len(p['fresh'])+len(p['cached'])
    if action == 'truncate-signal':
        return {'rows':p['rows'][:p['limit']],'truncated':len(p['rows'])>p['limit']}
    if action == 'reservation':
        return max(0,p['available']-sum(p['reservations'].values()))
    if action == 'release-reservation':
        return dict(p['reservations'],**{p['provider']:p['used']})
    return {'error': 'unsupported menu operation'}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remaining-rows contract', solve('remaining-rows', {'budget':N+10,'ancestor_rows':4,'local_rows':1}), N+6)
check('remaining-depth contract', solve('remaining-depth', {'maximum':N+6,'depth':2}), N+4)
check('charge-cache contract', solve('charge-cache', {'fresh':[N],'cached':[N+1,N+2]}), 3)
check('truncate-signal contract', solve('truncate-signal', {'rows':list(range(N+3)),'limit':2}), {'rows':[0,1],'truncated':True})
check('reservation contract', solve('reservation', {'available':N+10,'reservations':{'a':2,'b':3}}), N+5)
check('release-reservation contract', solve('release-reservation', {'reservations':{'a':N,'b':N+1},'provider':'a','used':1}), {'b':N+1})
check('unknown operation', solve('unknown', {}), {'error': 'unsupported menu operation'})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
Completed submenu provider keeps its reserved capacity unavailable.

Nested menu providers consume shared row and depth budgets and charge visible descendants exactly once; cached rows still occupy presentation budget.

split: open-access