FAILURE MAP
← Case archive

FA-22896 / Autocomplete interactions / Open access

External text autofill in autocomplete: autofill label lookup ignores suggestion eligibility · case 01

The matches completion transition produces an incorrect observable state.

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

ROOT CAUSE

At autofill-reconcile/matches, the implementation evaluates `d['matches']` instead of preserving the specified completion transition.

VERIFIED REPAIR

Implement the matches contract using `[x for x in d['matches'] if x in d['eligible']]`.

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

Case contract

Externally replaced input text is reconciled as draft text. It commits an identifier only for one exact eligible label match, never from old highlight or fuzzy matching. Ambiguous labels retain unresolved draft, and the replacement invalidates previous suggestion requests and ghost text.

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 == 'draft': return d['text']
    if event == 'matches': return d['matches']
    if event == 'ambiguous': return d['matches'][0] if len(d['matches'])==1 else None
    if event == 'exact': return d['matches'][0] if d['exact'] and len(d['matches'])==1 else None
    if event == 'unresolved': return None
    if event == 'ghost': return ''
    if event == 'exact-display': return d['text'] if d['exact'] else None
    if event == 'query-trigger': return {'query':d['text'],'epoch':d['epoch']+1}
    if event == 'touched': return d['touched']
    if event == 'hover-witness': return d['highlight'] in d['matches'] and d['exact']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Pear','old_query':'pe','matches':['p1','p2'],'eligible':['p2'],'old_value':'p0','highlight':'p3','ghost':'ach','epoch':N,'exact':False,'touched':False}
