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['response_parent']==d['parent']
    if event == 'empty-segment': return 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 d['response_parent']==d['parent']
    if event == 'empty-segment': return d['path']
    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 empty-segment 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['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent'] 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)

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 == '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['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return 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 next-scope 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['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':True,'continue_at':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 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']}
    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 leaf-continuation 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 == 'position': return len(d['args'])
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['response_position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 position completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['response_command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['candidate']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 command completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args']+[d['candidate']]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"'
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 quote completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['candidate']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['response_command']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 verb completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return d['names']
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return d['used']
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 names completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return True
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return False
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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-command completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return True
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']>=d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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-position completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return len(d['args'])
    if event == 'argument-separator': return '' if d['position']+1<len(d['args']) else ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 next-position completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return ' '
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 == 'position': return d['position']
    if event == 'command': return d['command']
    if event == 'replace': return d['args'][:d['position']]+[d['candidate']]+d['args'][d['position']+1:]
    if event == 'quote': return '"'+d['candidate']+'"' if ' ' in d['candidate'] else d['candidate']
    if event == 'verb': return d['verb']
    if event == 'names': return [x for x in d['names'] if x not in d['used']]
    if event == 'response-command': return d['response_command']==d['command']
    if event == 'response-position': return d['response_position']==d['position']
    if event == 'next-position': return d['position']+1
    if event == 'argument-separator': return ''
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'verb':'open','args':['old','tail'],'position':0,'candidate':'my file','command':'open','response_command':'close','names':['--mode','--path'],'used':['--mode'],'epoch':N,'response_position':1}
boundary = {'verb':'run','args':[],'position':0,'candidate':'x','command':'run','response_command':'run','names':[],'used':[],'epoch':N,'response_position':0}
check('normal position', solve('position', normal), 0)
check('boundary position', solve('position', boundary), 0)
check('normal command', solve('command', normal), 'open')
check('boundary command', solve('command', boundary), 'run')
check('normal replace', solve('replace', normal), ['my file','tail'])
check('boundary replace', solve('replace', boundary), ['x'])
check('normal quote', solve('quote', normal), '"my file"')
check('boundary quote', solve('quote', boundary), 'x')
check('normal verb', solve('verb', normal), 'open')
check('boundary verb', solve('verb', boundary), 'run')
check('normal names', solve('names', normal), ['--path'])
check('boundary names', solve('names', boundary), [])
check('normal response-command', solve('response-command', normal), False)
check('boundary response-command', solve('response-command', boundary), True)
check('normal response-position', solve('response-position', normal), False)
check('boundary response-position', solve('response-position', boundary), True)
check('normal next-position', solve('next-position', normal), 1)
check('boundary next-position', solve('next-position', boundary), 1)
check('normal argument-separator', solve('argument-separator', normal), '')
check('boundary argument-separator', solve('argument-separator', boundary), ' ')
variant = dict(normal, **{'candidate':'a '*N})
check('variant query or selection payload', solve('quote', variant), '"'+'a '*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 argument-separator completion transition produces an incorrect observable state.

Structured command completion binds each candidate to command identity and argument position. Acceptance replaces the active argument only, quotes values containing spaces, and leaves the command verb and remaining arguments intact. Previously supplied named arguments are excluded from name suggestions.

split: open-access


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

N = 1
observations = []
def solve(event, d):
    if event == 'threshold': return bool(d['draft'])
    if event == 'browse': return d['browse']
    if event == 'recent': return d['recent'] if not d['draft'] else []
    if event == 'deferred-browse': return {'defer_browse':d['browse'] and d['composing'],'query':None if d['composing'] else d['draft']}
    if event == 'disabled': return not d['disabled']
    if event == 'readonly': return not d['readonly']
    if event == 'erase-pending': return None
    if event == 'erase-results': return []
    if event == 'empty-query-mode': return 'recent' if not d['draft'] and d['browse'] else 'type-more' if len(d['draft'])<d['minimum'] else 'results'
    if event == 'browse-descriptor': return {'mode':'browse' if d['browse'] else 'query','text':d['draft']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'p','minimum':2,'browse':False,'recent':['a'],'composing':True,'disabled':True,'readonly':True,'pending':'pe','rows':['p1'],'epoch':N}
boundary = {'draft':'','minimum':0,'browse':True,'recent':[],'composing':False,'disabled':False,'readonly':False,'pending':None,'rows':[],'epoch':N}
check('normal threshold', solve('threshold', normal), False)
check('boundary threshold', solve('threshold', boundary), True)
check('normal browse', solve('browse', normal), False)
check('boundary browse', solve('browse', boundary), True)
check('normal recent', solve('recent', normal), [])
check('boundary recent', solve('recent', boundary), [])
check('normal deferred-browse', solve('deferred-browse', normal), {'defer_browse':False,'query':None})
check('boundary deferred-browse', solve('deferred-browse', boundary), {'defer_browse':False,'query':''})
check('normal disabled', solve('disabled', normal), False)
check('boundary disabled', solve('disabled', boundary), True)
check('normal readonly', solve('readonly', normal), False)
check('boundary readonly', solve('readonly', boundary), True)
check('normal erase-pending', solve('erase-pending', normal), None)
check('boundary erase-pending', solve('erase-pending', boundary), None)
check('normal erase-results', solve('erase-results', normal), [])
check('boundary erase-results', solve('erase-results', boundary), [])
check('normal empty-query-mode', solve('empty-query-mode', normal), 'type-more')
check('boundary empty-query-mode', solve('empty-query-mode', boundary), 'recent')
check('normal browse-descriptor', solve('browse-descriptor', normal), {'mode':'query','text':'p'})
check('boundary browse-descriptor', solve('browse-descriptor', boundary), {'mode':'browse','text':''})
variant = dict(normal, **{'draft':'x'*N,'minimum':N})
check('variant query or selection payload', solve('threshold', variant), True)
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 == 'threshold': return len(d['draft'])>d['minimum']
    if event == 'browse': return d['browse']
    if event == 'recent': return d['recent'] if not d['draft'] else []
    if event == 'deferred-browse': return {'defer_browse':d['browse'] and d['composing'],'query':None if d['composing'] else d['draft']}
    if event == 'disabled': return not d['disabled']
    if event == 'readonly': return not d['readonly']
    if event == 'erase-pending': return None
    if event == 'erase-results': return []
    if event == 'empty-query-mode': return 'recent' if not d['draft'] and d['browse'] else 'type-more' if len(d['draft'])<d['minimum'] else 'results'
    if event == 'browse-descriptor': return {'mode':'browse' if d['browse'] else 'query','text':d['draft']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'p','minimum':2,'browse':False,'recent':['a'],'composing':True,'disabled':True,'readonly':True,'pending':'pe','rows':['p1'],'epoch':N}
boundary = {'draft':'','minimum':0,'browse':True,'recent':[],'composing':False,'disabled':False,'readonly':False,'pending':None,'rows':[],'epoch':N}
check('normal threshold', solve('threshold', normal), False)
check('boundary threshold', solve('threshold', boundary), True)
check('normal browse', solve('browse', normal), False)
check('boundary browse', solve('browse', boundary), True)
check('normal recent', solve('recent', normal), [])
check('boundary recent', solve('recent', boundary), [])
check('normal deferred-browse', solve('deferred-browse', normal), {'defer_browse':False,'query':None})
check('boundary deferred-browse', solve('deferred-browse', boundary), {'defer_browse':False,'query':''})
check('normal disabled', solve('disabled', normal), False)
check('boundary disabled', solve('disabled', boundary), True)
check('normal readonly', solve('readonly', normal), False)
check('boundary readonly', solve('readonly', boundary), True)
check('normal erase-pending', solve('erase-pending', normal), None)
check('boundary erase-pending', solve('erase-pending', boundary), None)
check('normal erase-results', solve('erase-results', normal), [])
check('boundary erase-results', solve('erase-results', boundary), [])
check('normal empty-query-mode', solve('empty-query-mode', normal), 'type-more')
check('boundary empty-query-mode', solve('empty-query-mode', boundary), 'recent')
check('normal browse-descriptor', solve('browse-descriptor', normal), {'mode':'query','text':'p'})
check('boundary browse-descriptor', solve('browse-descriptor', boundary), {'mode':'browse','text':''})
variant = dict(normal, **{'draft':'x'*N,'minimum':N})
check('variant query or selection payload', solve('threshold', variant), True)
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 threshold completion transition produces an incorrect observable state.

This stipulated picker searches only after minimum draft length unless explicit browse is requested. Empty-query browse uses recent suggestions, composition blocks query emission, and disabled/read-only interaction suppresses new requests. Draft erasure cancels pending search and clears query-bound results.

split: open-access