FAILURE MAP
← Case archive

FA-21966 / Autocomplete interactions / Open access

Completion debounce lifecycle: leading edge marks the previous query as already searched · case 01

The leading completion transition produces an incorrect observable state.

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

ROOT CAUSE

At debounce/leading, the implementation evaluates `{'sent':d['sent'],'epoch':d['epoch']}` instead of preserving the specified completion transition.

THE FAILURE

At debounce/leading, the implementation evaluates `{'sent':d['sent'],'epoch':d['epoch']}` instead of preserving the specified completion transition.

Unsuccessful approach: The attempted repair uses `{'sent':d['query'],'epoch':d['job_epoch']}`, 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['pending']] if d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['sent'],'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 fixtureActualExpectedOutcome
normal replacepeapeaPassed
boundary replacePassed
normal deadline1414Passed
boundary deadline1010Passed
normal expiredNoneNonePassed
boundary expiredNoneNonePassed
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': 'p'}{'epoch': 1, 'sent': 'pea'}Failed
boundary leading{'epoch': 1, 'sent': ''}{'epoch': 1, 'sent': ''}Passed
normal suspendNoneNonePassed
boundary suspend1010Passed
normal duplicateFalseFalsePassed
boundary duplicateTrueTruePassed
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 payloadqqPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / c1134fe609ff703bb48e03afd125d56945b51089eeba11606cde5cbf65008578

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 d['pending'] is not None else []
    if event == 'cancel': return {'pending':None,'deadline':None}
    if event == 'leading': return {'sent':d['query'],'epoch':d['job_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 fixtureActualExpectedOutcome
normal replacepeapeaPassed
boundary replacePassed
normal deadline1414Passed
boundary deadline1010Passed
normal expiredNoneNonePassed
boundary expiredNoneNonePassed
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': 0, 'sent': 'pea'}{'epoch': 1, 'sent': 'pea'}Failed
boundary leading{'epoch': 1, 'sent': ''}{'epoch': 1, 'sent': ''}Passed
normal suspendNoneNonePassed
boundary suspend1010Passed
normal duplicateFalseFalsePassed
boundary duplicateTrueTruePassed
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 payloadqqPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / fdda13236773fae0eaf6eed98d5186675c3bede84d162ea972ee078f258b6301

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

Case digest / 5ad27ee3ea32029854ea9418f8cc4e4222694f7d63a85021eab7b1207d3cd916