FA-8136 / Autocomplete interactions / Open access
Combobox keyboard commit: Enter commits a stale active suggestion while the popup is closed · case 01
Enter commits a stale active suggestion while the popup is closed.
ROOT CAUSE
The closed enter operation uses `and active in options` where the contract requires `and opened and active in options`.
VERIFIED REPAIR
Implement the closed enter operation as `and opened and active in options`.
Unsuccessful approach: Checking openness alone allows committing a removed suggestion.
Case contract
Escape discards query but preserves committed value; Enter commits only an existing active option in an open popup; Tab closes without commit; Clear resets both; typing opens suggestions.
Why this case matters
A deterministic model of combobox keyboard commit; this isolates one interface invariant without requiring a browser.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(options, active, value, query, opened, key):
if key == 'Escape': return (value, '', False)
if key == 'Enter' and active in options: return (active, query, False)
if key == 'Tab': return (value, query, False)
if key == 'Clear': return (None, '', opened)
if key == 'Input': return (value, query, True)
return (value, query, opened)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('escape', solve(['a','b'], 'b', 'a', 'b', True, 'Escape'), ('a', '', False))
check('closed enter', solve(['a','b'], 'b', 'a', 'b', False, 'Enter'), ('a', 'b', False))
check('removed active', solve(['a'], 'b', 'a', 'b', True, 'Enter'), ('a', 'b', True))
check('commit', solve(['a','b'], 'b', 'a', 'b', True, 'Enter'), ('b', 'b', False))
check('tab', solve(['a','b'], 'b', 'a', 'b', True, 'Tab'), ('a', 'b', False))
check('clear', solve(['a'], 'a', 'a', 'a', True, 'Clear'), (None, '', True))
check('typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
check('parameterized suggestion', solve(list(range(N+1)), N, 0, str(N), True, 'Enter'), (N,str(N),False))
for repetition in range(N):
check('repeat typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', 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 |
|---|---|---|---|
| escape | ['a', '', False] | ['a', '', False] | Passed |
| closed enter | ['b', 'b', False] | ['a', 'b', False] | Failed |
| removed active | ['a', 'b', True] | ['a', 'b', True] | Passed |
| commit | ['b', 'b', False] | ['b', 'b', False] | Passed |
| tab | ['a', 'b', False] | ['a', 'b', False] | Passed |
| clear | [None, '', True] | [None, '', True] | Passed |
| typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
| parameterized suggestion | [1, '1', False] | [1, '1', False] | Passed |
| repeat typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
SHA-256 / ec17c239b6c5e3b9355cd9f78207e2951bc7584df4bc13caf76deedccdc1c91a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(options, active, value, query, opened, key):
if key == 'Escape': return (value, '', False)
if key == 'Enter' and opened: return (active, query, False)
if key == 'Tab': return (value, query, False)
if key == 'Clear': return (None, '', opened)
if key == 'Input': return (value, query, True)
return (value, query, opened)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('escape', solve(['a','b'], 'b', 'a', 'b', True, 'Escape'), ('a', '', False))
check('closed enter', solve(['a','b'], 'b', 'a', 'b', False, 'Enter'), ('a', 'b', False))
check('removed active', solve(['a'], 'b', 'a', 'b', True, 'Enter'), ('a', 'b', True))
check('commit', solve(['a','b'], 'b', 'a', 'b', True, 'Enter'), ('b', 'b', False))
check('tab', solve(['a','b'], 'b', 'a', 'b', True, 'Tab'), ('a', 'b', False))
check('clear', solve(['a'], 'a', 'a', 'a', True, 'Clear'), (None, '', True))
check('typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
check('parameterized suggestion', solve(list(range(N+1)), N, 0, str(N), True, 'Enter'), (N,str(N),False))
for repetition in range(N):
check('repeat typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', 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 |
|---|---|---|---|
| escape | ['a', '', False] | ['a', '', False] | Passed |
| closed enter | ['a', 'b', False] | ['a', 'b', False] | Passed |
| removed active | ['b', 'b', False] | ['a', 'b', True] | Failed |
| commit | ['b', 'b', False] | ['b', 'b', False] | Passed |
| tab | ['a', 'b', False] | ['a', 'b', False] | Passed |
| clear | [None, '', True] | [None, '', True] | Passed |
| typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
| parameterized suggestion | [1, '1', False] | [1, '1', False] | Passed |
| repeat typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
SHA-256 / 7cd9bcfcdcd3eb9cb06929851b1bd04fcad50d8534f801b2f2172f0dd922ccdc
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(options, active, value, query, opened, key):
if key == 'Escape': return (value, '', False)
if key == 'Enter' and opened and active in options: return (active, query, False)
if key == 'Tab': return (value, query, False)
if key == 'Clear': return (None, '', opened)
if key == 'Input': return (value, query, True)
return (value, query, opened)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('escape', solve(['a','b'], 'b', 'a', 'b', True, 'Escape'), ('a', '', False))
check('closed enter', solve(['a','b'], 'b', 'a', 'b', False, 'Enter'), ('a', 'b', False))
check('removed active', solve(['a'], 'b', 'a', 'b', True, 'Enter'), ('a', 'b', True))
check('commit', solve(['a','b'], 'b', 'a', 'b', True, 'Enter'), ('b', 'b', False))
check('tab', solve(['a','b'], 'b', 'a', 'b', True, 'Tab'), ('a', 'b', False))
check('clear', solve(['a'], 'a', 'a', 'a', True, 'Clear'), (None, '', True))
check('typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', True))
check('parameterized suggestion', solve(list(range(N+1)), N, 0, str(N), True, 'Enter'), (N,str(N),False))
for repetition in range(N):
check('repeat typing', solve(['a'], 'a', 'a', 'b', False, 'Input'), ('a', 'b', 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 |
|---|---|---|---|
| escape | ['a', '', False] | ['a', '', False] | Passed |
| closed enter | ['a', 'b', False] | ['a', 'b', False] | Passed |
| removed active | ['a', 'b', True] | ['a', 'b', True] | Passed |
| commit | ['b', 'b', False] | ['b', 'b', False] | Passed |
| tab | ['a', 'b', False] | ['a', 'b', False] | Passed |
| clear | [None, '', True] | [None, '', True] | Passed |
| typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
| parameterized suggestion | [1, '1', False] | [1, '1', False] | Passed |
| repeat typing | ['a', 'b', True] | ['a', 'b', True] | Passed |
SHA-256 / 27fd573a100cd9f334d842986b2fda43037577f50f135b310d544acb9f6e7cab
Verification & scope
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:38:18.683996+00:00.
Case digest / a824dd237ab7af1998ff527a3f71b5d7ffe2eea172a0581c254b14fa4d859020