FAILURE MAP
← Case archive

FA-23076 / Autocomplete interactions / Open access

Command argument suggestions: results for a different argument position become selectable · case 01

The response-position completion transition produces an incorrect observable state.

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

ROOT CAUSE

At argument-completion/response-position, the implementation evaluates `True` instead of preserving the specified completion transition.

VERIFIED REPAIR

Implement the response-position contract using `d['response_position']==d['position']`.

Unsuccessful approach: The attempted repair uses `d['response_position']>=d['position']`, 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 ' ' 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)
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 quotexxPassed
normal verbopenopenPassed
boundary verbrunrunPassed
normal names['--path']['--path']Passed
boundary names[][]Passed
normal response-commandFalseFalsePassed
boundary response-commandTrueTruePassed
normal response-positionTrueFalseFailed
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 / e2ecf000c3760afcf338107e6a8048aee4c8d3ac4be3e2f589d0966d66e5b8cd

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 ' ' 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)
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 quotexxPassed
normal verbopenopenPassed
boundary verbrunrunPassed
normal names['--path']['--path']Passed
boundary names[][]Passed
normal response-commandFalseFalsePassed
boundary response-commandTrueTruePassed
normal response-positionTrueFalseFailed
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 / 9c5d7f39f41416d8492572b6e7075dcb075bc9bfcc1e251213ea0a2a287a62f2

3 / The verified repair

Exit 0
"""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)
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 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 payload"a ""a "Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 8549ff4f23331261041d4db80b9e093963077f80b64405933029bd8ba663ea3e

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.240635+00:00.

Case digest / bca564a646e275f52844b8cdd3ce92fff2a4a4ccd453cb70f9697a34339b338b