broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']<=d['epoch']
    if event == 'blur-defer': return d['pressed'] is not None
    if event == 'hover-value': return d['value']
    if event == 'cancel': return {'pressed':None,'pointer':None}
    if event == 'press-epoch': return d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']<d['epoch']
    if event == 'blur-defer': return d['pressed'] is not None
    if event == 'hover-value': return d['value']
    if event == 'cancel': return {'pressed':None,'pointer':None}
    if event == 'press-epoch': return d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The fresh completion transition produces an incorrect observable state.

Pointer acceptance captures option identity on press; release must match the captured pointer and row, remain inside, and exceed neither drag slop nor query epoch. Blur defers while a valid option press is pending. Hover is only preview and never a value commit.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']==d['epoch']
    if event == 'blur-defer': return False
    if event == 'hover-value': return d['value']
    if event == 'cancel': return {'pressed':None,'pointer':None}
    if event == 'press-epoch': return d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']==d['epoch']
    if event == 'blur-defer': return True
    if event == 'hover-value': return d['value']
    if event == 'cancel': return {'pressed':None,'pointer':None}
    if event == 'press-epoch': return d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The blur-defer completion transition produces an incorrect observable state.

Pointer acceptance captures option identity on press; release must match the captured pointer and row, remain inside, and exceed neither drag slop nor query epoch. Blur defers while a valid option press is pending. Hover is only preview and never a value commit.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']==d['epoch']
    if event == 'blur-defer': return d['pressed'] is not None
    if event == 'hover-value': return d['hover']
    if event == 'cancel': return {'pressed':None,'pointer':None}
    if event == 'press-epoch': return d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']==d['epoch']
    if event == 'blur-defer': return d['pressed'] is not None
    if event == 'hover-value': return None
    if event == 'cancel': return {'pressed':None,'pointer':None}
    if event == 'press-epoch': return d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The hover-value completion transition produces an incorrect observable state.

Pointer acceptance captures option identity on press; release must match the captured pointer and row, remain inside, and exceed neither drag slop nor query epoch. Blur defers while a valid option press is pending. Hover is only preview and never a value commit.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']==d['epoch']
    if event == 'blur-defer': return d['pressed'] is not None
    if event == 'hover-value': return d['value']
    if event == 'cancel': return {'pressed':d['pressed'],'pointer':None}
    if event == 'press-epoch': return d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']==d['epoch']
    if event == 'blur-defer': return d['pressed'] is not None
    if event == 'hover-value': return d['value']
    if event == 'cancel': return {'pressed':None,'pointer':d['pointer']}
    if event == 'press-epoch': return d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The cancel completion transition produces an incorrect observable state.

Pointer acceptance captures option identity on press; release must match the captured pointer and row, remain inside, and exceed neither drag slop nor query epoch. Blur defers while a valid option press is pending. Hover is only preview and never a value commit.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']==d['epoch']
    if event == 'blur-defer': return d['pressed'] is not None
    if event == 'hover-value': return d['value']
    if event == 'cancel': return {'pressed':None,'pointer':None}
    if event == 'press-epoch': return d['epoch']+1
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'capture': return d['pressed']
    if event == 'same-row': return d['pressed'] is not None and d['pressed']==d['released']
    if event == 'same-pointer': return d['pointer']==d['release_pointer']
    if event == 'inside': return d['inside']
    if event == 'slop': return d['distance']<=d['slop']
    if event == 'fresh': return d['press_epoch']==d['epoch']
    if event == 'blur-defer': return d['pressed'] is not None
    if event == 'hover-value': return d['value']
    if event == 'cancel': return {'pressed':None,'pointer':None}
    if event == 'press-epoch': return d['press_epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pressed':'a','released':'b','pointer':N,'release_pointer':N+1,'inside':False,'distance':8,'slop':3,'epoch':N,'press_epoch':N-1,'hover':'c','value':'v'}
boundary = {'pressed':None,'released':None,'pointer':N,'release_pointer':N,'inside':True,'distance':0,'slop':0,'epoch':N,'press_epoch':N,'hover':None,'value':None}
check('normal capture', solve('capture', normal), 'a')
check('boundary capture', solve('capture', boundary), None)
check('normal same-row', solve('same-row', normal), False)
check('boundary same-row', solve('same-row', boundary), False)
check('normal same-pointer', solve('same-pointer', normal), False)
check('boundary same-pointer', solve('same-pointer', boundary), True)
check('normal inside', solve('inside', normal), False)
check('boundary inside', solve('inside', boundary), True)
check('normal slop', solve('slop', normal), False)
check('boundary slop', solve('slop', boundary), True)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal blur-defer', solve('blur-defer', normal), True)
check('boundary blur-defer', solve('blur-defer', boundary), False)
check('normal hover-value', solve('hover-value', normal), 'v')
check('boundary hover-value', solve('hover-value', boundary), None)
check('normal cancel', solve('cancel', normal), {'pressed':None,'pointer':None})
check('boundary cancel', solve('cancel', boundary), {'pressed':None,'pointer':None})
check('normal press-epoch', solve('press-epoch', normal), N)
check('boundary press-epoch', solve('press-epoch', boundary), N)
variant = dict(normal, **{'pressed':'id'+str(N)})
check('variant query or selection payload', solve('capture', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The press-epoch completion transition produces an incorrect observable state.

Pointer acceptance captures option identity on press; release must match the captured pointer and row, remain inside, and exceed neither drag slop nor query epoch. Blur defers while a valid option press is pending. Hover is only preview and never a value commit.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [x for x in d['history'] if x!=d['accepted']]+[d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return d['history']+[d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The record completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history']
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][-d['limit']:]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The limit completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history']
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']!=d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The scope completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return [d['preview']]+d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return [d['draft']]+d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The preview completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return []
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x==d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The remove completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['new_label']:d['accepted']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return d['labels']
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The rename completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']] if d['accepted'] else []
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return []
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The empty-id completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['accepted']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['preview']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The query-source completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':''}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':d['history'],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The clear completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return list(reversed(list(d['labels'])))
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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

N = 1
observations = []
def solve(event, d):
    if event == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return list(d['labels'].values())
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
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:
The oldest-first-export completion transition produces an incorrect observable state.

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

split: open-access