FAILURE MAP
← Case archive

FA-22496 / Autocomplete interactions / Open access

Paged autocomplete interaction: first response appends obsolete rows from a previous query · case 01

The first completion transition produces an incorrect observable state.

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

ROOT CAUSE

At result-pages/first, the implementation evaluates `d['rows']+d['page']` instead of preserving the specified completion transition.

THE FAILURE

At result-pages/first, the implementation evaluates `d['rows']+d['page']` instead of preserving the specified completion transition.

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

Case contract

Additional suggestion pages belong to a query epoch and continuation token. First pages replace, later pages append unseen identities, and the active option is preserved by identity. A page request does not clear committed value or reset the typed draft. This models presentation, not transport pagination.

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 == 'append': return d['rows']+[x for x in d['page'] if x not in d['rows']]
    if event == 'first': return d['rows']+d['page']
    if event == 'continuation': return d['cursor']
    if event == 'has-more': return d['cursor'] is not None
    if event == 'page-epoch': return d['page_epoch']==d['epoch']
    if event == 'active': return d['rows'].index(d['active']) if d['active'] in d['rows'] else None
    if event == 'value': return d['value']
    if event == 'draft': return d['draft']
    if event == 'more-busy': return not d['loading_more'] and d['cursor'] is not None
    if event == 'footer': return len(d['rows'])
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'rows':['a','b'],'page':['b','c'],'cursor':'next-2','used':'next-1','epoch':N,'page_epoch':N-1,'active':'b','value':'v','draft':'pe','loading_more':True}
boundary = {'rows':[],'page':[],'cursor':None,'used':None,'epoch':N,'page_epoch':N,'active':None,'value':None,'draft':'','loading_more':False}
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [])
check('normal first', solve('first', normal), ['b','c'])
check('boundary first', solve('first', boundary), [])
check('normal continuation', solve('continuation', normal), 'next-2')
check('boundary continuation', solve('continuation', boundary), None)
check('normal has-more', solve('has-more', normal), True)
check('boundary has-more', solve('has-more', boundary), False)
check('normal page-epoch', solve('page-epoch', normal), False)
check('boundary page-epoch', solve('page-epoch', boundary), True)
check('normal active', solve('active', normal), 1)
check('boundary active', solve('active', boundary), None)
check('normal value', solve('value', normal), 'v')
check('boundary value', solve('value', boundary), None)
check('normal draft', solve('draft', normal), 'pe')
check('boundary draft', solve('draft', boundary), '')
check('normal more-busy', solve('more-busy', normal), False)
check('boundary more-busy', solve('more-busy', boundary), False)
check('normal footer', solve('footer', normal), 2)
check('boundary footer', solve('footer', boundary), 0)
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('draft', variant), 'q'*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 append['a', 'b', 'c']['a', 'b', 'c']Passed
boundary append[][]Passed
normal first['a', 'b', 'b', 'c']['b', 'c']Failed
boundary first[][]Passed
normal continuationnext-2next-2Passed
boundary continuationNoneNonePassed
normal has-moreTrueTruePassed
boundary has-moreFalseFalsePassed
normal page-epochFalseFalsePassed
boundary page-epochTrueTruePassed
normal active11Passed
boundary activeNoneNonePassed
normal valuevvPassed
boundary valueNoneNonePassed
normal draftpepePassed
boundary draftPassed
normal more-busyFalseFalsePassed
boundary more-busyFalseFalsePassed
normal footer22Passed
boundary footer00Passed
variant query or selection payloadqqPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / a168b6ce77d507220c5ab703c7f3c19f2a90900c59ee3c0b83dbabe3d1fb607c

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 == 'append': return d['rows']+[x for x in d['page'] if x not in d['rows']]
    if event == 'first': return d['rows']
    if event == 'continuation': return d['cursor']
    if event == 'has-more': return d['cursor'] is not None
    if event == 'page-epoch': return d['page_epoch']==d['epoch']
    if event == 'active': return d['rows'].index(d['active']) if d['active'] in d['rows'] else None
    if event == 'value': return d['value']
    if event == 'draft': return d['draft']
    if event == 'more-busy': return not d['loading_more'] and d['cursor'] is not None
    if event == 'footer': return len(d['rows'])
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'rows':['a','b'],'page':['b','c'],'cursor':'next-2','used':'next-1','epoch':N,'page_epoch':N-1,'active':'b','value':'v','draft':'pe','loading_more':True}
boundary = {'rows':[],'page':[],'cursor':None,'used':None,'epoch':N,'page_epoch':N,'active':None,'value':None,'draft':'','loading_more':False}
check('normal append', solve('append', normal), ['a','b','c'])
check('boundary append', solve('append', boundary), [])
check('normal first', solve('first', normal), ['b','c'])
check('boundary first', solve('first', boundary), [])
check('normal continuation', solve('continuation', normal), 'next-2')
check('boundary continuation', solve('continuation', boundary), None)
check('normal has-more', solve('has-more', normal), True)
check('boundary has-more', solve('has-more', boundary), False)
check('normal page-epoch', solve('page-epoch', normal), False)
check('boundary page-epoch', solve('page-epoch', boundary), True)
check('normal active', solve('active', normal), 1)
check('boundary active', solve('active', boundary), None)
check('normal value', solve('value', normal), 'v')
check('boundary value', solve('value', boundary), None)
check('normal draft', solve('draft', normal), 'pe')
check('boundary draft', solve('draft', boundary), '')
check('normal more-busy', solve('more-busy', normal), False)
check('boundary more-busy', solve('more-busy', boundary), False)
check('normal footer', solve('footer', normal), 2)
check('boundary footer', solve('footer', boundary), 0)
variant = dict(normal, **{'draft':'q'*N})
check('variant query or selection payload', solve('draft', variant), 'q'*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 append['a', 'b', 'c']['a', 'b', 'c']Passed
boundary append[][]Passed
normal first['a', 'b']['b', 'c']Failed
boundary first[][]Passed
normal continuationnext-2next-2Passed
boundary continuationNoneNonePassed
normal has-moreTrueTruePassed
boundary has-moreFalseFalsePassed
normal page-epochFalseFalsePassed
boundary page-epochTrueTruePassed
normal active11Passed
boundary activeNoneNonePassed
normal valuevvPassed
boundary valueNoneNonePassed
normal draftpepePassed
boundary draftPassed
normal more-busyFalseFalsePassed
boundary more-busyFalseFalsePassed
normal footer22Passed
boundary footer00Passed
variant query or selection payloadqqPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 655334c7f1b9c35b8238be0de4944688e6e5968af5476a041f089f9bdc73cf61

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

Case digest / e2ead1b50fe13182d61433007eb27ef41ecf4576cfad33ea917959246ad16b69