FA-22931 / Autocomplete interactions / Open access
External text autofill in autocomplete: external autofill resets the existing interaction history · case 01
The touched completion transition produces an incorrect observable state.
ROOT CAUSE
At autofill-reconcile/touched, the implementation evaluates `False` instead of preserving the specified completion transition.
VERIFIED REPAIR
Implement the touched contract using `d['touched']`.
Unsuccessful approach: The attempted repair uses `True`, 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 [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 False
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 | Pear | Pear | Passed |
| 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 | False | True | Failed |
| normal hover-witness | False | False | Passed |
| boundary hover-witness | False | False | Passed |
| variant query or selection payload | q | q | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 9a158b75b0c2623e88ac7095e5e1843248a3db9b25e93919ad5f8cf16e0021fb
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 [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 True
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 | Pear | Pear | Passed |
| 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 | True | False | Failed |
| boundary touched | True | True | Passed |
| normal hover-witness | False | False | Passed |
| boundary hover-witness | False | False | Passed |
| variant query or selection payload | q | q | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 43bec9e2a660cedc43eb433289eeff3d903eac2f1c0eedbda2bbeff8023b3908
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal draft | Pear | Pear | Passed |
| 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 | q | q | Passed |
| 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.964467+00:00.
Case digest / c054ed420d5bab29ddf88ce7741aa96390dc1fb4900d507d2658317eb121b372