FAILURE MAP
← Case archive

FA-22026 / Autocomplete interactions / Open access

Suggestion identity reconciliation: query replacement retains the former result highlight · case 01

The replacement completion transition produces an incorrect observable state.

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

ROOT CAUSE

At result-reconcile/replacement, the implementation evaluates `{'active':d['active'],'epoch':d['epoch']+1}` instead of preserving the specified completion transition.

VERIFIED REPAIR

Implement the replacement contract using `{'active':None,'epoch':d['epoch']+1}`.

Unsuccessful approach: The attempted repair uses `{'active':None,'epoch':d['epoch']}`, which still violates a normal or boundary completion fixture.

Case contract

On a new result snapshot, option identifiers determine continuity; labels are presentation only. Duplicate identifiers collapse at their first occurrence. Active and selected identities survive only where specified, and a query replacement clears transient result state.

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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':d['active'],'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', variant), 'id'+str(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 dedupe['b', 'c']['b', 'c']Passed
boundary dedupe[][]Passed
normal active-index00Passed
boundary active-indexNoneNonePassed
normal added['c']['c']Passed
boundary added[][]Passed
normal removed['a']['a']Passed
boundary removed[][]Passed
normal committedzzPassed
boundary committedNoneNonePassed
normal active-labelBeeBeePassed
boundary active-labelPassed
normal render-query[][]Passed
boundary render-query[][]Passed
normal replacement{'active': 'b', 'epoch': 2}{'active': None, 'epoch': 2}Failed
boundary replacement{'active': None, 'epoch': 2}{'active': None, 'epoch': 2}Passed
normal row-key[['b', 0], ['c', 1], ['b', 2]][['b', 0], ['c', 1], ['b', 2]]Passed
boundary row-key[][]Passed
normal selection-visible{'has_value': True, 'in_results': False}{'has_value': True, 'in_results': False}Passed
boundary selection-visible{'has_value': False, 'in_results': False}{'has_value': False, 'in_results': False}Passed
variant query or selection payloadid1id1Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 8bf1b66aea62abeaeb25335e15e3263e2caf046fdcedc344be4f4d05534fd8f5

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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', variant), 'id'+str(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 dedupe['b', 'c']['b', 'c']Passed
boundary dedupe[][]Passed
normal active-index00Passed
boundary active-indexNoneNonePassed
normal added['c']['c']Passed
boundary added[][]Passed
normal removed['a']['a']Passed
boundary removed[][]Passed
normal committedzzPassed
boundary committedNoneNonePassed
normal active-labelBeeBeePassed
boundary active-labelPassed
normal render-query[][]Passed
boundary render-query[][]Passed
normal replacement{'active': None, 'epoch': 1}{'active': None, 'epoch': 2}Failed
boundary replacement{'active': None, 'epoch': 1}{'active': None, 'epoch': 2}Failed
normal row-key[['b', 0], ['c', 1], ['b', 2]][['b', 0], ['c', 1], ['b', 2]]Passed
boundary row-key[][]Passed
normal selection-visible{'has_value': True, 'in_results': False}{'has_value': True, 'in_results': False}Passed
boundary selection-visible{'has_value': False, 'in_results': False}{'has_value': False, 'in_results': False}Passed
variant query or selection payloadid1id1Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / a0c81b917b282e1ead3aa783427ba90c031c24f99b7dd91dc535e040e044c835

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 == 'dedupe': return list(dict.fromkeys(d['ids']))
    if event == 'active-index': return d['ids'].index(d['active']) if d['active'] in d['ids'] else None
    if event == 'added': return [x for x in dict.fromkeys(d['ids']) if x not in d['old']]
    if event == 'removed': return [x for x in d['old'] if x not in d['ids']]
    if event == 'committed': return d['selected']
    if event == 'active-label': return d['labels'][d['ids'].index(d['active'])] if d['active'] in d['ids'] else ''
    if event == 'render-query': return d['ids'] if d['query']==d['result_query'] else []
    if event == 'replacement': return {'active':None,'epoch':d['epoch']+1}
    if event == 'row-key': return [[x,i] for i,x in enumerate(d['ids'])]
    if event == 'selection-visible': return {'has_value':d['selected'] is not None,'in_results':d['selected'] in d['ids']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'old':['a','b'],'ids':['b','c','b'],'labels':['Bee','See','Bee'],'active':'b','selected':'z','old_label':'Old Bee','query':'be','result_query':'b','epoch':N}
boundary = {'old':[],'ids':[],'labels':[],'active':None,'selected':None,'old_label':'','query':'','result_query':'','epoch':N}
check('normal dedupe', solve('dedupe', normal), ['b','c'])
check('boundary dedupe', solve('dedupe', boundary), [])
check('normal active-index', solve('active-index', normal), 0)
check('boundary active-index', solve('active-index', boundary), None)
check('normal added', solve('added', normal), ['c'])
check('boundary added', solve('added', boundary), [])
check('normal removed', solve('removed', normal), ['a'])
check('boundary removed', solve('removed', boundary), [])
check('normal committed', solve('committed', normal), 'z')
check('boundary committed', solve('committed', boundary), None)
check('normal active-label', solve('active-label', normal), 'Bee')
check('boundary active-label', solve('active-label', boundary), '')
check('normal render-query', solve('render-query', normal), [])
check('boundary render-query', solve('render-query', boundary), [])
check('normal replacement', solve('replacement', normal), {'active':None,'epoch':N+1})
check('boundary replacement', solve('replacement', boundary), {'active':None,'epoch':N+1})
check('normal row-key', solve('row-key', normal), [['b',0],['c',1],['b',2]])
check('boundary row-key', solve('row-key', boundary), [])
check('normal selection-visible', solve('selection-visible', normal), {'has_value':True,'in_results':False})
check('boundary selection-visible', solve('selection-visible', boundary), {'has_value':False,'in_results':False})
variant = dict(normal, **{'selected':'id'+str(N)})
check('variant query or selection payload', solve('committed', variant), 'id'+str(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 dedupe['b', 'c']['b', 'c']Passed
boundary dedupe[][]Passed
normal active-index00Passed
boundary active-indexNoneNonePassed
normal added['c']['c']Passed
boundary added[][]Passed
normal removed['a']['a']Passed
boundary removed[][]Passed
normal committedzzPassed
boundary committedNoneNonePassed
normal active-labelBeeBeePassed
boundary active-labelPassed
normal render-query[][]Passed
boundary render-query[][]Passed
normal replacement{'active': None, 'epoch': 2}{'active': None, 'epoch': 2}Passed
boundary replacement{'active': None, 'epoch': 2}{'active': None, 'epoch': 2}Passed
normal row-key[['b', 0], ['c', 1], ['b', 2]][['b', 0], ['c', 1], ['b', 2]]Passed
boundary row-key[][]Passed
normal selection-visible{'has_value': True, 'in_results': False}{'has_value': True, 'in_results': False}Passed
boundary selection-visible{'has_value': False, 'in_results': False}{'has_value': False, 'in_results': False}Passed
variant query or selection payloadid1id1Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 8bf1369d87654a9b61623b929942827f9f5acc99815f1652f51067242a827d7b

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

Case digest / 94273b387781135d234e57557035f4d60f514f67fbb6e67add07605b95add09c