FAILURE MAP
← Case archive

FA-22111 / Autocomplete interactions / Open access

Multi-value autocomplete tokens: equal token labels collapse distinct selected identities · case 01

The labels completion transition produces an incorrect observable state.

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

ROOT CAUSE

At multiple-values/labels, the implementation evaluates `list(dict(zip(d['labels'],d['selected'])).items())` instead of preserving the specified completion transition.

THE FAILURE

At multiple-values/labels, the implementation evaluates `list(dict(zip(d['labels'],d['selected'])).items())` instead of preserving the specified completion transition.

Unsuccessful approach: The attempted repair uses `list(zip(d['selected'],dict.fromkeys(d['labels'])))`, which still violates a normal or boundary completion fixture.

Case contract

Accepting a suggestion appends its identifier once, preserving selection order and independent duplicate labels. Removing a token removes that identity only. Already-selected results are excluded, pending query text is separate from selected values, and capacity is measured in committed identities.

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 == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(dict(zip(d['labels'],d['selected'])).items())
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 repeat['a', 'b']['a', 'b']Passed
boundary repeat['']['']Passed
normal append['a', 'b', 'c']['a', 'b', 'c']Passed
boundary append['']['']Passed
normal remove['b']['b']Passed
boundary remove[][]Passed
normal filter['c', 'd']['c', 'd']Passed
boundary filter['']['']Passed
normal labels[['Same', 'b']][['a', 'Same'], ['b', 'Same']]Failed
boundary labels[][]Passed
normal capacity11Passed
boundary capacity00Passed
normal at-limitFalseFalsePassed
boundary at-limitTrueTruePassed
normal submit['a', 'b']['a', 'b']Passed
boundary submit[][]Passed
normal after-accept{'draft': '', 'epoch': 2}{'draft': '', 'epoch': 2}Passed
boundary after-accept{'draft': '', 'epoch': 2}{'draft': '', 'epoch': 2}Passed
normal undo-remove['a', 'b']['a', 'b']Passed
boundary undo-remove[][]Passed
variant query or selection payload['a', 'b', 'id1']['a', 'b', 'id1']Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 782e1f601041af7e897d183f5de25f2c2976c1fb3aae8876a17891074cd109ac

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 == 'repeat': return d['selected'] if d['candidate'] in d['selected'] else d['selected']+[d['candidate']]
    if event == 'append': return d['selected']+[d['new']]
    if event == 'remove': return [x for x in d['selected'] if x!=d['remove']]
    if event == 'filter': return [x for x in d['results'] if x not in d['selected']]
    if event == 'labels': return list(zip(d['selected'],dict.fromkeys(d['labels'])))
    if event == 'capacity': return max(0,d['limit']-len(d['selected']))
    if event == 'at-limit': return len(d['selected'])>=d['limit']
    if event == 'submit': return d['selected']
    if event == 'after-accept': return {'draft':'','epoch':d['epoch']+1}
    if event == 'undo-remove': return [d['remove']]+[x for x in d['selected'] if x!=d['remove']] if d['remove'] in d['selected'] else d['selected']
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'selected':['a','b'],'labels':['Same','Same'],'candidate':'b','new':'c','remove':'a','results':['a','c','d'],'draft':'ca','limit':3,'epoch':N}
boundary = {'selected':[],'labels':[],'candidate':'','new':'','remove':'missing','results':[''],'draft':'','limit':0,'epoch':N}
check('normal repeat', solve('repeat', normal), ['a','b'])
check('boundary repeat', solve('repeat', boundary), [''])
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [''])
check('normal remove', solve('remove', normal), ['b'])
check('boundary remove', solve('remove', boundary), [])
check('normal filter', solve('filter', normal), ['c','d'])
check('boundary filter', solve('filter', boundary), [''])
check('normal labels', solve('labels', normal), [('a','Same'),('b','Same')])
check('boundary labels', solve('labels', boundary), [])
check('normal capacity', solve('capacity', normal), 1)
check('boundary capacity', solve('capacity', boundary), 0)
check('normal at-limit', solve('at-limit', normal), False)
check('boundary at-limit', solve('at-limit', boundary), True)
check('normal submit', solve('submit', normal), ['a','b'])
check('boundary submit', solve('submit', boundary), [])
check('normal after-accept', solve('after-accept', normal), {'draft':'','epoch':N+1})
check('boundary after-accept', solve('after-accept', boundary), {'draft':'','epoch':N+1})
check('normal undo-remove', solve('undo-remove', normal), ['a','b'])
check('boundary undo-remove', solve('undo-remove', boundary), [])
variant = dict(normal, **{'new':'id'+str(N)})
check('variant query or selection payload', solve('append', variant), ['a','b','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 repeat['a', 'b']['a', 'b']Passed
boundary repeat['']['']Passed
normal append['a', 'b', 'c']['a', 'b', 'c']Passed
boundary append['']['']Passed
normal remove['b']['b']Passed
boundary remove[][]Passed
normal filter['c', 'd']['c', 'd']Passed
boundary filter['']['']Passed
normal labels[['a', 'Same']][['a', 'Same'], ['b', 'Same']]Failed
boundary labels[][]Passed
normal capacity11Passed
boundary capacity00Passed
normal at-limitFalseFalsePassed
boundary at-limitTrueTruePassed
normal submit['a', 'b']['a', 'b']Passed
boundary submit[][]Passed
normal after-accept{'draft': '', 'epoch': 2}{'draft': '', 'epoch': 2}Passed
boundary after-accept{'draft': '', 'epoch': 2}{'draft': '', 'epoch': 2}Passed
normal undo-remove['a', 'b']['a', 'b']Passed
boundary undo-remove[][]Passed
variant query or selection payload['a', 'b', 'id1']['a', 'b', 'id1']Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 86f3921b498909f2967c5e5640139d29518a0b56466510dd13c30a5c585ce22b

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

Case digest / 5353595e13710367373ab2198988ede8b0e1ff84edd9643ccb003734f8211bf6