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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate']
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):]
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']+d['suffix']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['candidate']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['candidate']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return None
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return True
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end'] and d['start']==0
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']<=d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return False
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['draft']+d['candidate']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':'','ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':d['suffix']}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [0,len(d['candidate'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The visible-end completion transition produces an incorrect observable state.

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':d['suffix'],'preview_epoch':None}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':d['preview_epoch']}
    if event == 'copy': return d['draft'][d['start']:d['end']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return (d['draft']+d['suffix'])[d['start']:]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'suffix': return d['candidate'][len(d['draft']):] if d['candidate'].startswith(d['draft']) else ''
    if event == 'submit': return d['draft']
    if event == 'value': return d['value']
    if event == 'selected': return d['start']==d['end']
    if event == 'fresh': return d['preview_epoch']==d['epoch']
    if event == 'accept': return d['candidate'] if d['matching'] else d['draft']
    if event == 'reject': return {'draft':d['draft'],'ghost':''}
    if event == 'visible-end': return [len(d['draft']),len(d['draft'])+len(d['suffix'])]
    if event == 'edit': return {'ghost':'','preview_epoch':None}
    if event == 'copy': return d['draft']+d['suffix']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'pea','candidate':'pear','value':'p1','start':3,'end':3,'epoch':N,'preview_epoch':N-1,'matching':True,'suffix':'r'}
boundary = {'draft':'x','candidate':'pear','value':None,'start':0,'end':1,'epoch':N,'preview_epoch':N,'matching':False,'suffix':''}
check('normal suffix', solve('suffix', normal), 'r')
check('boundary suffix', solve('suffix', boundary), '')
check('normal submit', solve('submit', normal), 'pea')
check('boundary submit', solve('submit', boundary), 'x')
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), None)
check('normal selected', solve('selected', normal), True)
check('boundary selected', solve('selected', boundary), False)
check('normal fresh', solve('fresh', normal), False)
check('boundary fresh', solve('fresh', boundary), True)
check('normal accept', solve('accept', normal), 'pear')
check('boundary accept', solve('accept', boundary), 'x')
check('normal reject', solve('reject', normal), {'draft':'pea','ghost':''})
check('boundary reject', solve('reject', boundary), {'draft':'x','ghost':''})
check('normal visible-end', solve('visible-end', normal), [3,4])
check('boundary visible-end', solve('visible-end', boundary), [1,1])
check('normal edit', solve('edit', normal), {'ghost':'','preview_epoch':None})
check('boundary edit', solve('edit', boundary), {'ghost':'','preview_epoch':None})
check('normal copy', solve('copy', normal), '')
check('boundary copy', solve('copy', boundary), 'x')
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('submit', variant), 'q'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

An inline ghost suffix is presentation only: it must not alter submitted draft or committed identifier. Prefix-compatible candidates yield only their remaining suffix; preview acceptance materializes the candidate and rejection keeps the draft. A noncollapsed caret selection suppresses ghost text.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'trim': return d['draft']
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 == 'trim': return d['draft'].lstrip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 trim completion transition produces an incorrect observable state.

This picker may create a new option from trimmed draft only when creation is enabled, the draft is nonempty, no case-insensitive exact label exists, and no create transaction is pending. Synthetic create rows carry a distinct namespace and raw text is never mistaken for a persisted identifier.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'] in d['labels']
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip() in d['labels']
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 picker may create a new option from trimmed draft only when creation is enabled, the draft is nonempty, no case-insensitive exact label exists, and no create transaction is pending. Synthetic create rows carry a distinct namespace and raw text is never mistaken for a persisted identifier.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'])
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return True
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 nonempty completion transition produces an incorrect observable state.

This picker may create a new option from trimmed draft only when creation is enabled, the draft is nonempty, no case-insensitive exact label exists, and no create transaction is pending. Synthetic create rows carry a distinct namespace and raw text is never mistaken for a persisted identifier.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return True
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return bool(d['draft'])
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 permission completion transition produces an incorrect observable state.

This picker may create a new option from trimmed draft only when creation is enabled, the draft is nonempty, no case-insensitive exact label exists, and no create transaction is pending. Synthetic create rows carry a distinct namespace and raw text is never mistaken for a persisted identifier.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return True
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 busy completion transition produces an incorrect observable state.

This picker may create a new option from trimmed draft only when creation is enabled, the draft is nonempty, no case-insensitive exact label exists, and no create transaction is pending. Synthetic create rows carry a distinct namespace and raw text is never mistaken for a persisted identifier.

split: open-access