FA-22601 / Autocomplete interactions / Open access
Recent accepted suggestions: recent choices from another picker scope appear in suggestions · case 01
The scope completion transition produces an incorrect observable state.
ROOT CAUSE
At recent-completions/scope, the implementation evaluates `d['history']` instead of preserving the specified completion transition.
VERIFIED REPAIR
Implement the scope contract using `d['history'] if d['scope']==d['entry_scope'] else []`.
Unsuccessful approach: The attempted repair uses `d['history'] if d['scope']!=d['entry_scope'] else []`, which still violates a normal or boundary completion fixture.
Case contract
Recent completions record explicit accepted identities in most-recent-first order, scoped to a picker. Preview and typed drafts do not enter history. Reacceptance moves an identity to the front, removal is identity-specific, and labels refresh without changing identity order. An oldest-first export resolves labels in reverse history order.
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 == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
if event == 'limit': return d['history'][:d['limit']]
if event == 'scope': return d['history']
if event == 'preview': return d['history']
if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
if event == 'empty-id': return [d['accepted']]
if event == 'query-source': return d['draft']
if event == 'clear': return {'history':[],'draft':d['draft']}
if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(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 record | ['b', 'a', 'c'] | ['b', 'a', 'c'] | Passed |
| boundary record | [''] | [''] | Passed |
| normal limit | ['a', 'b'] | ['a', 'b'] | Passed |
| boundary limit | [] | [] | Passed |
| normal scope | ['a', 'b', 'c'] | [] | Failed |
| boundary scope | [] | [] | Passed |
| normal preview | ['a', 'b', 'c'] | ['a', 'b', 'c'] | Passed |
| boundary preview | [] | [] | Passed |
| normal remove | ['a', 'c'] | ['a', 'c'] | Passed |
| boundary remove | [] | [] | Passed |
| normal rename | {'a': 'A', 'b': 'Bee', 'c': 'C'} | {'a': 'A', 'b': 'Bee', 'c': 'C'} | Passed |
| boundary rename | {'': ''} | {'': ''} | Passed |
| normal empty-id | ['b'] | ['b'] | Passed |
| boundary empty-id | [''] | [''] | Passed |
| normal query-source | be | be | Passed |
| boundary query-source | | | Passed |
| normal clear | {'draft': 'be', 'history': []} | {'draft': 'be', 'history': []} | Passed |
| boundary clear | {'draft': '', 'history': []} | {'draft': '', 'history': []} | Passed |
| normal oldest-first-export | ['C', 'Old B', 'A'] | ['C', 'Old B', 'A'] | Passed |
| boundary oldest-first-export | [] | [] | Passed |
| variant query or selection payload | ['id1'] | ['id1'] | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / d77d2fe91f7778f1cbb845270d8ab22c899845646cdc593dd3e8dca8a64b72bb
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 == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
if event == 'limit': return d['history'][:d['limit']]
if event == 'scope': return d['history'] if d['scope']!=d['entry_scope'] else []
if event == 'preview': return d['history']
if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
if event == 'empty-id': return [d['accepted']]
if event == 'query-source': return d['draft']
if event == 'clear': return {'history':[],'draft':d['draft']}
if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(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 record | ['b', 'a', 'c'] | ['b', 'a', 'c'] | Passed |
| boundary record | [''] | [''] | Passed |
| normal limit | ['a', 'b'] | ['a', 'b'] | Passed |
| boundary limit | [] | [] | Passed |
| normal scope | ['a', 'b', 'c'] | [] | Failed |
| boundary scope | [] | [] | Passed |
| normal preview | ['a', 'b', 'c'] | ['a', 'b', 'c'] | Passed |
| boundary preview | [] | [] | Passed |
| normal remove | ['a', 'c'] | ['a', 'c'] | Passed |
| boundary remove | [] | [] | Passed |
| normal rename | {'a': 'A', 'b': 'Bee', 'c': 'C'} | {'a': 'A', 'b': 'Bee', 'c': 'C'} | Passed |
| boundary rename | {'': ''} | {'': ''} | Passed |
| normal empty-id | ['b'] | ['b'] | Passed |
| boundary empty-id | [''] | [''] | Passed |
| normal query-source | be | be | Passed |
| boundary query-source | | | Passed |
| normal clear | {'draft': 'be', 'history': []} | {'draft': 'be', 'history': []} | Passed |
| boundary clear | {'draft': '', 'history': []} | {'draft': '', 'history': []} | Passed |
| normal oldest-first-export | ['C', 'Old B', 'A'] | ['C', 'Old B', 'A'] | Passed |
| boundary oldest-first-export | [] | [] | Passed |
| variant query or selection payload | ['id1'] | ['id1'] | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / a7437318c752dab769f4aa87585f81d6769429c751ec0609352b50471e54291f
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 == 'record': return [d['accepted']]+[x for x in d['history'] if x!=d['accepted']]
if event == 'limit': return d['history'][:d['limit']]
if event == 'scope': return d['history'] if d['scope']==d['entry_scope'] else []
if event == 'preview': return d['history']
if event == 'remove': return [x for x in d['history'] if x!=d['accepted']]
if event == 'rename': return dict(d['labels'], **{d['accepted']:d['new_label']})
if event == 'empty-id': return [d['accepted']]
if event == 'query-source': return d['draft']
if event == 'clear': return {'history':[],'draft':d['draft']}
if event == 'oldest-first-export': return [d['labels'].get(x,x) for x in reversed(d['history'])]
return {'unchanged': True}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
normal = {'history':['a','b','c'],'accepted':'b','draft':'be','preview':'p','scope':'fruit','entry_scope':'all','labels':{'a':'A','b':'Old B','c':'C'},'new_label':'Bee','limit':2,'epoch':N}
boundary = {'history':[],'accepted':'','draft':'','preview':None,'scope':'all','entry_scope':'all','labels':{},'new_label':'','limit':0,'epoch':N}
check('normal record', solve('record', normal), ['b','a','c'])
check('boundary record', solve('record', boundary), [''])
check('normal limit', solve('limit', normal), ['a','b'])
check('boundary limit', solve('limit', boundary), [])
check('normal scope', solve('scope', normal), [])
check('boundary scope', solve('scope', boundary), [])
check('normal preview', solve('preview', normal), ['a','b','c'])
check('boundary preview', solve('preview', boundary), [])
check('normal remove', solve('remove', normal), ['a','c'])
check('boundary remove', solve('remove', boundary), [])
check('normal rename', solve('rename', normal), {'a':'A','b':'Bee','c':'C'})
check('boundary rename', solve('rename', boundary), {'':''})
check('normal empty-id', solve('empty-id', normal), ['b'])
check('boundary empty-id', solve('empty-id', boundary), [''])
check('normal query-source', solve('query-source', normal), 'be')
check('boundary query-source', solve('query-source', boundary), '')
check('normal clear', solve('clear', normal), {'history':[],'draft':'be'})
check('boundary clear', solve('clear', boundary), {'history':[],'draft':''})
check('normal oldest-first-export', solve('oldest-first-export', normal), ['C','Old B','A'])
check('boundary oldest-first-export', solve('oldest-first-export', boundary), [])
variant = dict(normal, **{'accepted':'id'+str(N)})
check('variant query or selection payload', solve('empty-id', variant), ['id'+str(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 record | ['b', 'a', 'c'] | ['b', 'a', 'c'] | Passed |
| boundary record | [''] | [''] | Passed |
| normal limit | ['a', 'b'] | ['a', 'b'] | Passed |
| boundary limit | [] | [] | Passed |
| normal scope | [] | [] | Passed |
| boundary scope | [] | [] | Passed |
| normal preview | ['a', 'b', 'c'] | ['a', 'b', 'c'] | Passed |
| boundary preview | [] | [] | Passed |
| normal remove | ['a', 'c'] | ['a', 'c'] | Passed |
| boundary remove | [] | [] | Passed |
| normal rename | {'a': 'A', 'b': 'Bee', 'c': 'C'} | {'a': 'A', 'b': 'Bee', 'c': 'C'} | Passed |
| boundary rename | {'': ''} | {'': ''} | Passed |
| normal empty-id | ['b'] | ['b'] | Passed |
| boundary empty-id | [''] | [''] | Passed |
| normal query-source | be | be | Passed |
| boundary query-source | | | Passed |
| normal clear | {'draft': 'be', 'history': []} | {'draft': 'be', 'history': []} | Passed |
| boundary clear | {'draft': '', 'history': []} | {'draft': '', 'history': []} | Passed |
| normal oldest-first-export | ['C', 'Old B', 'A'] | ['C', 'Old B', 'A'] | Passed |
| boundary oldest-first-export | [] | [] | Passed |
| variant query or selection payload | ['id1'] | ['id1'] | Passed |
| unknown completion event | {'unchanged': True} | {'unchanged': True} | Passed |
SHA-256 / 9ac344a935f08a775a84e7a198e0d5ab8788025038c8d762283f46d706d12853
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.874408+00:00.
Case digest / 9012cdb7a7f1f3325277d2712203107193a724f62061aa6b1c829a6a3744ebbd