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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']*2+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 trigger completion transition produces an incorrect observable state.

A mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['trigger']+d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+str(N))
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['other']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return ''
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 delimiter completion transition produces an incorrect observable state.

A mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['end']
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 caret completion transition produces an incorrect observable state.

A mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],len(d['text'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['end']]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 span completion transition produces an incorrect observable state.

A mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return True
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']<=d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 stale completion transition produces an incorrect observable state.

A mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return ''
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['start']:]
    if event == 'descriptor': return [d['trigger'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 tail completion transition produces an incorrect observable state.

A mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['other'],d['query']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 == 'text': return d['text'][:d['start']]+d['trigger']+d['label']+d['text'][d['end']:]
    if event == 'identity': return d['id']
    if event == 'trigger': return d['trigger']+d['label']
    if event == 'query': return d['query']
    if event == 'delimiter': return '' if d['after'].startswith(' ') else ' '
    if event == 'caret': return d['start']+len(d['trigger'])+len(d['label'])
    if event == 'span': return [d['start'],d['start']+len(d['trigger'])+len(d['label'])]
    if event == 'stale': return d['span_epoch']==d['epoch']
    if event == 'tail': return d['text'][d['end']:]
    if event == 'descriptor': return [d['trigger'],d['label']]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Hi @al now','start':3,'end':6,'label':'Alice','id':'u'+str(N),'trigger':'@','after':' now','query':'al','span_epoch':N-1,'epoch':N,'other':'#topic'}
boundary = {'text':'@','start':0,'end':1,'label':'','id':'','trigger':'@','after':'','query':'','span_epoch':N,'epoch':N,'other':''}
check('normal text', solve('text', normal), 'Hi @Alice now')
check('boundary text', solve('text', boundary), '@')
check('normal identity', solve('identity', normal), 'u'+str(N))
check('boundary identity', solve('identity', boundary), '')
check('normal trigger', solve('trigger', normal), '@Alice')
check('boundary trigger', solve('trigger', boundary), '@')
check('normal query', solve('query', normal), 'al')
check('boundary query', solve('query', boundary), '')
check('normal delimiter', solve('delimiter', normal), '')
check('boundary delimiter', solve('delimiter', boundary), ' ')
check('normal caret', solve('caret', normal), 9)
check('boundary caret', solve('caret', boundary), 1)
check('normal span', solve('span', normal), [3,9])
check('boundary span', solve('span', boundary), [0,1])
check('normal stale', solve('stale', normal), False)
check('boundary stale', solve('stale', boundary), True)
check('normal tail', solve('tail', normal), ' now')
check('boundary tail', solve('tail', boundary), '')
check('normal descriptor', solve('descriptor', normal), ['@','al'])
check('boundary descriptor', solve('descriptor', boundary), ['@',''])
variant = dict(normal, **{'id':'person'+str(N)})
check('variant query or selection payload', solve('identity', variant), 'person'+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 descriptor completion transition produces an incorrect observable state.

A mention completion replaces only the active trigger span and stores a stable entity identifier separately from visible text. The trigger character is preserved exactly once, a trailing delimiter is added only when absent, and a stale mention query cannot replace a different trigger span. Offsets are code points.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'lookup-parent': return d['path']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 == 'lookup-parent': return ''
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 lookup-parent completion transition produces an incorrect observable state.

Path autocomplete treats the prefix before the last slash as lookup scope and replaces only the final segment. Directory acceptance appends a slash and keeps completion active; leaf acceptance commits. Empty final segments request children, and responses bind to the exact parent path.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['path']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['parent']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 lookup-query completion transition produces an incorrect observable state.

Path autocomplete treats the prefix before the last slash as lookup scope and replaces only the final segment. Directory acceptance appends a slash and keeps completion active; leaf acceptance commits. Empty final segments request children, and responses bind to the exact parent path.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['path']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 replace completion transition produces an incorrect observable state.

Path autocomplete treats the prefix before the last slash as lookup scope and replaces only the final segment. Directory acceptance appends a slash and keeps completion active; leaf acceptance commits. Empty final segments request children, and responses bind to the exact parent path.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+'/'
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 directory-suffix completion transition produces an incorrect observable state.

Path autocomplete treats the prefix before the last slash as lookup scope and replaces only the final segment. Directory acceptance appends a slash and keeps completion active; leaf acceptance commits. Empty final segments request children, and responses bind to the exact parent path.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

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

Path autocomplete treats the prefix before the last slash as lookup scope and replaces only the final segment. Directory acceptance appends a slash and keeps completion active; leaf acceptance commits. Empty final segments request children, and responses bind to the exact parent path.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return False
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return True
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 continue completion transition produces an incorrect observable state.

Path autocomplete treats the prefix before the last slash as lookup scope and replaces only the final segment. Directory acceptance appends a slash and keeps completion active; leaf acceptance commits. Empty final segments request children, and responses bind to the exact parent path.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['parent'].startswith(d['response_parent'])
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+('/' if d['directory'] else '')
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return True
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*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 response-parent completion transition produces an incorrect observable state.

Path autocomplete treats the prefix before the last slash as lookup scope and replaces only the final segment. Directory acceptance appends a slash and keeps completion active; leaf acceptance commits. Empty final segments request children, and responses bind to the exact parent path.

split: open-access