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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return ''
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['after']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 undo-text completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['after']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return None
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 undo-value completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['after']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return 0
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 undo-caret completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['before']['text']+d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['before']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 redo-text completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['before']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['text']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 redo-value completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['before']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return len(d['draft'])
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 redo-caret completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return d['redo']
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return d['undo']
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']['text'],d['before']['value']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return [d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 transaction completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']+[d['hover']]
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return []
    if event == 'redo-divergence': return d['draft']==d['before']['text']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 hover completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return bool(d['redo'])
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 == 'undo-text': return d['before']['text']
    if event == 'undo-value': return d['before']['value']
    if event == 'undo-caret': return d['before']['caret']
    if event == 'redo-text': return d['after']['text']
    if event == 'redo-value': return d['after']['value']
    if event == 'redo-caret': return d['after']['caret']
    if event == 'edit': return []
    if event == 'transaction': return d['undo']+[d['before']]
    if event == 'hover': return d['undo']
    if event == 'redo-divergence': return True
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'before':{'text':'pea','value':None,'caret':3},'after':{'text':'pear','value':'p1','caret':4},'undo':['u1'],'redo':['r1'],'hover':'p2','draft':'pear!','epoch':N}
boundary = {'before':{'text':'','value':'','caret':0},'after':{'text':'x','value':'x1','caret':1},'undo':[],'redo':[],'hover':None,'draft':'','epoch':N}
check('normal undo-text', solve('undo-text', normal), 'pea')
check('boundary undo-text', solve('undo-text', boundary), '')
check('normal undo-value', solve('undo-value', normal), None)
check('boundary undo-value', solve('undo-value', boundary), '')
check('normal undo-caret', solve('undo-caret', normal), 3)
check('boundary undo-caret', solve('undo-caret', boundary), 0)
check('normal redo-text', solve('redo-text', normal), 'pear')
check('boundary redo-text', solve('redo-text', boundary), 'x')
check('normal redo-value', solve('redo-value', normal), 'p1')
check('boundary redo-value', solve('redo-value', boundary), 'x1')
check('normal redo-caret', solve('redo-caret', normal), 4)
check('boundary redo-caret', solve('redo-caret', boundary), 1)
check('normal edit', solve('edit', normal), [])
check('boundary edit', solve('edit', boundary), [])
check('normal transaction', solve('transaction', normal), ['u1',{'text':'pea','value':None,'caret':3}])
check('boundary transaction', solve('transaction', boundary), [{'text':'','value':'','caret':0}])
check('normal hover', solve('hover', normal), ['u1'])
check('boundary hover', solve('hover', boundary), [])
check('normal redo-divergence', solve('redo-divergence', normal), False)
check('boundary redo-divergence', solve('redo-divergence', boundary), True)
variant = dict(normal, **{'after':{'text':'p'*N,'value':'p','caret':N}})
check('variant query or selection payload', solve('redo-text', variant), 'p'*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 redo-divergence completion transition produces an incorrect observable state.

A completion acceptance is one undo transaction containing draft, committed identity and caret. Undo restores the pre-accept snapshot; redo restores the accepted snapshot. A subsequent edit discards redo, transient hover never enters the stack, and history snapshots own their data.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return True
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return bool(d['value'])
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

A selected identifier may need asynchronous label resolution independently of query suggestions. Responses bind to selected identity and selection epoch. Until resolved the identity stays committed; failed resolution shows an explicit fallback and never inserts the identifier into the query. Empty labels are valid resolutions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']<=d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return False
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

A selected identifier may need asynchronous label resolution independently of query suggestions. Responses bind to selected identity and selection epoch. Until resolved the identity stays committed; failed resolution shows an explicit fallback and never inserts the identifier into the query. Empty labels are valid resolutions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return None if d['pending'] else d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['label']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

A selected identifier may need asynchronous label resolution independently of query suggestions. Responses bind to selected identity and selection epoch. Until resolved the identity stays committed; failed resolution shows an explicit fallback and never inserts the identifier into the query. Empty labels are valid resolutions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['value']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['label']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

A selected identifier may need asynchronous label resolution independently of query suggestions. Responses bind to selected identity and selection epoch. Until resolved the identity stays committed; failed resolution shows an explicit fallback and never inserts the identifier into the query. Empty labels are valid resolutions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label'] or d['fallback']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['value']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The empty-label completion transition produces an incorrect observable state.

A selected identifier may need asynchronous label resolution independently of query suggestions. Responses bind to selected identity and selection epoch. Until resolved the identity stays committed; failed resolution shows an explicit fallback and never inserts the identifier into the query. Empty labels are valid resolutions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['value'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

N = 1
observations = []
def solve(event, d):
    if event == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', variant), 'id'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

A selected identifier may need asynchronous label resolution independently of query suggestions. Responses bind to selected identity and selection epoch. Until resolved the identity stays committed; failed resolution shows an explicit fallback and never inserts the identifier into the query. Empty labels are valid resolutions.

split: open-access