FAILURE MAP
← Case archive

FA-22856 / Autocomplete interactions / Open access

Selected suggestion label resolution: selected-label lookup injects its identifier into search text · case 01

The query completion transition produces an incorrect observable state.

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

ROOT CAUSE

At label-resolution/query, the implementation evaluates `d['value']` instead of preserving the specified completion transition.

VERIFIED REPAIR

Implement the query contract using `d['query']`.

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

Case contract

A selected identifier may need asynchronous label resolution independently of query suggestions. Responses bind to selected identity and selection epoch. Until resolved the identity stays committed; failed resolution shows an explicit fallback and never inserts the identifier into the query. Empty labels are valid resolutions.

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 == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['value']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', 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 identityFalseFalsePassed
boundary identityTrueTruePassed
normal epochFalseFalsePassed
boundary epochTrueTruePassed
normal valuep1p1Passed
boundary valuePassed
normal queryp1peFailed
boundary queryPassed
normal empty-labelPearPearPassed
boundary empty-labelPassed
normal failureUnknown choiceUnknown choicePassed
boundary failurePassed
normal pendingTrueTruePassed
boundary pendingFalseFalsePassed
normal request['p1', 1]['p1', 1]Passed
boundary request['', 1]['', 1]Passed
normal clear-errorNoneNonePassed
boundary clear-errorNoneNonePassed
normal separate-rows[][]Passed
boundary separate-rows[][]Passed
variant query or selection payloadid1id1Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 111b85da10832ba2903616b18e3b41c7b7936c9a753bb3162a945a1b7b8f1399

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 == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['label']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', 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 identityFalseFalsePassed
boundary identityTrueTruePassed
normal epochFalseFalsePassed
boundary epochTrueTruePassed
normal valuep1p1Passed
boundary valuePassed
normal queryPearpeFailed
boundary queryPassed
normal empty-labelPearPearPassed
boundary empty-labelPassed
normal failureUnknown choiceUnknown choicePassed
boundary failurePassed
normal pendingTrueTruePassed
boundary pendingFalseFalsePassed
normal request['p1', 1]['p1', 1]Passed
boundary request['', 1]['', 1]Passed
normal clear-errorNoneNonePassed
boundary clear-errorNoneNonePassed
normal separate-rows[][]Passed
boundary separate-rows[][]Passed
variant query or selection payloadid1id1Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 02767e26016b4d06a3240b78f4a0688733a1c4f6c87cc4f69a0068ce5dd99f7e

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 == 'identity': return d['response_id']==d['value']
    if event == 'epoch': return d['response_epoch']==d['epoch']
    if event == 'value': return d['value']
    if event == 'query': return d['query']
    if event == 'empty-label': return d['label']
    if event == 'failure': return d['fallback'] if d['error'] else d['label']
    if event == 'pending': return d['pending'] and not d['resolved']
    if event == 'request': return [d['value'],d['epoch']]
    if event == 'clear-error': return None
    if event == 'separate-rows': return []
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','response_id':'p0','label':'Pear','fallback':'Unknown choice','epoch':N,'response_epoch':N-1,'query':'pe','pending':True,'error':'missing','resolved':False}
boundary = {'value':'','response_id':'','label':'','fallback':'Unknown choice','epoch':N,'response_epoch':N,'query':'','pending':False,'error':None,'resolved':True}
check('normal identity', solve('identity', normal), False)
check('boundary identity', solve('identity', boundary), True)
check('normal epoch', solve('epoch', normal), False)
check('boundary epoch', solve('epoch', boundary), True)
check('normal value', solve('value', normal), 'p1')
check('boundary value', solve('value', boundary), '')
check('normal query', solve('query', normal), 'pe')
check('boundary query', solve('query', boundary), '')
check('normal empty-label', solve('empty-label', normal), 'Pear')
check('boundary empty-label', solve('empty-label', boundary), '')
check('normal failure', solve('failure', normal), 'Unknown choice')
check('boundary failure', solve('failure', boundary), '')
check('normal pending', solve('pending', normal), True)
check('boundary pending', solve('pending', boundary), False)
check('normal request', solve('request', normal), ['p1',N])
check('boundary request', solve('request', boundary), ['',N])
check('normal clear-error', solve('clear-error', normal), None)
check('boundary clear-error', solve('clear-error', boundary), None)
check('normal separate-rows', solve('separate-rows', normal), [])
check('boundary separate-rows', solve('separate-rows', boundary), [])
variant = dict(normal, **{'value':'id'+str(N)})
check('variant query or selection payload', solve('value', 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 identityFalseFalsePassed
boundary identityTrueTruePassed
normal epochFalseFalsePassed
boundary epochTrueTruePassed
normal valuep1p1Passed
boundary valuePassed
normal querypepePassed
boundary queryPassed
normal empty-labelPearPearPassed
boundary empty-labelPassed
normal failureUnknown choiceUnknown choicePassed
boundary failurePassed
normal pendingTrueTruePassed
boundary pendingFalseFalsePassed
normal request['p1', 1]['p1', 1]Passed
boundary request['', 1]['', 1]Passed
normal clear-errorNoneNonePassed
boundary clear-errorNoneNonePassed
normal separate-rows[][]Passed
boundary separate-rows[][]Passed
variant query or selection payloadid1id1Passed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 498d50b66fe5dc7d26c810bc1544794a19a87c3cab1e83677215629b8735a36a

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

Case digest / 2d5f33b76c7fac253f86e1b4a7a548d60dc4851d06196fc6bc7dfcb4315d52ba