FA-22446 / Autocomplete interactions / Open access
Autocomplete loading and empty states: populated query refresh lacks its progress state · case 01
The refreshing completion transition produces an incorrect observable state.
ROOT CAUSE
At loading-presentation/refreshing, the implementation evaluates `False` instead of preserving the specified completion transition.
VERIFIED REPAIR
Implement the refreshing contract using `d['pending'] and bool(d['rows'])`.
Unsuccessful approach: The attempted repair uses `d['pending'] and not d['rows']`, which still violates a normal or boundary completion fixture.
Case contract
A loading snapshot distinguishes initial loading, background refreshing, settled-empty, error and cancellation. Only settled successful empty responses show no-results. Existing rows may remain visible during refresh but are bound to the draft they represent; stale errors never overwrite a newer query status.
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 == 'initial': return d['pending'] and not d['rows']
if event == 'refreshing': return False
if event == 'empty': return d['settled'] and not d['pending'] and not d['rows'] and d['error'] is None
if event == 'error': return d['error'] if d['error_epoch']==d['epoch'] else None
if event == 'selectable': return d['rows'] if d['rows_query']==d['query'] else []
if event == 'cancel': return None if d['cancelled'] else d['error']
if event == 'busy': return d['pending']
if event == 'preserve': return d['rows']
if event == 'status-priority': return 'error' if d['error'] else 'loading' if d['pending'] else 'empty' if not d['rows'] else 'results'
if event == 'retry-label': return {'query':d['query'],'error':d['error']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pending':True,'rows':['a'],'query':'pe','rows_query':'p','error':'timeout','error_epoch':N-1,'epoch':N,'settled':False,'cancelled':True}
boundary = {'pending':False,'rows':[],'query':'','rows_query':'','error':None,'error_epoch':N,'epoch':N,'settled':True,'cancelled':False}
check('normal initial', solve('initial', normal), False)
check('boundary initial', solve('initial', boundary), False)
check('normal refreshing', solve('refreshing', normal), True)
check('boundary refreshing', solve('refreshing', boundary), False)
check('normal empty', solve('empty', normal), False)
check('boundary empty', solve('empty', boundary), True)
check('normal error', solve('error', normal), None)
check('boundary error', solve('error', boundary), None)
check('normal selectable', solve('selectable', normal), [])
check('boundary selectable', solve('selectable', boundary), [])
check('normal cancel', solve('cancel', normal), None)
check('boundary cancel', solve('cancel', boundary), None)
check('normal busy', solve('busy', normal), True)
check('boundary busy', solve('busy', boundary), False)
check('normal preserve', solve('preserve', normal), ['a'])
check('boundary preserve', solve('preserve', boundary), [])
check('normal status-priority', solve('status-priority', normal), 'error')
check('boundary status-priority', solve('status-priority', boundary), 'empty')
check('normal retry-label', solve('retry-label', normal), {'query':'pe','error':'timeout'})
check('boundary retry-label', solve('retry-label', boundary), {'query':'','error':None})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('retry-label', variant), {'query':'q'*N,'error':'timeout'})
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 initial | False | False | Passed |
| boundary initial | False | False | Passed |
| normal refreshing | False | True | Failed |
| boundary refreshing | False | False | Passed |
| normal empty | False | False | Passed |
| boundary empty | True | True | Passed |
| normal error | None | None | Passed |
| boundary error | None | None | Passed |
| normal selectable | [] | [] | Passed |
| boundary selectable | [] | [] | Passed |
| normal cancel | None | None | Passed |
| boundary cancel | None | None | Passed |
| normal busy | True | True | Passed |
| boundary busy | False | False | Passed |
| normal preserve | ['a'] | ['a'] | Passed |
| boundary preserve | [] | [] | Passed |
| normal status-priority | error | error | Passed |
| boundary status-priority | empty | empty | Passed |
| normal retry-label | {'error': 'timeout', 'query': 'pe'} | {'error': 'timeout', 'query': 'pe'} | Passed |
| boundary retry-label | {'error': None, 'query': ''} | {'error': None, 'query': ''} | Passed |
| variant query or selection payload | {'error': 'timeout', 'query': 'q'} | {'error': 'timeout', 'query': 'q'} | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 71ebda4d3eb923acd06107bc17ed110d63619c6102afbed144d626fce7c97954
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 == 'initial': return d['pending'] and not d['rows']
if event == 'refreshing': return d['pending'] and not d['rows']
if event == 'empty': return d['settled'] and not d['pending'] and not d['rows'] and d['error'] is None
if event == 'error': return d['error'] if d['error_epoch']==d['epoch'] else None
if event == 'selectable': return d['rows'] if d['rows_query']==d['query'] else []
if event == 'cancel': return None if d['cancelled'] else d['error']
if event == 'busy': return d['pending']
if event == 'preserve': return d['rows']
if event == 'status-priority': return 'error' if d['error'] else 'loading' if d['pending'] else 'empty' if not d['rows'] else 'results'
if event == 'retry-label': return {'query':d['query'],'error':d['error']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pending':True,'rows':['a'],'query':'pe','rows_query':'p','error':'timeout','error_epoch':N-1,'epoch':N,'settled':False,'cancelled':True}
boundary = {'pending':False,'rows':[],'query':'','rows_query':'','error':None,'error_epoch':N,'epoch':N,'settled':True,'cancelled':False}
check('normal initial', solve('initial', normal), False)
check('boundary initial', solve('initial', boundary), False)
check('normal refreshing', solve('refreshing', normal), True)
check('boundary refreshing', solve('refreshing', boundary), False)
check('normal empty', solve('empty', normal), False)
check('boundary empty', solve('empty', boundary), True)
check('normal error', solve('error', normal), None)
check('boundary error', solve('error', boundary), None)
check('normal selectable', solve('selectable', normal), [])
check('boundary selectable', solve('selectable', boundary), [])
check('normal cancel', solve('cancel', normal), None)
check('boundary cancel', solve('cancel', boundary), None)
check('normal busy', solve('busy', normal), True)
check('boundary busy', solve('busy', boundary), False)
check('normal preserve', solve('preserve', normal), ['a'])
check('boundary preserve', solve('preserve', boundary), [])
check('normal status-priority', solve('status-priority', normal), 'error')
check('boundary status-priority', solve('status-priority', boundary), 'empty')
check('normal retry-label', solve('retry-label', normal), {'query':'pe','error':'timeout'})
check('boundary retry-label', solve('retry-label', boundary), {'query':'','error':None})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('retry-label', variant), {'query':'q'*N,'error':'timeout'})
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 initial | False | False | Passed |
| boundary initial | False | False | Passed |
| normal refreshing | False | True | Failed |
| boundary refreshing | False | False | Passed |
| normal empty | False | False | Passed |
| boundary empty | True | True | Passed |
| normal error | None | None | Passed |
| boundary error | None | None | Passed |
| normal selectable | [] | [] | Passed |
| boundary selectable | [] | [] | Passed |
| normal cancel | None | None | Passed |
| boundary cancel | None | None | Passed |
| normal busy | True | True | Passed |
| boundary busy | False | False | Passed |
| normal preserve | ['a'] | ['a'] | Passed |
| boundary preserve | [] | [] | Passed |
| normal status-priority | error | error | Passed |
| boundary status-priority | empty | empty | Passed |
| normal retry-label | {'error': 'timeout', 'query': 'pe'} | {'error': 'timeout', 'query': 'pe'} | Passed |
| boundary retry-label | {'error': None, 'query': ''} | {'error': None, 'query': ''} | Passed |
| variant query or selection payload | {'error': 'timeout', 'query': 'q'} | {'error': 'timeout', 'query': 'q'} | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 1b8bb82008e55dcaacf8f5827fcf8caa3ff4238a6d1c57ddb5863060961f64e1
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 == 'initial': return d['pending'] and not d['rows']
if event == 'refreshing': return d['pending'] and bool(d['rows'])
if event == 'empty': return d['settled'] and not d['pending'] and not d['rows'] and d['error'] is None
if event == 'error': return d['error'] if d['error_epoch']==d['epoch'] else None
if event == 'selectable': return d['rows'] if d['rows_query']==d['query'] else []
if event == 'cancel': return None if d['cancelled'] else d['error']
if event == 'busy': return d['pending']
if event == 'preserve': return d['rows']
if event == 'status-priority': return 'error' if d['error'] else 'loading' if d['pending'] else 'empty' if not d['rows'] else 'results'
if event == 'retry-label': return {'query':d['query'],'error':d['error']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'pending':True,'rows':['a'],'query':'pe','rows_query':'p','error':'timeout','error_epoch':N-1,'epoch':N,'settled':False,'cancelled':True}
boundary = {'pending':False,'rows':[],'query':'','rows_query':'','error':None,'error_epoch':N,'epoch':N,'settled':True,'cancelled':False}
check('normal initial', solve('initial', normal), False)
check('boundary initial', solve('initial', boundary), False)
check('normal refreshing', solve('refreshing', normal), True)
check('boundary refreshing', solve('refreshing', boundary), False)
check('normal empty', solve('empty', normal), False)
check('boundary empty', solve('empty', boundary), True)
check('normal error', solve('error', normal), None)
check('boundary error', solve('error', boundary), None)
check('normal selectable', solve('selectable', normal), [])
check('boundary selectable', solve('selectable', boundary), [])
check('normal cancel', solve('cancel', normal), None)
check('boundary cancel', solve('cancel', boundary), None)
check('normal busy', solve('busy', normal), True)
check('boundary busy', solve('busy', boundary), False)
check('normal preserve', solve('preserve', normal), ['a'])
check('boundary preserve', solve('preserve', boundary), [])
check('normal status-priority', solve('status-priority', normal), 'error')
check('boundary status-priority', solve('status-priority', boundary), 'empty')
check('normal retry-label', solve('retry-label', normal), {'query':'pe','error':'timeout'})
check('boundary retry-label', solve('retry-label', boundary), {'query':'','error':None})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('retry-label', variant), {'query':'q'*N,'error':'timeout'})
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 initial | False | False | Passed |
| boundary initial | False | False | Passed |
| normal refreshing | True | True | Passed |
| boundary refreshing | False | False | Passed |
| normal empty | False | False | Passed |
| boundary empty | True | True | Passed |
| normal error | None | None | Passed |
| boundary error | None | None | Passed |
| normal selectable | [] | [] | Passed |
| boundary selectable | [] | [] | Passed |
| normal cancel | None | None | Passed |
| boundary cancel | None | None | Passed |
| normal busy | True | True | Passed |
| boundary busy | False | False | Passed |
| normal preserve | ['a'] | ['a'] | Passed |
| boundary preserve | [] | [] | Passed |
| normal status-priority | error | error | Passed |
| boundary status-priority | empty | empty | Passed |
| normal retry-label | {'error': 'timeout', 'query': 'pe'} | {'error': 'timeout', 'query': 'pe'} | Passed |
| boundary retry-label | {'error': None, 'query': ''} | {'error': None, 'query': ''} | Passed |
| variant query or selection payload | {'error': 'timeout', 'query': 'q'} | {'error': 'timeout', 'query': 'q'} | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 715cc5fb0df3ec6adcc35b40cc197780e723f54a6f00845ada61a0e126ddf025
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:38.429131+00:00.
Case digest / 278821ba7bec0c7c539669816a209ade1e068ef001a124ebc915421b2d0e2907