FAILURE MAP
← Case archive

FA-23006 / Autocomplete interactions / Open access

Hierarchical path autocomplete: accepting a directory omits the next-segment separator · case 01

The directory-suffix completion transition produces an incorrect observable state.

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

ROOT CAUSE

At path-completion/directory-suffix, the implementation evaluates `d['name']` instead of preserving the specified completion transition.

THE FAILURE

At path-completion/directory-suffix, the implementation evaluates `d['name']` instead of preserving the specified completion transition.

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

Case contract

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.

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 == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
normal lookup-parentdocs/api/docs/api/Passed
boundary lookup-parentdocs/docs/Passed
normal lookup-queryreareaPassed
boundary lookup-queryPassed
normal replacedocs/api/readmedocs/api/readmePassed
boundary replacedocs/guidedocs/guidePassed
normal directory-suffixreadmereadmePassed
boundary directory-suffixguideguide/Failed
normal commitdocs/api/readmedocs/api/readmePassed
boundary commitNoneNonePassed
normal continueFalseFalsePassed
boundary continueTrueTruePassed
normal response-parentFalseFalsePassed
boundary response-parentTrueTruePassed
normal empty-segmentNoneNonePassed
boundary empty-segmentdocs/docs/Passed
normal next-scopeNoneNonePassed
boundary next-scopedocs/guide/docs/guide/Passed
normal leaf-continuation{'continue_at': None, 'leaf': True}{'continue_at': None, 'leaf': True}Passed
boundary leaf-continuation{'continue_at': 'docs/guide/', 'leaf': False}{'continue_at': 'docs/guide/', 'leaf': False}Passed
variant query or selection payloadrrPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 9ff6de97327cdad9026a1efb880330b6932f6f929bb8a3f529791624fb6384ae

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 == 'lookup-parent': return d['parent']
    if event == 'lookup-query': return d['segment']
    if event == 'replace': return d['parent']+d['name']
    if event == 'directory-suffix': return d['name']+'/'
    if event == 'commit': return None if d['directory'] else d['parent']+d['name']
    if event == 'continue': return d['directory']
    if event == 'response-parent': return d['response_parent']==d['parent']
    if event == 'empty-segment': return d['parent'] if not d['segment'] else None
    if event == 'next-scope': return d['parent']+d['name']+'/' if d['directory'] else None
    if event == 'leaf-continuation': return {'leaf':not d['directory'],'continue_at':d['parent']+d['name']+'/' if d['directory'] else None}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'path':'docs/api/rea','parent':'docs/api/','segment':'rea','name':'readme','directory':False,'response_parent':'docs/','epoch':N,'selected':'old','separator':'/'}
boundary = {'path':'docs/','parent':'docs/','segment':'','name':'guide','directory':True,'response_parent':'docs/','epoch':N,'selected':None,'separator':'/'}
check('normal lookup-parent', solve('lookup-parent', normal), 'docs/api/')
check('boundary lookup-parent', solve('lookup-parent', boundary), 'docs/')
check('normal lookup-query', solve('lookup-query', normal), 'rea')
check('boundary lookup-query', solve('lookup-query', boundary), '')
check('normal replace', solve('replace', normal), 'docs/api/readme')
check('boundary replace', solve('replace', boundary), 'docs/guide')
check('normal directory-suffix', solve('directory-suffix', normal), 'readme')
check('boundary directory-suffix', solve('directory-suffix', boundary), 'guide/')
check('normal commit', solve('commit', normal), 'docs/api/readme')
check('boundary commit', solve('commit', boundary), None)
check('normal continue', solve('continue', normal), False)
check('boundary continue', solve('continue', boundary), True)
check('normal response-parent', solve('response-parent', normal), False)
check('boundary response-parent', solve('response-parent', boundary), True)
check('normal empty-segment', solve('empty-segment', normal), None)
check('boundary empty-segment', solve('empty-segment', boundary), 'docs/')
check('normal next-scope', solve('next-scope', normal), None)
check('boundary next-scope', solve('next-scope', boundary), 'docs/guide/')
check('normal leaf-continuation', solve('leaf-continuation', normal), {'leaf':True,'continue_at':None})
check('boundary leaf-continuation', solve('leaf-continuation', boundary), {'leaf':False,'continue_at':'docs/guide/'})
variant = dict(normal, **{'segment':'r'*N})
check('variant query or selection payload', solve('lookup-query', variant), 'r'*N)
check('unknown completion event', solve('unrecognized', normal), {'unchanged': True})
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
normal lookup-parentdocs/api/docs/api/Passed
boundary lookup-parentdocs/docs/Passed
normal lookup-queryreareaPassed
boundary lookup-queryPassed
normal replacedocs/api/readmedocs/api/readmePassed
boundary replacedocs/guidedocs/guidePassed
normal directory-suffixreadme/readmeFailed
boundary directory-suffixguide/guide/Passed
normal commitdocs/api/readmedocs/api/readmePassed
boundary commitNoneNonePassed
normal continueFalseFalsePassed
boundary continueTrueTruePassed
normal response-parentFalseFalsePassed
boundary response-parentTrueTruePassed
normal empty-segmentNoneNonePassed
boundary empty-segmentdocs/docs/Passed
normal next-scopeNoneNonePassed
boundary next-scopedocs/guide/docs/guide/Passed
normal leaf-continuation{'continue_at': None, 'leaf': True}{'continue_at': None, 'leaf': True}Passed
boundary leaf-continuation{'continue_at': 'docs/guide/', 'leaf': False}{'continue_at': 'docs/guide/', 'leaf': False}Passed
variant query or selection payloadrrPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 92f5de46abf45b43f8d89b641a804d933054ae553c9903e70dea032bd420e512

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

Case digest / 8c8b50b4ebc214cb744cd967382a3ee23783a4be7d97eb2448209414fddb2869