FAILURE MAP
← Case archive

FA-23056 / Autocomplete interactions / Open access

Command argument suggestions: space-containing completion is inserted as multiple arguments · case 01

The quote completion transition produces an incorrect observable state.

Verified by executionVariant 1 · 22 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

At argument-completion/quote, the implementation evaluates `d['candidate']` instead of preserving the specified completion transition.

THE FAILURE

At argument-completion/quote, the implementation evaluates `d['candidate']` instead of preserving the specified completion transition.

Unsuccessful approach: The attempted repair uses `'"'+d['candidate']+'"'`, which still violates a normal or boundary completion fixture.

Case contract

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.

Why this case matters

Autocomplete couples draft text, suggestion identity and asynchronous presentation; this bounded lifecycle model isolates one observable interaction defect.

1 / The failure

Exit 1
"""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)
Boundary fixtureActualExpectedOutcome
normal position00Passed
boundary position00Passed
normal commandopenopenPassed
boundary commandrunrunPassed
normal replace['my file', 'tail']['my file', 'tail']Passed
boundary replace['x']['x']Passed
normal quotemy file"my file"Failed
boundary quotexxPassed
normal verbopenopenPassed
boundary verbrunrunPassed
normal names['--path']['--path']Passed
boundary names[][]Passed
normal response-commandFalseFalsePassed
boundary response-commandTrueTruePassed
normal response-positionFalseFalsePassed
boundary response-positionTrueTruePassed
normal next-position11Passed
boundary next-position11Passed
normal argument-separatorPassed
boundary argument-separator Passed
variant query or selection payloada "a "Failed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 626b4b50305223f422a74970019f832a74494008aed8396ed06279b3285b32ae

2 / The unsuccessful fix

Exit 1
"""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)
Boundary fixtureActualExpectedOutcome
normal position00Passed
boundary position00Passed
normal commandopenopenPassed
boundary commandrunrunPassed
normal replace['my file', 'tail']['my file', 'tail']Passed
boundary replace['x']['x']Passed
normal quote"my file""my file"Passed
boundary quote"x"xFailed
normal verbopenopenPassed
boundary verbrunrunPassed
normal names['--path']['--path']Passed
boundary names[][]Passed
normal response-commandFalseFalsePassed
boundary response-commandTrueTruePassed
normal response-positionFalseFalsePassed
boundary response-positionTrueTruePassed
normal next-position11Passed
boundary next-position11Passed
normal argument-separatorPassed
boundary argument-separator Passed
variant query or selection payload"a ""a "Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / ce7007717d6d66dd1c93f985fd9e869da196d687ce717d963767c1c772ae3644

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 22 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Stipulated deterministic widget transition model; inputs are validated snapshots. It does not model browser event dispatch, network transport, or linguistic standards. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:40:44.411531+00:00.

Case digest / ee266998e66f2667fed9be5326562e564b4ad7b25e0fdf67907b4ff8e39189ed