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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['label']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id'] or None
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 value completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['draft']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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)

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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label'] or d['draft']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 display completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['highlight']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['previous']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 snapshot completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return 'local'
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return 'remote'
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 source completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return {}
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return {'id':d['accepted']['id']}
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 metadata completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return []
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 reaccept-change completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['highlight']['id'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['accepted']['id'],d['previous']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 change completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return 'keyboard'
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return 'pointer'
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 reason completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':d['accepted']['id']}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':'','active':None}
    if event == 'freshness': return d['accepted_epoch']==d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 cleanup completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']==d['query_epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 == 'value': return d['accepted']['id']
    if event == 'display': return d['accepted']['label']
    if event == 'snapshot': return d['accepted']['id']
    if event == 'source': return d['accepted']['source']
    if event == 'metadata': return d['accepted']['extra']
    if event == 'reaccept-change': return [] if d['previous']==d['accepted']['id'] else [[d['previous'],d['accepted']['id']]]
    if event == 'change': return [d['previous'],d['accepted']['id']]
    if event == 'reason': return d['reason']
    if event == 'cleanup': return {'draft':d['accepted']['label'],'active':None}
    if event == 'freshness': return d['accepted_epoch']>d['epoch']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'accepted':{'id':'p7','label':'Pear','source':'remote','extra':{'kind':'fruit'}},'highlight':{'id':'p8','label':'Peach'},'draft':'pe','epoch':N,'previous':'p1','reason':'pointer','query_epoch':N-1,'accepted_epoch':N}
boundary = {'accepted':{'id':'','label':'','source':'local','extra':{}},'highlight':{'id':'fallback','label':'Fallback'},'draft':'x','epoch':N,'previous':'','reason':'explicit','query_epoch':N,'accepted_epoch':N}
check('normal value', solve('value', normal), 'p7')
check('boundary value', solve('value', boundary), '')
check('normal display', solve('display', normal), 'Pear')
check('boundary display', solve('display', boundary), '')
check('normal snapshot', solve('snapshot', normal), 'p7')
check('boundary snapshot', solve('snapshot', boundary), '')
check('normal source', solve('source', normal), 'remote')
check('boundary source', solve('source', boundary), 'local')
check('normal metadata', solve('metadata', normal), {'kind':'fruit'})
check('boundary metadata', solve('metadata', boundary), {})
check('normal reaccept-change', solve('reaccept-change', normal), [['p1','p7']])
check('boundary reaccept-change', solve('reaccept-change', boundary), [])
check('normal change', solve('change', normal), ['p1','p7'])
check('boundary change', solve('change', boundary), ['',''])
check('normal reason', solve('reason', normal), 'pointer')
check('boundary reason', solve('reason', boundary), 'explicit')
check('normal cleanup', solve('cleanup', normal), {'draft':'Pear','active':None})
check('boundary cleanup', solve('cleanup', boundary), {'draft':'','active':None})
check('normal freshness', solve('freshness', normal), True)
check('boundary freshness', solve('freshness', boundary), True)
variant = dict(normal, **{'accepted':{'id':'id'+str(N),'label':'L'*N,'source':'local','extra':{}}})
check('variant query or selection payload', solve('display', 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 freshness completion transition produces an incorrect observable state.

Explicit suggestion acceptance emits the selected stable identifier, canonical label and source metadata, then replaces the draft and advances its edit epoch. A commit transaction uses the accepted result snapshot, never an unrelated current highlight. Empty identifiers and labels are valid values.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'repeat': return d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(zip(d['selected'],d['labels']))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 == 'repeat': return list(dict.fromkeys(d['selected']+[d['candidate']]))[::-1]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(zip(d['selected'],d['labels']))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 repeat completion transition produces an incorrect observable state.

Accepting a suggestion appends its identifier once, preserving selection order and independent duplicate labels. Removing a token removes that identity only. Already-selected results are excluded, pending query text is separate from selected values, and capacity is measured in committed identities.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return [d['new']]+d['selected']
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(zip(d['selected'],d['labels']))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return [d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(zip(d['selected'],d['labels']))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 append completion transition produces an incorrect observable state.

Accepting a suggestion appends its identifier once, preserving selection order and independent duplicate labels. Removing a token removes that identity only. Already-selected results are excluded, pending query text is separate from selected values, and capacity is measured in committed identities.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return []
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(zip(d['selected'],d['labels']))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x==d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(zip(d['selected'],d['labels']))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','id'+str(N)])
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The remove completion transition produces an incorrect observable state.

Accepting a suggestion appends its identifier once, preserving selection order and independent duplicate labels. Removing a token removes that identity only. Already-selected results are excluded, pending query text is separate from selected values, and capacity is measured in committed identities.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return d['results']
    if event == 'labels': return list(zip(d['selected'],d['labels']))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x in d['selected']]
    if event == 'labels': return list(zip(d['selected'],d['labels']))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 filter completion transition produces an incorrect observable state.

Accepting a suggestion appends its identifier once, preserving selection order and independent duplicate labels. Removing a token removes that identity only. Already-selected results are excluded, pending query text is separate from selected values, and capacity is measured in committed identities.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(dict(zip(d['labels'],d['selected'])).items())
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(zip(d['selected'],dict.fromkeys(d['labels'])))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 labels completion transition produces an incorrect observable state.

Accepting a suggestion appends its identifier once, preserving selection order and independent duplicate labels. Removing a token removes that identity only. Already-selected results are excluded, pending query text is separate from selected values, and capacity is measured in committed identities.

split: open-access