FA-23336 / Autocomplete interactions / Open access
Reopening a committed autocomplete: cancelling an edit reverts to an older selection label · case 01
The cancel-edit completion transition produces an incorrect observable state.
ROOT CAUSE
At completion-draft-history/cancel-edit, the implementation evaluates `{'value':d['value'],'draft':d['prior_label']}` instead of preserving the specified completion transition.
VERIFIED REPAIR
Implement the cancel-edit contract using `{'value':d['value'],'draft':d['label']}`.
Unsuccessful approach: The attempted repair uses `{'value':None,'draft':d['label']}`, which still violates a normal or boundary completion fixture.
Case contract
Reopening this editable picker starts from its committed label, keeps identity until text actually diverges, selects the whole label for replacement, and preserves explicit unresolved drafts on reopen. An accepted label is a baseline, not an automatic new search. Choosing edit mode invalidates old result context.
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 == 'initial-draft': return d['label']
if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
if event == 'selection': return [0,len(d['label'])]
if event == 'identity': return d['value']
if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
if event == 'baseline': return d['label']
if event == 'accepted-search': return not d['accepted']
if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
if event == 'cancel-edit': return {'value':d['value'],'draft':d['prior_label']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', variant), 'L'*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal initial-draft | Pear | Pear | Passed |
| boundary initial-draft | | | Passed |
| normal unresolved-draft | Peach | Peach | Passed |
| boundary unresolved-draft | | | Passed |
| normal selection | [0, 4] | [0, 4] | Passed |
| boundary selection | [0, 0] | [0, 0] | Passed |
| normal identity | p1 | p1 | Passed |
| boundary identity | | | Passed |
| normal diverged | None | None | Passed |
| boundary diverged | | | Passed |
| normal baseline | Pear | Pear | Passed |
| boundary baseline | | | Passed |
| normal accepted-search | False | False | Passed |
| boundary accepted-search | True | True | Passed |
| normal selection-baseline | {'baseline_id': 'p1', 'baseline_text': 'Pear'} | {'baseline_id': 'p1', 'baseline_text': 'Pear'} | Passed |
| boundary selection-baseline | {'baseline_id': '', 'baseline_text': ''} | {'baseline_id': '', 'baseline_text': ''} | Passed |
| normal accepted-baseline | False | False | Passed |
| boundary accepted-baseline | True | True | Passed |
| normal cancel-edit | {'draft': 'Plum', 'value': 'p1'} | {'draft': 'Pear', 'value': 'p1'} | Failed |
| boundary cancel-edit | {'draft': '', 'value': ''} | {'draft': '', 'value': ''} | Passed |
| variant query or selection payload | L | L | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / ddab42a51dee0724f8872805499b9f3532e9eb5d6ff37b6057b8336c4318ab5f
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 == 'initial-draft': return d['label']
if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
if event == 'selection': return [0,len(d['label'])]
if event == 'identity': return d['value']
if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
if event == 'baseline': return d['label']
if event == 'accepted-search': return not d['accepted']
if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
if event == 'cancel-edit': return {'value':None,'draft':d['label']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', variant), 'L'*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal initial-draft | Pear | Pear | Passed |
| boundary initial-draft | | | Passed |
| normal unresolved-draft | Peach | Peach | Passed |
| boundary unresolved-draft | | | Passed |
| normal selection | [0, 4] | [0, 4] | Passed |
| boundary selection | [0, 0] | [0, 0] | Passed |
| normal identity | p1 | p1 | Passed |
| boundary identity | | | Passed |
| normal diverged | None | None | Passed |
| boundary diverged | | | Passed |
| normal baseline | Pear | Pear | Passed |
| boundary baseline | | | Passed |
| normal accepted-search | False | False | Passed |
| boundary accepted-search | True | True | Passed |
| normal selection-baseline | {'baseline_id': 'p1', 'baseline_text': 'Pear'} | {'baseline_id': 'p1', 'baseline_text': 'Pear'} | Passed |
| boundary selection-baseline | {'baseline_id': '', 'baseline_text': ''} | {'baseline_id': '', 'baseline_text': ''} | Passed |
| normal accepted-baseline | False | False | Passed |
| boundary accepted-baseline | True | True | Passed |
| normal cancel-edit | {'draft': 'Pear', 'value': None} | {'draft': 'Pear', 'value': 'p1'} | Failed |
| boundary cancel-edit | {'draft': '', 'value': None} | {'draft': '', 'value': ''} | Failed |
| variant query or selection payload | L | L | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 3883d1f7d8fe08c9eab1cf27493cd629d6d903ca77c3c90f44f8f589acbb2121
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 == 'initial-draft': return d['label']
if event == 'unresolved-draft': return d['draft'] if d['unresolved'] else d['label']
if event == 'selection': return [0,len(d['label'])]
if event == 'identity': return d['value']
if event == 'diverged': return d['value'] if d['new_text']==d['label'] else None
if event == 'baseline': return d['label']
if event == 'accepted-search': return not d['accepted']
if event == 'selection-baseline': return {'baseline_id':d['value'],'baseline_text':d['label']}
if event == 'accepted-baseline': return not d['unresolved'] and d['draft']==d['label']
if event == 'cancel-edit': return {'value':d['value'],'draft':d['label']}
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'value':'p1','label':'Pear','draft':'Peach','unresolved':True,'last_query':'pe','active':'p2','epoch':N,'prior_label':'Plum','new_text':'Pear!','accepted':True}
boundary = {'value':'','label':'','draft':'','unresolved':False,'last_query':'','active':None,'epoch':N,'prior_label':'','new_text':'','accepted':False}
check('normal initial-draft', solve('initial-draft', normal), 'Pear')
check('boundary initial-draft', solve('initial-draft', boundary), '')
check('normal unresolved-draft', solve('unresolved-draft', normal), 'Peach')
check('boundary unresolved-draft', solve('unresolved-draft', boundary), '')
check('normal selection', solve('selection', normal), [0,4])
check('boundary selection', solve('selection', boundary), [0,0])
check('normal identity', solve('identity', normal), 'p1')
check('boundary identity', solve('identity', boundary), '')
check('normal diverged', solve('diverged', normal), None)
check('boundary diverged', solve('diverged', boundary), '')
check('normal baseline', solve('baseline', normal), 'Pear')
check('boundary baseline', solve('baseline', boundary), '')
check('normal accepted-search', solve('accepted-search', normal), False)
check('boundary accepted-search', solve('accepted-search', boundary), True)
check('normal selection-baseline', solve('selection-baseline', normal), {'baseline_id':'p1','baseline_text':'Pear'})
check('boundary selection-baseline', solve('selection-baseline', boundary), {'baseline_id':'','baseline_text':''})
check('normal accepted-baseline', solve('accepted-baseline', normal), False)
check('boundary accepted-baseline', solve('accepted-baseline', boundary), True)
check('normal cancel-edit', solve('cancel-edit', normal), {'value':'p1','draft':'Pear'})
check('boundary cancel-edit', solve('cancel-edit', boundary), {'value':'','draft':''})
variant = dict(normal, **{'label':'L'*N})
check('variant query or selection payload', solve('initial-draft', variant), 'L'*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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| normal initial-draft | Pear | Pear | Passed |
| boundary initial-draft | | | Passed |
| normal unresolved-draft | Peach | Peach | Passed |
| boundary unresolved-draft | | | Passed |
| normal selection | [0, 4] | [0, 4] | Passed |
| boundary selection | [0, 0] | [0, 0] | Passed |
| normal identity | p1 | p1 | Passed |
| boundary identity | | | Passed |
| normal diverged | None | None | Passed |
| boundary diverged | | | Passed |
| normal baseline | Pear | Pear | Passed |
| boundary baseline | | | Passed |
| normal accepted-search | False | False | Passed |
| boundary accepted-search | True | True | Passed |
| normal selection-baseline | {'baseline_id': 'p1', 'baseline_text': 'Pear'} | {'baseline_id': 'p1', 'baseline_text': 'Pear'} | Passed |
| boundary selection-baseline | {'baseline_id': '', 'baseline_text': ''} | {'baseline_id': '', 'baseline_text': ''} | Passed |
| normal accepted-baseline | False | False | Passed |
| boundary accepted-baseline | True | True | Passed |
| normal cancel-edit | {'draft': 'Pear', 'value': 'p1'} | {'draft': 'Pear', 'value': 'p1'} | Passed |
| boundary cancel-edit | {'draft': '', 'value': ''} | {'draft': '', 'value': ''} | Passed |
| variant query or selection payload | L | L | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / be5ffa225c596427564827f646686989bf021696522ebbee47d502a5de83c8eb
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:46.707763+00:00.
Case digest / b9bcb03590341c67cc70b61af322a25cc792b52b07275017b29c3640331f7b77