FAILURE MAP
← Case archive

FA-22616 / Autocomplete interactions / Open access

Recent accepted suggestions: label refresh changes the saved completion identifier · case 01

The rename completion transition produces an incorrect observable state.

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

ROOT CAUSE

At recent-completions/rename, the implementation evaluates `dict(d['labels'], **{d['new_label']:d['accepted']})` instead of preserving the specified completion transition.

THE FAILURE

At recent-completions/rename, the implementation evaluates `dict(d['labels'], **{d['new_label']:d['accepted']})` instead of preserving the specified completion transition.

Unsuccessful approach: The attempted repair uses `d['labels']`, which still violates a normal or boundary completion fixture.

Case contract

Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.

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 == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return dict(d['labels'], **{d['new_label']:d['accepted']})
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', 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 record['b', 'a', 'c']['b', 'a', 'c']Passed
boundary record['']['']Passed
normal limit['a', 'b']['a', 'b']Passed
boundary limit[][]Passed
normal scope[][]Passed
boundary scope[][]Passed
normal preview['a', 'b', 'c']['a', 'b', 'c']Passed
boundary preview[][]Passed
normal remove['a', 'c']['a', 'c']Passed
boundary remove[][]Passed
normal rename{'Bee': 'b', 'a': 'A', 'b': 'Old B', 'c': 'C'}{'a': 'A', 'b': 'Bee', 'c': 'C'}Failed
boundary rename{'': ''}{'': ''}Passed
normal empty-id['b']['b']Passed
boundary empty-id['']['']Passed
normal query-sourcebebePassed
boundary query-sourcePassed
normal clear{'draft': 'be', 'history': []}{'draft': 'be', 'history': []}Passed
boundary clear{'draft': '', 'history': []}{'draft': '', 'history': []}Passed
normal oldest-first-export['C', 'Old B', 'A']['C', 'Old B', 'A']Passed
boundary oldest-first-export[][]Passed
variant query or selection payload['id1']['id1']Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 332ae98f56f0a81b979a547eda3d94c78b68c9d8024ca62c36d07376b68bde53

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 == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
    if event == 'limit': return d['history'][:d['limit']]
    if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
    if event == 'preview': return d['history']
    if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
    if event == 'rename': return d['labels']
    if event == 'empty-id': return [d['accepted']]
    if event == 'query-source': return d['draft']
    if event == 'clear': return {'history':[],'draft':d['draft']}
    if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', 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 record['b', 'a', 'c']['b', 'a', 'c']Passed
boundary record['']['']Passed
normal limit['a', 'b']['a', 'b']Passed
boundary limit[][]Passed
normal scope[][]Passed
boundary scope[][]Passed
normal preview['a', 'b', 'c']['a', 'b', 'c']Passed
boundary preview[][]Passed
normal remove['a', 'c']['a', 'c']Passed
boundary remove[][]Passed
normal rename{'a': 'A', 'b': 'Old B', 'c': 'C'}{'a': 'A', 'b': 'Bee', 'c': 'C'}Failed
boundary rename{}{'': ''}Failed
normal empty-id['b']['b']Passed
boundary empty-id['']['']Passed
normal query-sourcebebePassed
boundary query-sourcePassed
normal clear{'draft': 'be', 'history': []}{'draft': 'be', 'history': []}Passed
boundary clear{'draft': '', 'history': []}{'draft': '', 'history': []}Passed
normal oldest-first-export['C', 'Old B', 'A']['C', 'Old B', 'A']Passed
boundary oldest-first-export[][]Passed
variant query or selection payload['id1']['id1']Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 46e6db1fc43d05ba82ef4733c05e597b4cb8b3c74c4e7ed6da11f25e0ebb6325

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

Case digest / 722a61c7dabc037b7288edb5bce3de6560216d5adfca73ff80b33510151ff6cb