FA-21956 / Autocomplete interactions / Open access
Completion debounce lifecycle: flush substitutes the current query for the scheduled snapshot · case 01
The flush completion transition produces an incorrect observable state.
ROOT CAUSE
At debounce/flush, the implementation evaluates `[d['query']]` instead of preserving the specified completion transition.
VERIFIED REPAIR
Implement the flush contract using `[d['pending']] if d['pending'] is not None else []`.
Unsuccessful approach: The attempted repair uses `[d['pending']]`, which still violates a normal or boundary completion fixture.
Case contract
A new draft replaces the pending autocomplete job and its deadline. A deadline emits only its exact draft epoch; flush emits pending text once; cancellation discards pending text. Leading search marks its own query, and composition suspends timers. Time values are integer ticks.
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 == 'replace': return d['query']
if event == 'deadline': return d['now']+d['delay']
if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
if event == 'flush': return [d['query']]
if event == 'cancel': return {'pending':None,'deadline':None}
if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
if event == 'suspend': return None if d['composing'] else d['deadline']
if event == 'duplicate': return d['query']==d['sent']
if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', 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 replace | pea | pea | Passed |
| boundary replace | | | Passed |
| normal deadline | 14 | 14 | Passed |
| boundary deadline | 10 | 10 | Passed |
| normal expired | None | None | Passed |
| boundary expired | None | None | Passed |
| normal flush | ['pea'] | ['pe'] | Failed |
| boundary flush | [''] | [] | Failed |
| normal cancel | {'deadline': None, 'pending': None} | {'deadline': None, 'pending': None} | Passed |
| boundary cancel | {'deadline': None, 'pending': None} | {'deadline': None, 'pending': None} | Passed |
| normal leading | {'epoch': 1, 'sent': 'pea'} | {'epoch': 1, 'sent': 'pea'} | Passed |
| boundary leading | {'epoch': 1, 'sent': ''} | {'epoch': 1, 'sent': ''} | Passed |
| normal suspend | None | None | Passed |
| boundary suspend | 10 | 10 | Passed |
| normal duplicate | False | False | Passed |
| boundary duplicate | True | True | Passed |
| normal after-flush | {'pending': None, 'sent': 'pe'} | {'pending': None, 'sent': 'pe'} | Passed |
| boundary after-flush | {'pending': None, 'sent': ''} | {'pending': None, 'sent': ''} | Passed |
| normal retag | {'job_epoch': 1, 'query': 'pea'} | {'job_epoch': 1, 'query': 'pea'} | Passed |
| boundary retag | {'job_epoch': 1, 'query': ''} | {'job_epoch': 1, 'query': ''} | Passed |
| variant query or selection payload | q | q | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 9e89cc8866888fc7cc2686f06156c7131fb982fdffc817abd43235491b32ba67
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 == 'replace': return d['query']
if event == 'deadline': return d['now']+d['delay']
if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
if event == 'flush': return [d['pending']]
if event == 'cancel': return {'pending':None,'deadline':None}
if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
if event == 'suspend': return None if d['composing'] else d['deadline']
if event == 'duplicate': return d['query']==d['sent']
if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', 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 replace | pea | pea | Passed |
| boundary replace | | | Passed |
| normal deadline | 14 | 14 | Passed |
| boundary deadline | 10 | 10 | Passed |
| normal expired | None | None | Passed |
| boundary expired | None | None | Passed |
| normal flush | ['pe'] | ['pe'] | Passed |
| boundary flush | [None] | [] | Failed |
| normal cancel | {'deadline': None, 'pending': None} | {'deadline': None, 'pending': None} | Passed |
| boundary cancel | {'deadline': None, 'pending': None} | {'deadline': None, 'pending': None} | Passed |
| normal leading | {'epoch': 1, 'sent': 'pea'} | {'epoch': 1, 'sent': 'pea'} | Passed |
| boundary leading | {'epoch': 1, 'sent': ''} | {'epoch': 1, 'sent': ''} | Passed |
| normal suspend | None | None | Passed |
| boundary suspend | 10 | 10 | Passed |
| normal duplicate | False | False | Passed |
| boundary duplicate | True | True | Passed |
| normal after-flush | {'pending': None, 'sent': 'pe'} | {'pending': None, 'sent': 'pe'} | Passed |
| boundary after-flush | {'pending': None, 'sent': ''} | {'pending': None, 'sent': ''} | Passed |
| normal retag | {'job_epoch': 1, 'query': 'pea'} | {'job_epoch': 1, 'query': 'pea'} | Passed |
| boundary retag | {'job_epoch': 1, 'query': ''} | {'job_epoch': 1, 'query': ''} | Passed |
| variant query or selection payload | q | q | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / f0a063b4defbbfea5e5d929626d5716695111e1c2a6ed610f9792e4ac8d6036f
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 == 'replace': return d['query']
if event == 'deadline': return d['now']+d['delay']
if event == 'expired': return d['pending'] if d['job_epoch']==d['epoch'] and d['now']>=d['deadline'] else None
if event == 'flush': return [d['pending']] if d['pending'] is not None else []
if event == 'cancel': return {'pending':None,'deadline':None}
if event == 'leading': return {'sent':d['query'],'epoch':d['epoch']}
if event == 'suspend': return None if d['composing'] else d['deadline']
if event == 'duplicate': return d['query']==d['sent']
if event == 'after-flush': return {'pending':None,'sent':d['pending'] if d['pending'] is not None else d['sent']}
if event == 'retag': return {'job_epoch':d['epoch'],'query':d['query']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pea','pending':'pe','epoch':N,'job_epoch':N-1,'now':N*10,'delay':4,'deadline':N*10-1,'sent':'p','composing':True}
boundary = {'query':'','pending':None,'epoch':N,'job_epoch':N,'now':N*10,'delay':0,'deadline':N*10,'sent':'','composing':False}
check('normal replace', solve('replace', normal), 'pea')
check('boundary replace', solve('replace', boundary), '')
check('normal deadline', solve('deadline', normal), N*10+4)
check('boundary deadline', solve('deadline', boundary), N*10)
check('normal expired', solve('expired', normal), None)
check('boundary expired', solve('expired', boundary), None)
check('normal flush', solve('flush', normal), ['pe'])
check('boundary flush', solve('flush', boundary), [])
check('normal cancel', solve('cancel', normal), {'pending':None,'deadline':None})
check('boundary cancel', solve('cancel', boundary), {'pending':None,'deadline':None})
check('normal leading', solve('leading', normal), {'sent':'pea','epoch':N})
check('boundary leading', solve('leading', boundary), {'sent':'','epoch':N})
check('normal suspend', solve('suspend', normal), None)
check('boundary suspend', solve('suspend', boundary), N*10)
check('normal duplicate', solve('duplicate', normal), False)
check('boundary duplicate', solve('duplicate', boundary), True)
check('normal after-flush', solve('after-flush', normal), {'pending':None,'sent':'pe'})
check('boundary after-flush', solve('after-flush', boundary), {'pending':None,'sent':''})
check('normal retag', solve('retag', normal), {'job_epoch':N,'query':'pea'})
check('boundary retag', solve('retag', boundary), {'job_epoch':N,'query':''})
variant = dict(normal, **{'query':'q'*N})
check('variant query or selection payload', solve('replace', 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 replace | pea | pea | Passed |
| boundary replace | | | Passed |
| normal deadline | 14 | 14 | Passed |
| boundary deadline | 10 | 10 | Passed |
| normal expired | None | None | Passed |
| boundary expired | None | None | Passed |
| normal flush | ['pe'] | ['pe'] | Passed |
| boundary flush | [] | [] | Passed |
| normal cancel | {'deadline': None, 'pending': None} | {'deadline': None, 'pending': None} | Passed |
| boundary cancel | {'deadline': None, 'pending': None} | {'deadline': None, 'pending': None} | Passed |
| normal leading | {'epoch': 1, 'sent': 'pea'} | {'epoch': 1, 'sent': 'pea'} | Passed |
| boundary leading | {'epoch': 1, 'sent': ''} | {'epoch': 1, 'sent': ''} | Passed |
| normal suspend | None | None | Passed |
| boundary suspend | 10 | 10 | Passed |
| normal duplicate | False | False | Passed |
| boundary duplicate | True | True | Passed |
| normal after-flush | {'pending': None, 'sent': 'pe'} | {'pending': None, 'sent': 'pe'} | Passed |
| boundary after-flush | {'pending': None, 'sent': ''} | {'pending': None, 'sent': ''} | Passed |
| normal retag | {'job_epoch': 1, 'query': 'pea'} | {'job_epoch': 1, 'query': 'pea'} | Passed |
| boundary retag | {'job_epoch': 1, 'query': ''} | {'job_epoch': 1, 'query': ''} | Passed |
| variant query or selection payload | q | q | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / e653766449d0be814f6322db30e4ffe3e4a0cc5717f3a27d73bea44ad79b09ab
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:33.823492+00:00.
Case digest / 6ea34edc283fbe170fabb5cb68cc23dc9a4efbd9c6068284b62bbf3d301f1fae