FAILURE MAP
← Case archive

FA-21881 / Autocomplete interactions / Open access

Composition-aware suggestion lifecycle: final display duplicates the committed preedit · case 01

The display-end completion transition produces an incorrect observable state.

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

ROOT CAUSE

At composition/display-end, the implementation evaluates `d['preedit']+d['final']` instead of preserving the specified completion transition.

THE FAILURE

At composition/display-end, the implementation evaluates `d['preedit']+d['final']` instead of preserving the specified completion transition.

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

Case contract

During IME composition, preedit is visible but never searched or committed. Starting composition saves the query snapshot; cancellation restores it; finalization schedules one final query. Candidate acceptance belongs to the IME, and result visibility is suspended until final text is available.

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 == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['preedit']+d['final']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*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 start{'composing': True, 'saved': 'ca'}{'composing': True, 'saved': 'ca'}Passed
boundary start{'composing': True, 'saved': ''}{'composing': True, 'saved': ''}Passed
normal preedit{'display': '猫', 'query': 'ca'}{'display': '猫', 'query': 'ca'}Passed
boundary preedit{'display': '', 'query': ''}{'display': '', 'query': ''}Passed
normal schedule[][]Passed
boundary schedule['']['']Passed
normal finalize{'query': '猫咪', 'revision': 2}{'query': '猫咪', 'revision': 2}Passed
boundary finalize{'query': '', 'revision': 2}{'query': '', 'revision': 2}Passed
normal cancel{'composing': False, 'query': 'cat'}{'composing': False, 'query': 'cat'}Passed
boundary cancel{'composing': False, 'query': ''}{'composing': False, 'query': ''}Passed
normal candidateNoneNonePassed
boundary candidateNoneNonePassed
normal visibility[][]Passed
boundary visibility[][]Passed
normal invalidate{'pending': [], 'revision': 2}{'pending': [], 'revision': 2}Passed
boundary invalidate{'pending': [], 'revision': 2}{'pending': [], 'revision': 2}Passed
normal display-end猫猫咪猫咪Failed
boundary display-endPassed
normal rebase{'active': None, 'query': '猫咪'}{'active': None, 'query': '猫咪'}Passed
boundary rebase{'active': None, 'query': ''}{'active': None, 'query': ''}Passed
variant query or selection payload猫猫猫Failed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 3f49b21bbf3998b0df2c0de58ffbd48eea31a63bbc9aaf0582f0fdfcb5585704

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 == 'start': return {'saved':d['query'],'composing':True}
    if event == 'preedit': return {'display':d['preedit'],'query':d['query']}
    if event == 'schedule': return [] if d['composing'] else [d['query']]
    if event == 'finalize': return {'query':d['final'],'revision':d['revision']+1}
    if event == 'cancel': return {'query':d['saved'],'composing':False}
    if event == 'candidate': return None if d['composing'] else d['active']
    if event == 'visibility': return [] if d['composing'] else d['results']
    if event == 'invalidate': return {'pending':[],'revision':d['revision']+1}
    if event == 'display-end': return d['query']
    if event == 'rebase': return {'active':None,'query':d['final']}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'query':'ca','preedit':'猫','final':'猫咪','saved':'cat','revision':N,'active':'cat-id','pending':['ca'],'results':['cat-id'],'composing':True}
boundary = {'query':'','preedit':'','final':'','saved':'','revision':N,'active':None,'pending':[],'results':[],'composing':False}
check('normal start', solve('start', normal), {'saved':'ca','composing':True})
check('boundary start', solve('start', boundary), {'saved':'','composing':True})
check('normal preedit', solve('preedit', normal), {'display':'猫','query':'ca'})
check('boundary preedit', solve('preedit', boundary), {'display':'','query':''})
check('normal schedule', solve('schedule', normal), [])
check('boundary schedule', solve('schedule', boundary), [''])
check('normal finalize', solve('finalize', normal), {'query':'猫咪','revision':N+1})
check('boundary finalize', solve('finalize', boundary), {'query':'','revision':N+1})
check('normal cancel', solve('cancel', normal), {'query':'cat','composing':False})
check('boundary cancel', solve('cancel', boundary), {'query':'','composing':False})
check('normal candidate', solve('candidate', normal), None)
check('boundary candidate', solve('candidate', boundary), None)
check('normal visibility', solve('visibility', normal), [])
check('boundary visibility', solve('visibility', boundary), [])
check('normal invalidate', solve('invalidate', normal), {'pending':[],'revision':N+1})
check('boundary invalidate', solve('invalidate', boundary), {'pending':[],'revision':N+1})
check('normal display-end', solve('display-end', normal), '猫咪')
check('boundary display-end', solve('display-end', boundary), '')
check('normal rebase', solve('rebase', normal), {'active':None,'query':'猫咪'})
check('boundary rebase', solve('rebase', boundary), {'active':None,'query':''})
variant = dict(normal, **{'final':'猫'*N})
check('variant query or selection payload', solve('display-end', variant), '猫'*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 start{'composing': True, 'saved': 'ca'}{'composing': True, 'saved': 'ca'}Passed
boundary start{'composing': True, 'saved': ''}{'composing': True, 'saved': ''}Passed
normal preedit{'display': '猫', 'query': 'ca'}{'display': '猫', 'query': 'ca'}Passed
boundary preedit{'display': '', 'query': ''}{'display': '', 'query': ''}Passed
normal schedule[][]Passed
boundary schedule['']['']Passed
normal finalize{'query': '猫咪', 'revision': 2}{'query': '猫咪', 'revision': 2}Passed
boundary finalize{'query': '', 'revision': 2}{'query': '', 'revision': 2}Passed
normal cancel{'composing': False, 'query': 'cat'}{'composing': False, 'query': 'cat'}Passed
boundary cancel{'composing': False, 'query': ''}{'composing': False, 'query': ''}Passed
normal candidateNoneNonePassed
boundary candidateNoneNonePassed
normal visibility[][]Passed
boundary visibility[][]Passed
normal invalidate{'pending': [], 'revision': 2}{'pending': [], 'revision': 2}Passed
boundary invalidate{'pending': [], 'revision': 2}{'pending': [], 'revision': 2}Passed
normal display-endca猫咪Failed
boundary display-endPassed
normal rebase{'active': None, 'query': '猫咪'}{'active': None, 'query': '猫咪'}Passed
boundary rebase{'active': None, 'query': ''}{'active': None, 'query': ''}Passed
variant query or selection payloadca猫Failed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / ce7c292e3907383e3ea5d3b7c29cf0b1d6a16df9f7390bede418aa932bd96988

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

Case digest / 62eeac59eb4963bd3b44a00318a180b8ba0eff86fe7d6eba18939ceece41f0ef