FA-22891 / Autocomplete interactions / Open access
External text autofill in autocomplete: external autofill leaves the prior search fragment as the draft · case 01
The draft completion transition produces an incorrect observable state.
ROOT CAUSE
At autofill-reconcile/draft, the implementation evaluates `d['old_query']` instead of preserving the specified completion transition.
THE FAILURE
At autofill-reconcile/draft, the implementation evaluates `d['old_query']` instead of preserving the specified completion transition.
Unsuccessful approach: The attempted repair uses `d['old_value']`, 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['old_query']
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal draft | pe | Pear | Failed |
| boundary draft | | | Passed |
| normal matches | ['p2'] | ['p2'] | Passed |
| boundary matches | [''] | [''] | Passed |
| normal ambiguous | None | None | Passed |
| boundary ambiguous | | | Passed |
| normal exact | None | None | Passed |
| boundary exact | | | Passed |
| normal unresolved | None | None | Passed |
| boundary unresolved | None | None | Passed |
| normal ghost | | | Passed |
| boundary ghost | | | Passed |
| normal exact-display | None | None | Passed |
| boundary exact-display | | | Passed |
| normal query-trigger | {'epoch': 2, 'query': 'Pear'} | {'epoch': 2, 'query': 'Pear'} | Passed |
| boundary query-trigger | {'epoch': 2, 'query': ''} | {'epoch': 2, 'query': ''} | Passed |
| normal touched | False | False | Passed |
| boundary touched | True | True | Passed |
| normal hover-witness | False | False | Passed |
| boundary hover-witness | False | False | Passed |
| variant query or selection payload | pe | q | Failed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 97f5dedd65c480a7569b98345115222e76ffca5374416569870dc4407c6e62ad
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['old_value']
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal draft | p0 | Pear | Failed |
| boundary draft | None | | Failed |
| normal matches | ['p2'] | ['p2'] | Passed |
| boundary matches | [''] | [''] | Passed |
| normal ambiguous | None | None | Passed |
| boundary ambiguous | | | Passed |
| normal exact | None | None | Passed |
| boundary exact | | | Passed |
| normal unresolved | None | None | Passed |
| boundary unresolved | None | None | Passed |
| normal ghost | | | Passed |
| boundary ghost | | | Passed |
| normal exact-display | None | None | Passed |
| boundary exact-display | | | Passed |
| normal query-trigger | {'epoch': 2, 'query': 'Pear'} | {'epoch': 2, 'query': 'Pear'} | Passed |
| boundary query-trigger | {'epoch': 2, 'query': ''} | {'epoch': 2, 'query': ''} | Passed |
| normal touched | False | False | Passed |
| boundary touched | True | True | Passed |
| normal hover-witness | False | False | Passed |
| boundary hover-witness | False | False | Passed |
| variant query or selection payload | p0 | q | Failed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 81ecb0e0d7d142ffe6ef7eee481a6d45129d68da4e376a378bc39898a32e9921
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:42.961252+00:00.
Case digest / 9fb5e269023018e59684fff86f7006c2f8466b9236333b3fc1ef099999d3eba3