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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['draft']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['value']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 revert completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['active']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return None
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return True
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return False
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 pointer completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return True
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return False
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 composition completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if d['exact_ids'] else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 exact completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return d['touched']
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return False
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 touched completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return d['pending']
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return d['draft']
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 pending completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':True,'free_text':d['draft']}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':bool(d['value']),'free_text':d['draft'] or None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 free-text-rejection completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':False,'candidate':d['active']}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':d['active']}
    if event == 'changed': return False
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 unresolved-validation completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return d['draft']!=d['label']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 == 'revert': return d['label']
    if event == 'value': return d['value']
    if event == 'pointer': return not d['pointer_pending']
    if event == 'composition': return not d['composing']
    if event == 'exact': return d['exact_ids'][0] if len(d['exact_ids'])==1 else None
    if event == 'touched': return True
    if event == 'pending': return None
    if event == 'free-text-rejection': return {'resolved':d['value'] is not None,'free_text':None}
    if event == 'unresolved-validation': return {'invalid_draft':d['draft']!=d['label'],'candidate':None}
    if event == 'changed': return True
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'peach','value':'p1','label':'Pear','active':'p2','pointer_pending':True,'composing':True,'exact_ids':['p3','p4'],'query_epoch':N,'pending':'peach','touched':False}
boundary = {'draft':'','value':None,'label':'','active':None,'pointer_pending':False,'composing':False,'exact_ids':[''],'query_epoch':N,'pending':None,'touched':True}
check('normal revert', solve('revert', normal), 'Pear')
check('boundary revert', solve('revert', boundary), '')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal pointer', solve('pointer', normal), False)
check('boundary pointer', solve('pointer', boundary), True)
check('normal composition', solve('composition', normal), False)
check('boundary composition', solve('composition', boundary), True)
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal touched', solve('touched', normal), True)
check('boundary touched', solve('touched', boundary), True)
check('normal pending', solve('pending', normal), None)
check('boundary pending', solve('pending', boundary), None)
check('normal free-text-rejection', solve('free-text-rejection', normal), {'resolved':True,'free_text':None})
check('boundary free-text-rejection', solve('free-text-rejection', boundary), {'resolved':False,'free_text':None})
check('normal unresolved-validation', solve('unresolved-validation', normal), {'invalid_draft':True,'candidate':None})
check('boundary unresolved-validation', solve('unresolved-validation', boundary), {'invalid_draft':False,'candidate':None})
check('normal changed', solve('changed', normal), False)
check('boundary changed', solve('changed', boundary), False)
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('revert', 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 changed completion transition produces an incorrect observable state.

This strict-selection picker reverts an unresolved draft to the committed label after blur unless a suggestion pointer acceptance or IME composition is in progress. Exact unique candidate confirmation is an explicit separate transition. Blur never chooses a highlighted candidate merely because it exists.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'initial-draft': return d['last_query']
    if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
    if event == 'selection': return [0,len(d['label'])]
    if event == 'identity': return d['value']
    if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 == 'initial-draft': return d['prior_label']
    if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
    if event == 'selection': return [0,len(d['label'])]
    if event == 'identity': return d['value']
    if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 initial-draft completion transition produces an incorrect observable state.

Reopening this editable picker starts from its committed label, keeps identity until text actually diverges, selects the whole label for replacement, and preserves explicit unresolved drafts on reopen. An accepted label is a baseline, not an automatic new search. Choosing edit mode invalidates old result context.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'initial-draft': return d['label']
    if event == 'unresolved-draft': return d['label']
    if event == 'selection': return [0,len(d['label'])]
    if event == 'identity': return d['value']
    if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 == 'initial-draft': return d['label']
    if event == 'unresolved-draft': return d['last_query']
    if event == 'selection': return [0,len(d['label'])]
    if event == 'identity': return d['value']
    if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 unresolved-draft completion transition produces an incorrect observable state.

Reopening this editable picker starts from its committed label, keeps identity until text actually diverges, selects the whole label for replacement, and preserves explicit unresolved drafts on reopen. An accepted label is a baseline, not an automatic new search. Choosing edit mode invalidates old result context.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'initial-draft': return d['label']
    if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
    if event == 'selection': return [0,len(d['last_query'])]
    if event == 'identity': return d['value']
    if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 == 'initial-draft': return d['label']
    if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
    if event == 'selection': return [len(d['label']),len(d['label'])]
    if event == 'identity': return d['value']
    if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 selection completion transition produces an incorrect observable state.

Reopening this editable picker starts from its committed label, keeps identity until text actually diverges, selects the whole label for replacement, and preserves explicit unresolved drafts on reopen. An accepted label is a baseline, not an automatic new search. Choosing edit mode invalidates old result context.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'initial-draft': return d['label']
    if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
    if event == 'selection': return [0,len(d['label'])]
    if event == 'identity': return None
    if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 == 'initial-draft': return d['label']
    if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
    if event == 'selection': return [0,len(d['label'])]
    if event == 'identity': return d['active']
    if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 identity completion transition produces an incorrect observable state.

Reopening this editable picker starts from its committed label, keeps identity until text actually diverges, selects the whole label for replacement, and preserves explicit unresolved drafts on reopen. An accepted label is a baseline, not an automatic new search. Choosing edit mode invalidates old result context.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'initial-draft': return d['label']
    if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
    if event == 'selection': return [0,len(d['label'])]
    if event == 'identity': return d['value']
    if event == 'diverged': return d['value']
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 == 'initial-draft': return d['label']
    if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
    if event == 'selection': return [0,len(d['label'])]
    if event == 'identity': return d['value']
    if event == 'diverged': return None
    if event == 'baseline': return d['label']
    if event == 'accepted-search': return not d['accepted']
    if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
    if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
    if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', 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 diverged completion transition produces an incorrect observable state.

Reopening this editable picker starts from its committed label, keeps identity until text actually diverges, selects the whole label for replacement, and preserves explicit unresolved drafts on reopen. An accepted label is a baseline, not an automatic new search. Choosing edit mode invalidates old result context.

split: open-access