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

N = 1
observations = []
def solve(event, d):
    if event == 'key': return [d['scope'],d['query']]
    if event == 'query-match': return d['query']==d['cache_query']
    if event == 'scope-match': return d['scope']==d['cache_scope']
    if event == 'empty-hit': return d['has_entry']
    if event == 'stale-badge': return not d['fresh']
    if event == 'refresh': return not d['fresh']
    if event == 'miss-rows': return d['cached'] if d['query']==d['cache_query'] and d['scope']==d['cache_scope'] else []
    if event == 'value-label': return d['selected_label']
    if event == 'cache-provenance': return {'origin':'cache','query':d['cache_query'],'epoch':d['cache_epoch']}
    if event == 'refresh-error': return {'rows':[],'warning':d['error']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pe','scope':'fruit','cache_query':'p','cache_scope':'all','cached':['p1'],'has_entry':True,'fresh':False,'selected_label':'Pear','epoch':N,'cache_epoch':N-1,'error':'offline'}
boundary = {'query':'','scope':'all','cache_query':'','cache_scope':'all','cached':[],'has_entry':True,'fresh':True,'selected_label':'','epoch':N,'cache_epoch':N,'error':None}
check('normal key', solve('key', normal), ['fruit','pe'])
check('boundary key', solve('key', boundary), ['all',''])
check('normal query-match', solve('query-match', normal), False)
check('boundary query-match', solve('query-match', boundary), True)
check('normal scope-match', solve('scope-match', normal), False)
check('boundary scope-match', solve('scope-match', boundary), True)
check('normal empty-hit', solve('empty-hit', normal), True)
check('boundary empty-hit', solve('empty-hit', boundary), True)
check('normal stale-badge', solve('stale-badge', normal), True)
check('boundary stale-badge', solve('stale-badge', boundary), False)
check('normal refresh', solve('refresh', normal), True)
check('boundary refresh', solve('refresh', boundary), False)
check('normal miss-rows', solve('miss-rows', normal), [])
check('boundary miss-rows', solve('miss-rows', boundary), [])
check('normal value-label', solve('value-label', normal), 'Pear')
check('boundary value-label', solve('value-label', boundary), '')
check('normal cache-provenance', solve('cache-provenance', normal), {'origin':'cache','query':'p','epoch':N-1})
check('boundary cache-provenance', solve('cache-provenance', boundary), {'origin':'cache','query':'','epoch':N})
check('normal refresh-error', solve('refresh-error', normal), {'rows':['p1'],'warning':'offline'})
check('boundary refresh-error', solve('refresh-error', boundary), {'rows':[],'warning':None})
variant = dict(normal, **{'selected_label':'L'*N})
check('variant query or selection payload', solve('value-label', variant), 'L'*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 == 'key': return [d['scope'],d['query']]
    if event == 'query-match': return d['query']==d['cache_query']
    if event == 'scope-match': return d['scope']==d['cache_scope']
    if event == 'empty-hit': return d['has_entry']
    if event == 'stale-badge': return not d['fresh']
    if event == 'refresh': return not d['fresh']
    if event == 'miss-rows': return d['cached'] if d['query']==d['cache_query'] and d['scope']==d['cache_scope'] else []
    if event == 'value-label': return d['selected_label']
    if event == 'cache-provenance': return {'origin':'cache','query':d['cache_query'],'epoch':d['cache_epoch']}
    if event == 'refresh-error': return {'rows':d['cached'],'warning':None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pe','scope':'fruit','cache_query':'p','cache_scope':'all','cached':['p1'],'has_entry':True,'fresh':False,'selected_label':'Pear','epoch':N,'cache_epoch':N-1,'error':'offline'}
boundary = {'query':'','scope':'all','cache_query':'','cache_scope':'all','cached':[],'has_entry':True,'fresh':True,'selected_label':'','epoch':N,'cache_epoch':N,'error':None}
check('normal key', solve('key', normal), ['fruit','pe'])
check('boundary key', solve('key', boundary), ['all',''])
check('normal query-match', solve('query-match', normal), False)
check('boundary query-match', solve('query-match', boundary), True)
check('normal scope-match', solve('scope-match', normal), False)
check('boundary scope-match', solve('scope-match', boundary), True)
check('normal empty-hit', solve('empty-hit', normal), True)
check('boundary empty-hit', solve('empty-hit', boundary), True)
check('normal stale-badge', solve('stale-badge', normal), True)
check('boundary stale-badge', solve('stale-badge', boundary), False)
check('normal refresh', solve('refresh', normal), True)
check('boundary refresh', solve('refresh', boundary), False)
check('normal miss-rows', solve('miss-rows', normal), [])
check('boundary miss-rows', solve('miss-rows', boundary), [])
check('normal value-label', solve('value-label', normal), 'Pear')
check('boundary value-label', solve('value-label', boundary), '')
check('normal cache-provenance', solve('cache-provenance', normal), {'origin':'cache','query':'p','epoch':N-1})
check('boundary cache-provenance', solve('cache-provenance', boundary), {'origin':'cache','query':'','epoch':N})
check('normal refresh-error', solve('refresh-error', normal), {'rows':['p1'],'warning':'offline'})
check('boundary refresh-error', solve('refresh-error', boundary), {'rows':[],'warning':None})
variant = dict(normal, **{'selected_label':'L'*N})
check('variant query or selection payload', solve('value-label', variant), 'L'*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 refresh-error completion transition produces an incorrect observable state.

Cached result presentation is bound to exact query and dependency scope. A cache hit may render immediately but must be marked stale until refreshed. Empty cached results are valid hits. Cache misses preserve no previous-query selectable rows; selected labels are independently retained.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['remote']+d['local']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 order completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return ['remote',d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 identity completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title']
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 local-header completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['local_title']
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 remote-header completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return [] if d['remote_pending'] else d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['remote']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 local-ready completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id']
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 header-commit completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])+2
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(set(d['local']+d['remote']))
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 count completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['remote'] or not d['local']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 source-empty completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return True
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return not d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+(1 if d['local'] else 0)
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 remote-marker completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])+1
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 == 'order': return d['local']+d['remote']
    if event == 'identity': return [d['row_source'],d['row_id']]
    if event == 'local-header': return d['local_title'] if d['local'] else None
    if event == 'remote-header': return d['remote_title'] if d['remote'] else None
    if event == 'local-ready': return d['local']
    if event == 'header-commit': return d['row_id'] if d['row_kind']=='option' else None
    if event == 'count': return len(d['local'])+len(d['remote'])
    if event == 'source-empty': return not d['local'] and not d['remote']
    if event == 'remote-marker': return d['remote_pending']
    if event == 'remote-offset': return len(d['local'])
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'local':['x','y'],'remote':['x','z'],'local_title':'Recent','remote_title':'Directory','remote_pending':True,'row_kind':'header','row_source':'remote','row_id':'x','epoch':N}
boundary = {'local':[],'remote':['w'],'local_title':'Recent','remote_title':'Directory','remote_pending':False,'row_kind':'option','row_source':'local','row_id':'','epoch':N}
check('normal order', solve('order', normal), ['x','y','x','z'])
check('boundary order', solve('order', boundary), ['w'])
check('normal identity', solve('identity', normal), ['remote','x'])
check('boundary identity', solve('identity', boundary), ['local',''])
check('normal local-header', solve('local-header', normal), 'Recent')
check('boundary local-header', solve('local-header', boundary), None)
check('normal remote-header', solve('remote-header', normal), 'Directory')
check('boundary remote-header', solve('remote-header', boundary), 'Directory')
check('normal local-ready', solve('local-ready', normal), ['x','y'])
check('boundary local-ready', solve('local-ready', boundary), [])
check('normal header-commit', solve('header-commit', normal), None)
check('boundary header-commit', solve('header-commit', boundary), '')
check('normal count', solve('count', normal), 4)
check('boundary count', solve('count', boundary), 1)
check('normal source-empty', solve('source-empty', normal), False)
check('boundary source-empty', solve('source-empty', boundary), False)
check('normal remote-marker', solve('remote-marker', normal), True)
check('boundary remote-marker', solve('remote-marker', boundary), False)
check('normal remote-offset', solve('remote-offset', normal), 3)
check('boundary remote-offset', solve('remote-offset', boundary), 0)
variant = dict(normal, **{'row_id':'id'+str(N)})
check('variant query or selection payload', solve('identity', variant), ['remote','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 remote-offset completion transition produces an incorrect observable state.

Local-history and remote suggestions are separate ordered sections. Stable identity includes source namespace. Empty sections have no header; pending remote work does not hide completed local results. Section headers are display rows, never commit candidates.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'visible': return [x for x in d['ids'] if x not in d['disabled']]
    if event == 'eligible': return [x for x in d['ids'] if x not in d['disabled']]
    if event == 'commit': return d['active'] if d['active'] in d['ids'] and d['active'] not in d['disabled'] else None
    if event == 'reason': return d['reason'].get(d['active'])
    if event == 'selected': return d['value']
    if event == 'row-flags': return [x in d['disabled'] for x in d['ids']]
    if event == 'first-enabled': return next((x for x in d['ids'] if x not in d['disabled']),None)
    if event == 'status': return 'empty' if not d['ids'] else 'available' if any(x not in d['disabled'] for x in d['ids']) else 'unavailable'
    if event == 'validation': return d['value'] is None or d['value'] not in d['disabled']
    if event == 'revalidate': return {'active':None if d['active'] in d['disabled'] else d['active'],'epoch':d['epoch']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'ids':['a','b','c'],'disabled':['a','c'],'labels':['Same','Same','See'],'active':'a','value':'c','reason':{'a':'retired','c':'restricted'},'epoch':N}
boundary = {'ids':[],'disabled':[],'labels':[],'active':None,'value':None,'reason':{},'epoch':N}
check('normal visible', solve('visible', normal), ['a','b','c'])
check('boundary visible', solve('visible', boundary), [])
check('normal eligible', solve('eligible', normal), ['b'])
check('boundary eligible', solve('eligible', boundary), [])
check('normal commit', solve('commit', normal), None)
check('boundary commit', solve('commit', boundary), None)
check('normal reason', solve('reason', normal), 'retired')
check('boundary reason', solve('reason', boundary), None)
check('normal selected', solve('selected', normal), 'c')
check('boundary selected', solve('selected', boundary), None)
check('normal row-flags', solve('row-flags', normal), [True,False,True])
check('boundary row-flags', solve('row-flags', boundary), [])
check('normal first-enabled', solve('first-enabled', normal), 'b')
check('boundary first-enabled', solve('first-enabled', boundary), None)
check('normal status', solve('status', normal), 'available')
check('boundary status', solve('status', boundary), 'empty')
check('normal validation', solve('validation', normal), False)
check('boundary validation', solve('validation', boundary), True)
check('normal revalidate', solve('revalidate', normal), {'active':None,'epoch':N})
check('boundary revalidate', solve('revalidate', boundary), {'active':None,'epoch':N})
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('selected', 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 == 'visible': return []
    if event == 'eligible': return [x for x in d['ids'] if x not in d['disabled']]
    if event == 'commit': return d['active'] if d['active'] in d['ids'] and d['active'] not in d['disabled'] else None
    if event == 'reason': return d['reason'].get(d['active'])
    if event == 'selected': return d['value']
    if event == 'row-flags': return [x in d['disabled'] for x in d['ids']]
    if event == 'first-enabled': return next((x for x in d['ids'] if x not in d['disabled']),None)
    if event == 'status': return 'empty' if not d['ids'] else 'available' if any(x not in d['disabled'] for x in d['ids']) else 'unavailable'
    if event == 'validation': return d['value'] is None or d['value'] not in d['disabled']
    if event == 'revalidate': return {'active':None if d['active'] in d['disabled'] else d['active'],'epoch':d['epoch']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'ids':['a','b','c'],'disabled':['a','c'],'labels':['Same','Same','See'],'active':'a','value':'c','reason':{'a':'retired','c':'restricted'},'epoch':N}
boundary = {'ids':[],'disabled':[],'labels':[],'active':None,'value':None,'reason':{},'epoch':N}
check('normal visible', solve('visible', normal), ['a','b','c'])
check('boundary visible', solve('visible', boundary), [])
check('normal eligible', solve('eligible', normal), ['b'])
check('boundary eligible', solve('eligible', boundary), [])
check('normal commit', solve('commit', normal), None)
check('boundary commit', solve('commit', boundary), None)
check('normal reason', solve('reason', normal), 'retired')
check('boundary reason', solve('reason', boundary), None)
check('normal selected', solve('selected', normal), 'c')
check('boundary selected', solve('selected', boundary), None)
check('normal row-flags', solve('row-flags', normal), [True,False,True])
check('boundary row-flags', solve('row-flags', boundary), [])
check('normal first-enabled', solve('first-enabled', normal), 'b')
check('boundary first-enabled', solve('first-enabled', boundary), None)
check('normal status', solve('status', normal), 'available')
check('boundary status', solve('status', boundary), 'empty')
check('normal validation', solve('validation', normal), False)
check('boundary validation', solve('validation', boundary), True)
check('normal revalidate', solve('revalidate', normal), {'active':None,'epoch':N})
check('boundary revalidate', solve('revalidate', boundary), {'active':None,'epoch':N})
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('selected', 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 visible completion transition produces an incorrect observable state.

Unavailable options remain visible with reasons but cannot be committed or auto-selected. Availability is attached to identity, not display text. A committed unavailable value remains represented for correction. Disabled-only responses are distinct from empty results.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'visible': return d['ids']
    if event == 'eligible': return d['ids']
    if event == 'commit': return d['active'] if d['active'] in d['ids'] and d['active'] not in d['disabled'] else None
    if event == 'reason': return d['reason'].get(d['active'])
    if event == 'selected': return d['value']
    if event == 'row-flags': return [x in d['disabled'] for x in d['ids']]
    if event == 'first-enabled': return next((x for x in d['ids'] if x not in d['disabled']),None)
    if event == 'status': return 'empty' if not d['ids'] else 'available' if any(x not in d['disabled'] for x in d['ids']) else 'unavailable'
    if event == 'validation': return d['value'] is None or d['value'] not in d['disabled']
    if event == 'revalidate': return {'active':None if d['active'] in d['disabled'] else d['active'],'epoch':d['epoch']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'ids':['a','b','c'],'disabled':['a','c'],'labels':['Same','Same','See'],'active':'a','value':'c','reason':{'a':'retired','c':'restricted'},'epoch':N}
boundary = {'ids':[],'disabled':[],'labels':[],'active':None,'value':None,'reason':{},'epoch':N}
check('normal visible', solve('visible', normal), ['a','b','c'])
check('boundary visible', solve('visible', boundary), [])
check('normal eligible', solve('eligible', normal), ['b'])
check('boundary eligible', solve('eligible', boundary), [])
check('normal commit', solve('commit', normal), None)
check('boundary commit', solve('commit', boundary), None)
check('normal reason', solve('reason', normal), 'retired')
check('boundary reason', solve('reason', boundary), None)
check('normal selected', solve('selected', normal), 'c')
check('boundary selected', solve('selected', boundary), None)
check('normal row-flags', solve('row-flags', normal), [True,False,True])
check('boundary row-flags', solve('row-flags', boundary), [])
check('normal first-enabled', solve('first-enabled', normal), 'b')
check('boundary first-enabled', solve('first-enabled', boundary), None)
check('normal status', solve('status', normal), 'available')
check('boundary status', solve('status', boundary), 'empty')
check('normal validation', solve('validation', normal), False)
check('boundary validation', solve('validation', boundary), True)
check('normal revalidate', solve('revalidate', normal), {'active':None,'epoch':N})
check('boundary revalidate', solve('revalidate', boundary), {'active':None,'epoch':N})
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('selected', 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 == 'visible': return d['ids']
    if event == 'eligible': return [x for x in d['ids'] if x in d['disabled']]
    if event == 'commit': return d['active'] if d['active'] in d['ids'] and d['active'] not in d['disabled'] else None
    if event == 'reason': return d['reason'].get(d['active'])
    if event == 'selected': return d['value']
    if event == 'row-flags': return [x in d['disabled'] for x in d['ids']]
    if event == 'first-enabled': return next((x for x in d['ids'] if x not in d['disabled']),None)
    if event == 'status': return 'empty' if not d['ids'] else 'available' if any(x not in d['disabled'] for x in d['ids']) else 'unavailable'
    if event == 'validation': return d['value'] is None or d['value'] not in d['disabled']
    if event == 'revalidate': return {'active':None if d['active'] in d['disabled'] else d['active'],'epoch':d['epoch']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'ids':['a','b','c'],'disabled':['a','c'],'labels':['Same','Same','See'],'active':'a','value':'c','reason':{'a':'retired','c':'restricted'},'epoch':N}
boundary = {'ids':[],'disabled':[],'labels':[],'active':None,'value':None,'reason':{},'epoch':N}
check('normal visible', solve('visible', normal), ['a','b','c'])
check('boundary visible', solve('visible', boundary), [])
check('normal eligible', solve('eligible', normal), ['b'])
check('boundary eligible', solve('eligible', boundary), [])
check('normal commit', solve('commit', normal), None)
check('boundary commit', solve('commit', boundary), None)
check('normal reason', solve('reason', normal), 'retired')
check('boundary reason', solve('reason', boundary), None)
check('normal selected', solve('selected', normal), 'c')
check('boundary selected', solve('selected', boundary), None)
check('normal row-flags', solve('row-flags', normal), [True,False,True])
check('boundary row-flags', solve('row-flags', boundary), [])
check('normal first-enabled', solve('first-enabled', normal), 'b')
check('boundary first-enabled', solve('first-enabled', boundary), None)
check('normal status', solve('status', normal), 'available')
check('boundary status', solve('status', boundary), 'empty')
check('normal validation', solve('validation', normal), False)
check('boundary validation', solve('validation', boundary), True)
check('normal revalidate', solve('revalidate', normal), {'active':None,'epoch':N})
check('boundary revalidate', solve('revalidate', boundary), {'active':None,'epoch':N})
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('selected', 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 eligible completion transition produces an incorrect observable state.

Unavailable options remain visible with reasons but cannot be committed or auto-selected. Availability is attached to identity, not display text. A committed unavailable value remains represented for correction. Disabled-only responses are distinct from empty results.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'visible': return d['ids']
    if event == 'eligible': return [x for x in d['ids'] if x not in d['disabled']]
    if event == 'commit': return d['active']
    if event == 'reason': return d['reason'].get(d['active'])
    if event == 'selected': return d['value']
    if event == 'row-flags': return [x in d['disabled'] for x in d['ids']]
    if event == 'first-enabled': return next((x for x in d['ids'] if x not in d['disabled']),None)
    if event == 'status': return 'empty' if not d['ids'] else 'available' if any(x not in d['disabled'] for x in d['ids']) else 'unavailable'
    if event == 'validation': return d['value'] is None or d['value'] not in d['disabled']
    if event == 'revalidate': return {'active':None if d['active'] in d['disabled'] else d['active'],'epoch':d['epoch']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'ids':['a','b','c'],'disabled':['a','c'],'labels':['Same','Same','See'],'active':'a','value':'c','reason':{'a':'retired','c':'restricted'},'epoch':N}
boundary = {'ids':[],'disabled':[],'labels':[],'active':None,'value':None,'reason':{},'epoch':N}
check('normal visible', solve('visible', normal), ['a','b','c'])
check('boundary visible', solve('visible', boundary), [])
check('normal eligible', solve('eligible', normal), ['b'])
check('boundary eligible', solve('eligible', boundary), [])
check('normal commit', solve('commit', normal), None)
check('boundary commit', solve('commit', boundary), None)
check('normal reason', solve('reason', normal), 'retired')
check('boundary reason', solve('reason', boundary), None)
check('normal selected', solve('selected', normal), 'c')
check('boundary selected', solve('selected', boundary), None)
check('normal row-flags', solve('row-flags', normal), [True,False,True])
check('boundary row-flags', solve('row-flags', boundary), [])
check('normal first-enabled', solve('first-enabled', normal), 'b')
check('boundary first-enabled', solve('first-enabled', boundary), None)
check('normal status', solve('status', normal), 'available')
check('boundary status', solve('status', boundary), 'empty')
check('normal validation', solve('validation', normal), False)
check('boundary validation', solve('validation', boundary), True)
check('normal revalidate', solve('revalidate', normal), {'active':None,'epoch':N})
check('boundary revalidate', solve('revalidate', boundary), {'active':None,'epoch':N})
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('selected', 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 == 'visible': return d['ids']
    if event == 'eligible': return [x for x in d['ids'] if x not in d['disabled']]
    if event == 'commit': return d['value']
    if event == 'reason': return d['reason'].get(d['active'])
    if event == 'selected': return d['value']
    if event == 'row-flags': return [x in d['disabled'] for x in d['ids']]
    if event == 'first-enabled': return next((x for x in d['ids'] if x not in d['disabled']),None)
    if event == 'status': return 'empty' if not d['ids'] else 'available' if any(x not in d['disabled'] for x in d['ids']) else 'unavailable'
    if event == 'validation': return d['value'] is None or d['value'] not in d['disabled']
    if event == 'revalidate': return {'active':None if d['active'] in d['disabled'] else d['active'],'epoch':d['epoch']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'ids':['a','b','c'],'disabled':['a','c'],'labels':['Same','Same','See'],'active':'a','value':'c','reason':{'a':'retired','c':'restricted'},'epoch':N}
boundary = {'ids':[],'disabled':[],'labels':[],'active':None,'value':None,'reason':{},'epoch':N}
check('normal visible', solve('visible', normal), ['a','b','c'])
check('boundary visible', solve('visible', boundary), [])
check('normal eligible', solve('eligible', normal), ['b'])
check('boundary eligible', solve('eligible', boundary), [])
check('normal commit', solve('commit', normal), None)
check('boundary commit', solve('commit', boundary), None)
check('normal reason', solve('reason', normal), 'retired')
check('boundary reason', solve('reason', boundary), None)
check('normal selected', solve('selected', normal), 'c')
check('boundary selected', solve('selected', boundary), None)
check('normal row-flags', solve('row-flags', normal), [True,False,True])
check('boundary row-flags', solve('row-flags', boundary), [])
check('normal first-enabled', solve('first-enabled', normal), 'b')
check('boundary first-enabled', solve('first-enabled', boundary), None)
check('normal status', solve('status', normal), 'available')
check('boundary status', solve('status', boundary), 'empty')
check('normal validation', solve('validation', normal), False)
check('boundary validation', solve('validation', boundary), True)
check('normal revalidate', solve('revalidate', normal), {'active':None,'epoch':N})
check('boundary revalidate', solve('revalidate', boundary), {'active':None,'epoch':N})
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('selected', 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 commit completion transition produces an incorrect observable state.

Unavailable options remain visible with reasons but cannot be committed or auto-selected. Availability is attached to identity, not display text. A committed unavailable value remains represented for correction. Disabled-only responses are distinct from empty results.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'visible': return d['ids']
    if event == 'eligible': return [x for x in d['ids'] if x not in d['disabled']]
    if event == 'commit': return d['active'] if d['active'] in d['ids'] and d['active'] not in d['disabled'] else None
    if event == 'reason': return None
    if event == 'selected': return d['value']
    if event == 'row-flags': return [x in d['disabled'] for x in d['ids']]
    if event == 'first-enabled': return next((x for x in d['ids'] if x not in d['disabled']),None)
    if event == 'status': return 'empty' if not d['ids'] else 'available' if any(x not in d['disabled'] for x in d['ids']) else 'unavailable'
    if event == 'validation': return d['value'] is None or d['value'] not in d['disabled']
    if event == 'revalidate': return {'active':None if d['active'] in d['disabled'] else d['active'],'epoch':d['epoch']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'ids':['a','b','c'],'disabled':['a','c'],'labels':['Same','Same','See'],'active':'a','value':'c','reason':{'a':'retired','c':'restricted'},'epoch':N}
boundary = {'ids':[],'disabled':[],'labels':[],'active':None,'value':None,'reason':{},'epoch':N}
check('normal visible', solve('visible', normal), ['a','b','c'])
check('boundary visible', solve('visible', boundary), [])
check('normal eligible', solve('eligible', normal), ['b'])
check('boundary eligible', solve('eligible', boundary), [])
check('normal commit', solve('commit', normal), None)
check('boundary commit', solve('commit', boundary), None)
check('normal reason', solve('reason', normal), 'retired')
check('boundary reason', solve('reason', boundary), None)
check('normal selected', solve('selected', normal), 'c')
check('boundary selected', solve('selected', boundary), None)
check('normal row-flags', solve('row-flags', normal), [True,False,True])
check('boundary row-flags', solve('row-flags', boundary), [])
check('normal first-enabled', solve('first-enabled', normal), 'b')
check('boundary first-enabled', solve('first-enabled', boundary), None)
check('normal status', solve('status', normal), 'available')
check('boundary status', solve('status', boundary), 'empty')
check('normal validation', solve('validation', normal), False)
check('boundary validation', solve('validation', boundary), True)
check('normal revalidate', solve('revalidate', normal), {'active':None,'epoch':N})
check('boundary revalidate', solve('revalidate', boundary), {'active':None,'epoch':N})
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('selected', 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 == 'visible': return d['ids']
    if event == 'eligible': return [x for x in d['ids'] if x not in d['disabled']]
    if event == 'commit': return d['active'] if d['active'] in d['ids'] and d['active'] not in d['disabled'] else None
    if event == 'reason': return d['active']
    if event == 'selected': return d['value']
    if event == 'row-flags': return [x in d['disabled'] for x in d['ids']]
    if event == 'first-enabled': return next((x for x in d['ids'] if x not in d['disabled']),None)
    if event == 'status': return 'empty' if not d['ids'] else 'available' if any(x not in d['disabled'] for x in d['ids']) else 'unavailable'
    if event == 'validation': return d['value'] is None or d['value'] not in d['disabled']
    if event == 'revalidate': return {'active':None if d['active'] in d['disabled'] else d['active'],'epoch':d['epoch']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'ids':['a','b','c'],'disabled':['a','c'],'labels':['Same','Same','See'],'active':'a','value':'c','reason':{'a':'retired','c':'restricted'},'epoch':N}
boundary = {'ids':[],'disabled':[],'labels':[],'active':None,'value':None,'reason':{},'epoch':N}
check('normal visible', solve('visible', normal), ['a','b','c'])
check('boundary visible', solve('visible', boundary), [])
check('normal eligible', solve('eligible', normal), ['b'])
check('boundary eligible', solve('eligible', boundary), [])
check('normal commit', solve('commit', normal), None)
check('boundary commit', solve('commit', boundary), None)
check('normal reason', solve('reason', normal), 'retired')
check('boundary reason', solve('reason', boundary), None)
check('normal selected', solve('selected', normal), 'c')
check('boundary selected', solve('selected', boundary), None)
check('normal row-flags', solve('row-flags', normal), [True,False,True])
check('boundary row-flags', solve('row-flags', boundary), [])
check('normal first-enabled', solve('first-enabled', normal), 'b')
check('boundary first-enabled', solve('first-enabled', boundary), None)
check('normal status', solve('status', normal), 'available')
check('boundary status', solve('status', boundary), 'empty')
check('normal validation', solve('validation', normal), False)
check('boundary validation', solve('validation', boundary), True)
check('normal revalidate', solve('revalidate', normal), {'active':None,'epoch':N})
check('boundary revalidate', solve('revalidate', boundary), {'active':None,'epoch':N})
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('selected', 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 reason completion transition produces an incorrect observable state.

Unavailable options remain visible with reasons but cannot be committed or auto-selected. Availability is attached to identity, not display text. A committed unavailable value remains represented for correction. Disabled-only responses are distinct from empty results.

split: open-access