FA-8146 / Autocomplete interactions / Open access
Combobox keyboard commit: Clear erases query text but retains the submitted value · case 01
Clear erases query text but retains the submitted value.
ROOT CAUSE
The clear operation uses `(value, '', opened)` where the contract requires `(None, '', opened)`.
VERIFIED REPAIR
Implement the clear operation as `(None, '', opened)`.
Unsuccessful approach: Clearing the value without query leaves stale visible text.
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 opened and active in options: return (active, query, False)
if key == 'Tab': return (value, query, False)
if key == 'Clear': return (value, '', 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 | ['a', '', True] | [None, '', True] | Failed |
| 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 / b8264675cc63cdf648df3d861aa3179f2425a542fd71e9ecfceb819f88ae95aa
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 and active in options: return (active, query, False)
if key == 'Tab': return (value, query, False)
if key == 'Clear': return (None, query, 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, 'a', True] | [None, '', True] | Failed |
| 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 / 8c958852ef6fdd6ef98f19143a9989674c8674404c4d5fa6de0241277d09260e
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.887812+00:00.
Case digest / 56d1f24be56ce194d9b8744c74d7c1aa0ee55d30e1f08908af46e370ecc7db2e