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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*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 == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*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 suspend completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['pending']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*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 == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return False
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*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 duplicate completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':d['pending'],'sent':d['pending']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*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 == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*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 after-flush completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['job_epoch'],'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*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 == 'replace': return d['query']
    if event == 'deadline': return d['now']+d['delay']
    if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
    if event == 'flush': return [d['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
    if event == 'suspend': return None if d['composing'] else d['deadline']
    if event == 'duplicate': return d['query']==d['sent']
    if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
    if event == 'retag': return {'job_epoch':d['epoch']+1,'query':d['query']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', variant), 'q'*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 retag completion transition produces an incorrect observable state.

A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return d['ids']
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return sorted(set(d['ids']),reverse=True)
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 dedupe completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['old'].index(d['active']) if d['active'] in d['old'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else 0
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 active-index completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return list(dict.fromkeys(d['ids']))
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in d['old'] if x not in d['ids']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 added completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['labels']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return []
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 removed completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected'] if d['selected'] in d['ids'] else None
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['active']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 committed completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['old_label']
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['active'] or ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 active-label completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids']
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query'].startswith(d['result_query']) else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 render-query completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':d['active'],'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 replacement completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['labels'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[i,i] for i in range(len(d['ids']))]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 row-key completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] in d['ids'],'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':bool(d['ids']),'in_results':bool(d['ids'])}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', 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 selection-visible completion transition produces an incorrect observable state.

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

split: open-access