boundary = {'text':'','old_query':'','matches':[''],'eligible':[''],'old_value':None,'highlight':None,'ghost':'','epoch':N,'exact':True,'touched':True}
check('normal draft', solve('draft', normal), 'Pear')
check('boundary draft', solve('draft', boundary), '')
check('normal matches', solve('matches', normal), ['p2'])
check('boundary matches', solve('matches', boundary), [''])
check('normal ambiguous', solve('ambiguous', normal), None)
check('boundary ambiguous', solve('ambiguous', boundary), '')
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal unresolved', solve('unresolved', normal), None)
check('boundary unresolved', solve('unresolved', boundary), None)
check('normal ghost', solve('ghost', normal), '')
check('boundary ghost', solve('ghost', boundary), '')
check('normal exact-display', solve('exact-display', normal), None)
check('boundary exact-display', solve('exact-display', boundary), '')
check('normal query-trigger', solve('query-trigger', normal), {'query':'Pear','epoch':N+1})
check('boundary query-trigger', solve('query-trigger', boundary), {'query':'','epoch':N+1})
check('normal touched', solve('touched', normal), False)
check('boundary touched', solve('touched', boundary), True)
check('normal hover-witness', solve('hover-witness', normal), False)
check('boundary hover-witness', solve('hover-witness', boundary), False)
variant = dict(normal, **{'text':'q'*N})
check('variant query or selection payload', solve('draft', variant), 'q'*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 draftPearPearPassed
boundary draftPassed
normal matches['p1', 'p2']['p2']Failed
boundary matches['']['']Passed
normal ambiguousNoneNonePassed
boundary ambiguousPassed
normal exactNoneNonePassed
boundary exactPassed
normal unresolvedNoneNonePassed
boundary unresolvedNoneNonePassed
normal ghostPassed
boundary ghostPassed
normal exact-displayNoneNonePassed
boundary exact-displayPassed
normal query-trigger{'epoch': 2, 'query': 'Pear'}{'epoch': 2, 'query': 'Pear'}Passed
boundary query-trigger{'epoch': 2, 'query': ''}{'epoch': 2, 'query': ''}Passed
normal touchedFalseFalsePassed
boundary touchedTrueTruePassed
normal hover-witnessFalseFalsePassed
boundary hover-witnessFalseFalsePassed
variant query or selection payloadqqPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 14396d323cd0313df7126296fd2a4620ce33d7dc468f316f859604c455fadb91

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 == 'draft': return d['text']
    if event == 'matches': return []
    if event == 'ambiguous': return d['matches'][0] if len(d['matches'])==1 else None
    if event == 'exact': return d['matches'][0] if d['exact'] and len(d['matches'])==1 else None
    if event == 'unresolved': return None
    if event == 'ghost': return ''
    if event == 'exact-display': return d['text'] if d['exact'] else None
    if event == 'query-trigger': return {'query':d['text'],'epoch':d['epoch']+1}
    if event == 'touched': return d['touched']
    if event == 'hover-witness': return d['highlight'] in d['matches'] and d['exact']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Pear','old_query':'pe','matches':['p1','p2'],'eligible':['p2'],'old_value':'p0','highlight':'p3','ghost':'ach','epoch':N,'exact':False,'touched':False}
boundary = {'text':'','old_query':'','matches':[''],'eligible':[''],'old_value':None,'highlight':None,'ghost':'','epoch':N,'exact':True,'touched':True}
check('normal draft', solve('draft', normal), 'Pear')
check('boundary draft', solve('draft', boundary), '')
check('normal matches', solve('matches', normal), ['p2'])
check('boundary matches', solve('matches', boundary), [''])
check('normal ambiguous', solve('ambiguous', normal), None)
check('boundary ambiguous', solve('ambiguous', boundary), '')
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal unresolved', solve('unresolved', normal), None)
check('boundary unresolved', solve('unresolved', boundary), None)
check('normal ghost', solve('ghost', normal), '')
check('boundary ghost', solve('ghost', boundary), '')
check('normal exact-display', solve('exact-display', normal), None)
check('boundary exact-display', solve('exact-display', boundary), '')
check('normal query-trigger', solve('query-trigger', normal), {'query':'Pear','epoch':N+1})
check('boundary query-trigger', solve('query-trigger', boundary), {'query':'','epoch':N+1})
check('normal touched', solve('touched', normal), False)
check('boundary touched', solve('touched', boundary), True)
check('normal hover-witness', solve('hover-witness', normal), False)
check('boundary hover-witness', solve('hover-witness', boundary), False)
variant = dict(normal, **{'text':'q'*N})
check('variant query or selection payload', solve('draft', variant), 'q'*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 draftPearPearPassed
boundary draftPassed
normal matches[]['p2']Failed
boundary matches[]['']Failed
normal ambiguousNoneNonePassed
boundary ambiguousPassed
normal exactNoneNonePassed
boundary exactPassed
normal unresolvedNoneNonePassed
boundary unresolvedNoneNonePassed
normal ghostPassed
boundary ghostPassed
normal exact-displayNoneNonePassed
boundary exact-displayPassed
normal query-trigger{'epoch': 2, 'query': 'Pear'}{'epoch': 2, 'query': 'Pear'}Passed
boundary query-trigger{'epoch': 2, 'query': ''}{'epoch': 2, 'query': ''}Passed
normal touchedFalseFalsePassed
boundary touchedTrueTruePassed
normal hover-witnessFalseFalsePassed
boundary hover-witnessFalseFalsePassed
variant query or selection payloadqqPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / e33072b471426b1ec19d16bce820720415eaeb967806e3b4422bd611f8d86567

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 == 'draft': return d['text']
    if event == 'matches': return [x for x in d['matches'] if x in d['eligible']]
    if event == 'ambiguous': return d['matches'][0] if len(d['matches'])==1 else None
    if event == 'exact': return d['matches'][0] if d['exact'] and len(d['matches'])==1 else None
    if event == 'unresolved': return None
    if event == 'ghost': return ''
    if event == 'exact-display': return d['text'] if d['exact'] else None
    if event == 'query-trigger': return {'query':d['text'],'epoch':d['epoch']+1}
    if event == 'touched': return d['touched']
    if event == 'hover-witness': return d['highlight'] in d['matches'] and d['exact']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'text':'Pear','old_query':'pe','matches':['p1','p2'],'eligible':['p2'],'old_value':'p0','highlight':'p3','ghost':'ach','epoch':N,'exact':False,'touched':False}
boundary = {'text':'','old_query':'','matches':[''],'eligible':[''],'old_value':None,'highlight':None,'ghost':'','epoch':N,'exact':True,'touched':True}
check('normal draft', solve('draft', normal), 'Pear')
check('boundary draft', solve('draft', boundary), '')
check('normal matches', solve('matches', normal), ['p2'])
check('boundary matches', solve('matches', boundary), [''])
check('normal ambiguous', solve('ambiguous', normal), None)
check('boundary ambiguous', solve('ambiguous', boundary), '')
check('normal exact', solve('exact', normal), None)
check('boundary exact', solve('exact', boundary), '')
check('normal unresolved', solve('unresolved', normal), None)
check('boundary unresolved', solve('unresolved', boundary), None)
check('normal ghost', solve('ghost', normal), '')
check('boundary ghost', solve('ghost', boundary), '')
check('normal exact-display', solve('exact-display', normal), None)
check('boundary exact-display', solve('exact-display', boundary), '')
check('normal query-trigger', solve('query-trigger', normal), {'query':'Pear','epoch':N+1})
check('boundary query-trigger', solve('query-trigger', boundary), {'query':'','epoch':N+1})
check('normal touched', solve('touched', normal), False)
check('boundary touched', solve('touched', boundary), True)
check('normal hover-witness', solve('hover-witness', normal), False)
check('boundary hover-witness', solve('hover-witness', boundary), False)
variant = dict(normal, **{'text':'q'*N})
check('variant query or selection payload', solve('draft', variant), 'q'*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 draftPearPearPassed
boundary draftPassed
normal matches['p2']['p2']Passed
boundary matches['']['']Passed
normal ambiguousNoneNonePassed
boundary ambiguousPassed
normal exactNoneNonePassed
boundary exactPassed
normal unresolvedNoneNonePassed
boundary unresolvedNoneNonePassed
normal ghostPassed
boundary ghostPassed
normal exact-displayNoneNonePassed
boundary exact-displayPassed
normal query-trigger{'epoch': 2, 'query': 'Pear'}{'epoch': 2, 'query': 'Pear'}Passed
boundary query-trigger{'epoch': 2, 'query': ''}{'epoch': 2, 'query': ''}Passed
normal touchedFalseFalsePassed
boundary touchedTrueTruePassed
normal hover-witnessFalseFalsePassed
boundary hover-witnessFalseFalsePassed
variant query or selection payloadqqPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 8da0301e4e8ad0089c16a434f03da0e8388fc02691c18e7f8b01bdac2a22af36

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

Case digest / c67c38d500ec8f659df82348aa5305214cda939857fa10270b083a45755ec058