FAILURE MAP
← Case archive

FA-22276 / Autocomplete interactions / Open access

Free-text option creation: failed creation erases the draft required for correction · case 01

The failure completion transition produces an incorrect observable state.

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

ROOT CAUSE

At create-option/failure, the implementation evaluates `{'draft':'','error':d['error'],'pending':False}` instead of preserving the specified completion transition.

VERIFIED REPAIR

Implement the failure contract using `{'draft':d['draft'],'error':d['error'],'pending':False}`.

Unsuccessful approach: The attempted repair uses `{'draft':d['draft'],'error':None,'pending':False}`, which still violates a normal or boundary completion fixture.

Case contract

This picker may create a new option from trimmed draft only when creation is enabled, the draft is nonempty, no case-insensitive exact label exists, and no create transaction is pending. Synthetic create rows carry a distinct namespace and raw text is never mistaken for a persisted identifier.

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 == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':'','error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 trimPlumPlumPassed
boundary trimPassed
normal exactTrueTruePassed
boundary exactFalseFalsePassed
normal nonemptyTrueTruePassed
boundary nonemptyFalseFalsePassed
normal permissionTrueTruePassed
boundary permissionFalseFalsePassed
normal busyFalseFalsePassed
boundary busyTrueTruePassed
normal row-idcreate:Plumcreate:PlumPassed
boundary row-idcreate:create:Passed
normal resolvep1p1Passed
boundary resolvePassed
normal failure{'draft': '', 'error': 'rejected', 'pending': False}{'draft': ' Plum ', 'error': 'rejected', 'pending': False}Failed
boundary failure{'draft': '', 'error': None, 'pending': False}{'draft': ' ', 'error': None, 'pending': False}Failed
normal pending-valueNoneNonePassed
boundary pending-valuePassed
normal retry{'query_epoch': 2, 'text': 'Plum'}{'query_epoch': 2, 'text': 'Plum'}Passed
boundary retry{'query_epoch': 2, 'text': ''}{'query_epoch': 2, 'text': ''}Passed
variant query or selection payloadPlumPlumPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 19af59f7b3a5d3e29f344bfc7606e5a91c8aa475e6383a9e14ddcd096b1da2a5

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 == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':None,'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 trimPlumPlumPassed
boundary trimPassed
normal exactTrueTruePassed
boundary exactFalseFalsePassed
normal nonemptyTrueTruePassed
boundary nonemptyFalseFalsePassed
normal permissionTrueTruePassed
boundary permissionFalseFalsePassed
normal busyFalseFalsePassed
boundary busyTrueTruePassed
normal row-idcreate:Plumcreate:PlumPassed
boundary row-idcreate:create:Passed
normal resolvep1p1Passed
boundary resolvePassed
normal failure{'draft': ' Plum ', 'error': None, 'pending': False}{'draft': ' Plum ', 'error': 'rejected', 'pending': False}Failed
boundary failure{'draft': ' ', 'error': None, 'pending': False}{'draft': ' ', 'error': None, 'pending': False}Passed
normal pending-valueNoneNonePassed
boundary pending-valuePassed
normal retry{'query_epoch': 2, 'text': 'Plum'}{'query_epoch': 2, 'text': 'Plum'}Passed
boundary retry{'query_epoch': 2, 'text': ''}{'query_epoch': 2, 'text': ''}Passed
variant query or selection payloadPlumPlumPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / 4a7459393998e4482ccd2d90d4d7e4cc31928b37d433d53afd4a06252fa25b9e

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 == 'trim': return d['draft'].strip()
    if event == 'exact': return d['draft'].strip().casefold() in [x.casefold() for x in d['labels']]
    if event == 'nonempty': return bool(d['draft'].strip())
    if event == 'permission': return d['allow']
    if event == 'busy': return not d['pending']
    if event == 'row-id': return 'create:'+d['draft'].strip()
    if event == 'resolve': return d['persisted']
    if event == 'failure': return {'draft':d['draft'],'error':d['error'],'pending':False}
    if event == 'pending-value': return None if d['pending'] else d['persisted']
    if event == 'retry': return {'text':d['draft'].strip(),'query_epoch':d['query_epoch']+1}
    return {'unchanged': True}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'draft':'  Plum  ','labels':['Pear','plum'],'allow':True,'pending':True,'temporary':'tmp:'+str(N),'persisted':'p'+str(N),'error':'rejected','query_epoch':N}
boundary = {'draft':'   ','labels':[],'allow':False,'pending':False,'temporary':'tmp:'+str(N),'persisted':'','error':None,'query_epoch':N}
check('normal trim', solve('trim', normal), 'Plum')
check('boundary trim', solve('trim', boundary), '')
check('normal exact', solve('exact', normal), True)
check('boundary exact', solve('exact', boundary), False)
check('normal nonempty', solve('nonempty', normal), True)
check('boundary nonempty', solve('nonempty', boundary), False)
check('normal permission', solve('permission', normal), True)
check('boundary permission', solve('permission', boundary), False)
check('normal busy', solve('busy', normal), False)
check('boundary busy', solve('busy', boundary), True)
check('normal row-id', solve('row-id', normal), 'create:Plum')
check('boundary row-id', solve('row-id', boundary), 'create:')
check('normal resolve', solve('resolve', normal), 'p'+str(N))
check('boundary resolve', solve('resolve', boundary), '')
check('normal failure', solve('failure', normal), {'draft':'  Plum  ','error':'rejected','pending':False})
check('boundary failure', solve('failure', boundary), {'draft':'   ','error':None,'pending':False})
check('normal pending-value', solve('pending-value', normal), None)
check('boundary pending-value', solve('pending-value', boundary), '')
check('normal retry', solve('retry', normal), {'text':'Plum','query_epoch':N+1})
check('boundary retry', solve('retry', boundary), {'text':'','query_epoch':N+1})
variant = dict(normal, **{'draft':' '*N+'Plum'+' '*N})
check('variant query or selection payload', solve('trim', variant), 'Plum')
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 trimPlumPlumPassed
boundary trimPassed
normal exactTrueTruePassed
boundary exactFalseFalsePassed
normal nonemptyTrueTruePassed
boundary nonemptyFalseFalsePassed
normal permissionTrueTruePassed
boundary permissionFalseFalsePassed
normal busyFalseFalsePassed
boundary busyTrueTruePassed
normal row-idcreate:Plumcreate:PlumPassed
boundary row-idcreate:create:Passed
normal resolvep1p1Passed
boundary resolvePassed
normal failure{'draft': ' Plum ', 'error': 'rejected', 'pending': False}{'draft': ' Plum ', 'error': 'rejected', 'pending': False}Passed
boundary failure{'draft': ' ', 'error': None, 'pending': False}{'draft': ' ', 'error': None, 'pending': False}Passed
normal pending-valueNoneNonePassed
boundary pending-valuePassed
normal retry{'query_epoch': 2, 'text': 'Plum'}{'query_epoch': 2, 'text': 'Plum'}Passed
boundary retry{'query_epoch': 2, 'text': ''}{'query_epoch': 2, 'text': ''}Passed
variant query or selection payloadPlumPlumPassed
unknown completion event{'unchanged': True}{'unchanged': True}Passed

SHA-256 / ab148b2290c7acae5f273912b13164d42e3ce97e9b9bae54067a9aa775b2c8c1

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

Case digest / 805614247f1cfd967513526d9e515bbc3e83c9bbe50fa861bc919b9454d05487