FAILURE MAP
← Case archive

FA-22516 / Autocomplete interactions / Open access

Paged autocomplete interaction: appending suggestions adjusts active position by the new page length · case 01

The active completion transition produces an incorrect observable state.

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

ROOT CAUSE

At result-pages/active, the implementation evaluates `len(d['page'])+d['rows'].index(d['active']) if d['active'] in d['rows'] else None` instead of preserving the specified completion transition.

THE FAILURE

At result-pages/active, the implementation evaluates `len(d['page'])+d['rows'].index(d['active']) if d['active'] in d['rows'] else None` instead of preserving the specified completion transition.

Unsuccessful approach: The attempted repair uses `len(d['rows'])-1 if d['rows'] else 0`, 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['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 len(d['page'])+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['b', 'c']['b', 'c']Passed
boundary first[][]Passed
normal continuationnext-2next-2Passed
boundary continuationNoneNonePassed
normal has-moreTrueTruePassed
boundary has-moreFalseFalsePassed
normal page-epochFalseFalsePassed
boundary page-epochTrueTruePassed
normal active31Failed
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 / adad281d5fa7deba17ef1acd0434a63adaeeff8f1cb581b423be66e68fb164fc

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['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 len(d['rows'])-1 if d['rows'] else 0
    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['b', 'c']['b', 'c']Passed
boundary first[][]Passed
normal continuationnext-2next-2Passed
boundary continuationNoneNonePassed
normal has-moreTrueTruePassed
boundary has-moreFalseFalsePassed
normal page-epochFalseFalsePassed
boundary page-epochTrueTruePassed
normal active11Passed
boundary active0NoneFailed
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 / d5d4cae96d37577d4f8f292294382b0c3c10ac9e4bf88d00df1cfb40b47a5c63

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 / b8f543e33b1045e0c7a8d62799f5d6dc3659e96d8ce17551f49c28091c5e680d