FAILURE MAP
← Case archive

FA-23191 / Autocomplete interactions / Open access

Search normalization versus displayed autocomplete text: suggestion lookup sends case-sensitive padded display text · case 01

The lookup completion transition produces an incorrect observable state.

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

ROOT CAUSE

At query-display/lookup, the implementation evaluates `d['draft']` instead of preserving the specified completion transition.

THE FAILURE

At query-display/lookup, the implementation evaluates `d['draft']` instead of preserving the specified completion transition.

Unsuccessful approach: The attempted repair uses `d['draft'].lower()`, which still violates a normal or boundary completion fixture.

Case contract

This controlled ASCII picker normalizes lookup by stripping outer whitespace and lowercasing, while preserving exact user draft and canonical option labels for display and commit. Matching offsets apply to the normalized query only; a normalization-equivalent edit still advances the display epoch.

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': return d['draft']
    if event == 'display': return d['draft']
    if event == 'commit-label': return d['label']
    if event == 'commit-id': return d['id']
    if event == 'match-key': return d['result_query']==d['normalized']
    if event == 'offset': return [d['prefix_space'],d['prefix_space']+len(d['normalized'])]
    if event == 'display-epoch': return d['epoch']+1
    if event == 'query-equivalent': return d['old']==d['normalized']
    if event == 'caret-display': return d['caret']
    if event == 'empty-query': return 'empty' if not d['normalized'] else 'typed'
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  PeA  ','label':'Pear','id':'p1','normalized':'pea','prefix_space':2,'epoch':N,'old':'pea','result_query':'pea','caret':5}
boundary = {'draft':'','label':'','id':'','normalized':'','prefix_space':0,'epoch':N,'old':'','result_query':'','caret':0}
check('normal lookup', solve('lookup', normal), 'pea')
check('boundary lookup', solve('lookup', boundary), '')
check('normal display', solve('display', normal), '  PeA  ')
check('boundary display', solve('display', boundary), '')
check('normal commit-label', solve('commit-label', normal), 'Pear')
check('boundary commit-label', solve('commit-label', boundary), '')
check('normal commit-id', solve('commit-id', normal), 'p1')
check('boundary commit-id', solve('commit-id', boundary), '')
check('normal match-key', solve('match-key', normal), True)
check('boundary match-key', solve('match-key', boundary), True)
check('normal offset', solve('offset', normal), [2,5])
check('boundary offset', solve('offset', boundary), [0,0])
check('normal display-epoch', solve('display-epoch', normal), N+1)
check('boundary display-epoch', solve('display-epoch', boundary), N+1)
check('normal query-equivalent', solve('query-equivalent', normal), True)
check('boundary query-equivalent', solve('query-equivalent', boundary), True)
check('normal caret-display', solve('caret-display', normal), 5)
check('boundary caret-display', solve('caret-display', boundary), 0)
check('normal empty-query', solve('empty-query', normal), 'typed')
check('boundary empty-query', solve('empty-query', boundary), 'empty')
variant = dict(normal, **{'draft':' '*N+'PEAR'+' '*N})
check('variant query or selection payload', solve('lookup', variant), 'pear')
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 PeA peaFailed
boundary lookupPassed
normal display PeA PeA Passed
boundary displayPassed
normal commit-labelPearPearPassed
boundary commit-labelPassed
normal commit-idp1p1Passed
boundary commit-idPassed
normal match-keyTrueTruePassed
boundary match-keyTrueTruePassed
normal offset[2, 5][2, 5]Passed
boundary offset[0, 0][0, 0]Passed
normal display-epoch22Passed
boundary display-epoch22Passed
normal query-equivalentTrueTruePassed
boundary query-equivalentTrueTruePassed
normal caret-display55Passed
boundary caret-display00Passed
normal empty-querytypedtypedPassed
boundary empty-queryemptyemptyPassed
variant query or selection payload PEAR pearFailed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / fe54451f1066b8468c248b964db045a16031e933301f06af0de06eeb8af6e3c1

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': return d['draft'].lower()
    if event == 'display': return d['draft']
    if event == 'commit-label': return d['label']
    if event == 'commit-id': return d['id']
    if event == 'match-key': return d['result_query']==d['normalized']
    if event == 'offset': return [d['prefix_space'],d['prefix_space']+len(d['normalized'])]
    if event == 'display-epoch': return d['epoch']+1
    if event == 'query-equivalent': return d['old']==d['normalized']
    if event == 'caret-display': return d['caret']
    if event == 'empty-query': return 'empty' if not d['normalized'] else 'typed'
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  PeA  ','label':'Pear','id':'p1','normalized':'pea','prefix_space':2,'epoch':N,'old':'pea','result_query':'pea','caret':5}
boundary = {'draft':'','label':'','id':'','normalized':'','prefix_space':0,'epoch':N,'old':'','result_query':'','caret':0}
check('normal lookup', solve('lookup', normal), 'pea')
check('boundary lookup', solve('lookup', boundary), '')
check('normal display', solve('display', normal), '  PeA  ')
check('boundary display', solve('display', boundary), '')
check('normal commit-label', solve('commit-label', normal), 'Pear')
check('boundary commit-label', solve('commit-label', boundary), '')
check('normal commit-id', solve('commit-id', normal), 'p1')
check('boundary commit-id', solve('commit-id', boundary), '')
check('normal match-key', solve('match-key', normal), True)
check('boundary match-key', solve('match-key', boundary), True)
check('normal offset', solve('offset', normal), [2,5])
check('boundary offset', solve('offset', boundary), [0,0])
check('normal display-epoch', solve('display-epoch', normal), N+1)
check('boundary display-epoch', solve('display-epoch', boundary), N+1)
check('normal query-equivalent', solve('query-equivalent', normal), True)
check('boundary query-equivalent', solve('query-equivalent', boundary), True)
check('normal caret-display', solve('caret-display', normal), 5)
check('boundary caret-display', solve('caret-display', boundary), 0)
check('normal empty-query', solve('empty-query', normal), 'typed')
check('boundary empty-query', solve('empty-query', boundary), 'empty')
variant = dict(normal, **{'draft':' '*N+'PEAR'+' '*N})
check('variant query or selection payload', solve('lookup', variant), 'pear')
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 pea peaFailed
boundary lookupPassed
normal display PeA PeA Passed
boundary displayPassed
normal commit-labelPearPearPassed
boundary commit-labelPassed
normal commit-idp1p1Passed
boundary commit-idPassed
normal match-keyTrueTruePassed
boundary match-keyTrueTruePassed
normal offset[2, 5][2, 5]Passed
boundary offset[0, 0][0, 0]Passed
normal display-epoch22Passed
boundary display-epoch22Passed
normal query-equivalentTrueTruePassed
boundary query-equivalentTrueTruePassed
normal caret-display55Passed
boundary caret-display00Passed
normal empty-querytypedtypedPassed
boundary empty-queryemptyemptyPassed
variant query or selection payload pear pearFailed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / f5aa229cb873fdac31dfe51ed3b336bb626be0f5cc98ebd78cc29dbad2a1f01d

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

Case digest / f377aec75c98c5704ff360f4fa4af75d79c837df6579916ccf4ca14a0d6ccfc8