FAILURE MAP
← Case archive

FA-22316 / Autocomplete interactions / Open access

Cached autocomplete presentation: presence of cached suggestions suppresses needed revalidation · case 01

The refresh completion transition produces an incorrect observable state.

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

ROOT CAUSE

At query-cache-presentation/refresh, the implementation evaluates `not d['has_entry']` instead of preserving the specified completion transition.

THE FAILURE

At query-cache-presentation/refresh, the implementation evaluates `not d['has_entry']` instead of preserving the specified completion transition.

Unsuccessful approach: The attempted repair uses `not bool(d['cached'])`, which still violates a normal or boundary completion fixture.

Case contract

Cached result presentation is bound to exact query and dependency scope. A cache hit may render immediately but must be marked stale until refreshed. Empty cached results are valid hits. Cache misses preserve no previous-query selectable rows; selected labels are independently retained.

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 == 'key': return [d['scope'],d['query']]
    if event == 'query-match': return d['query']==d['cache_query']
    if event == 'scope-match': return d['scope']==d['cache_scope']
    if event == 'empty-hit': return d['has_entry']
    if event == 'stale-badge': return not d['fresh']
    if event == 'refresh': return not d['has_entry']
    if event == 'miss-rows': return d['cached'] if d['query']==d['cache_query'] and d['scope']==d['cache_scope'] else []
    if event == 'value-label': return d['selected_label']
    if event == 'cache-provenance': return {'origin':'cache','query':d['cache_query'],'epoch':d['cache_epoch']}
    if event == 'refresh-error': return {'rows':d['cached'],'warning':d['error']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pe','scope':'fruit','cache_query':'p','cache_scope':'all','cached':['p1'],'has_entry':True,'fresh':False,'selected_label':'Pear','epoch':N,'cache_epoch':N-1,'error':'offline'}
boundary = {'query':'','scope':'all','cache_query':'','cache_scope':'all','cached':[],'has_entry':True,'fresh':True,'selected_label':'','epoch':N,'cache_epoch':N,'error':None}
check('normal key', solve('key', normal), ['fruit','pe'])
check('boundary key', solve('key', boundary), ['all',''])
check('normal query-match', solve('query-match', normal), False)
check('boundary query-match', solve('query-match', boundary), True)
check('normal scope-match', solve('scope-match', normal), False)
check('boundary scope-match', solve('scope-match', boundary), True)
check('normal empty-hit', solve('empty-hit', normal), True)
check('boundary empty-hit', solve('empty-hit', boundary), True)
check('normal stale-badge', solve('stale-badge', normal), True)
check('boundary stale-badge', solve('stale-badge', boundary), False)
check('normal refresh', solve('refresh', normal), True)
check('boundary refresh', solve('refresh', boundary), False)
check('normal miss-rows', solve('miss-rows', normal), [])
check('boundary miss-rows', solve('miss-rows', boundary), [])
check('normal value-label', solve('value-label', normal), 'Pear')
check('boundary value-label', solve('value-label', boundary), '')
check('normal cache-provenance', solve('cache-provenance', normal), {'origin':'cache','query':'p','epoch':N-1})
check('boundary cache-provenance', solve('cache-provenance', boundary), {'origin':'cache','query':'','epoch':N})
check('normal refresh-error', solve('refresh-error', normal), {'rows':['p1'],'warning':'offline'})
check('boundary refresh-error', solve('refresh-error', boundary), {'rows':[],'warning':None})
variant = dict(normal, **{'selected_label':'L'*N})
check('variant query or selection payload', solve('value-label', variant), 'L'*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 key['fruit', 'pe']['fruit', 'pe']Passed
boundary key['all', '']['all', '']Passed
normal query-matchFalseFalsePassed
boundary query-matchTrueTruePassed
normal scope-matchFalseFalsePassed
boundary scope-matchTrueTruePassed
normal empty-hitTrueTruePassed
boundary empty-hitTrueTruePassed
normal stale-badgeTrueTruePassed
boundary stale-badgeFalseFalsePassed
normal refreshFalseTrueFailed
boundary refreshFalseFalsePassed
normal miss-rows[][]Passed
boundary miss-rows[][]Passed
normal value-labelPearPearPassed
boundary value-labelPassed
normal cache-provenance{'epoch': 0, 'origin': 'cache', 'query': 'p'}{'epoch': 0, 'origin': 'cache', 'query': 'p'}Passed
boundary cache-provenance{'epoch': 1, 'origin': 'cache', 'query': ''}{'epoch': 1, 'origin': 'cache', 'query': ''}Passed
normal refresh-error{'rows': ['p1'], 'warning': 'offline'}{'rows': ['p1'], 'warning': 'offline'}Passed
boundary refresh-error{'rows': [], 'warning': None}{'rows': [], 'warning': None}Passed
variant query or selection payloadLLPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 8ce5783db8ba73027aacab7968b964b0b46898cb120460fda668a9d57c40380a

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 == 'key': return [d['scope'],d['query']]
    if event == 'query-match': return d['query']==d['cache_query']
    if event == 'scope-match': return d['scope']==d['cache_scope']
    if event == 'empty-hit': return d['has_entry']
    if event == 'stale-badge': return not d['fresh']
    if event == 'refresh': return not bool(d['cached'])
    if event == 'miss-rows': return d['cached'] if d['query']==d['cache_query'] and d['scope']==d['cache_scope'] else []
    if event == 'value-label': return d['selected_label']
    if event == 'cache-provenance': return {'origin':'cache','query':d['cache_query'],'epoch':d['cache_epoch']}
    if event == 'refresh-error': return {'rows':d['cached'],'warning':d['error']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'pe','scope':'fruit','cache_query':'p','cache_scope':'all','cached':['p1'],'has_entry':True,'fresh':False,'selected_label':'Pear','epoch':N,'cache_epoch':N-1,'error':'offline'}
boundary = {'query':'','scope':'all','cache_query':'','cache_scope':'all','cached':[],'has_entry':True,'fresh':True,'selected_label':'','epoch':N,'cache_epoch':N,'error':None}
check('normal key', solve('key', normal), ['fruit','pe'])
check('boundary key', solve('key', boundary), ['all',''])
check('normal query-match', solve('query-match', normal), False)
check('boundary query-match', solve('query-match', boundary), True)
check('normal scope-match', solve('scope-match', normal), False)
check('boundary scope-match', solve('scope-match', boundary), True)
check('normal empty-hit', solve('empty-hit', normal), True)
check('boundary empty-hit', solve('empty-hit', boundary), True)
check('normal stale-badge', solve('stale-badge', normal), True)
check('boundary stale-badge', solve('stale-badge', boundary), False)
check('normal refresh', solve('refresh', normal), True)
check('boundary refresh', solve('refresh', boundary), False)
check('normal miss-rows', solve('miss-rows', normal), [])
check('boundary miss-rows', solve('miss-rows', boundary), [])
check('normal value-label', solve('value-label', normal), 'Pear')
check('boundary value-label', solve('value-label', boundary), '')
check('normal cache-provenance', solve('cache-provenance', normal), {'origin':'cache','query':'p','epoch':N-1})
check('boundary cache-provenance', solve('cache-provenance', boundary), {'origin':'cache','query':'','epoch':N})
check('normal refresh-error', solve('refresh-error', normal), {'rows':['p1'],'warning':'offline'})
check('boundary refresh-error', solve('refresh-error', boundary), {'rows':[],'warning':None})
variant = dict(normal, **{'selected_label':'L'*N})
check('variant query or selection payload', solve('value-label', variant), 'L'*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 key['fruit', 'pe']['fruit', 'pe']Passed
boundary key['all', '']['all', '']Passed
normal query-matchFalseFalsePassed
boundary query-matchTrueTruePassed
normal scope-matchFalseFalsePassed
boundary scope-matchTrueTruePassed
normal empty-hitTrueTruePassed
boundary empty-hitTrueTruePassed
normal stale-badgeTrueTruePassed
boundary stale-badgeFalseFalsePassed
normal refreshFalseTrueFailed
boundary refreshTrueFalseFailed
normal miss-rows[][]Passed
boundary miss-rows[][]Passed
normal value-labelPearPearPassed
boundary value-labelPassed
normal cache-provenance{'epoch': 0, 'origin': 'cache', 'query': 'p'}{'epoch': 0, 'origin': 'cache', 'query': 'p'}Passed
boundary cache-provenance{'epoch': 1, 'origin': 'cache', 'query': ''}{'epoch': 1, 'origin': 'cache', 'query': ''}Passed
normal refresh-error{'rows': ['p1'], 'warning': 'offline'}{'rows': ['p1'], 'warning': 'offline'}Passed
boundary refresh-error{'rows': [], 'warning': None}{'rows': [], 'warning': None}Passed
variant query or selection payloadLLPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 200192c599c9b8dfd429c356966d07dac6a0731e2c247575a8d1efa0d1db46a1

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

Case digest / fd319d3af782ab52a09e81028ed01114ff3a6d18a819cd9bc3cf1ed15845584a