FA-7896 / Keyboard accessibility / Open access
Roving tabindex navigation: Removed active items remain the navigation target · case 01
Removed active items remain the navigation target.
ROOT CAUSE
The missing operation uses `if current not in enabled: return current` where the contract requires `if current not in enabled: return enabled[0]`.
VERIFIED REPAIR
Implement the missing operation as `if current not in enabled: return enabled[0]`.
Unsuccessful approach: Falling back to the last item violates initial focus policy.
Case contract
Home and End select enabled endpoints; horizontal arrows honor directionality and wrap; a removed current item resets to the first enabled item.
Why this case matters
A deterministic model of roving tabindex navigation; 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(enabled, current, key, rtl):
if not enabled: return None
if key == 'Home': return enabled[0]
if key == 'End': return enabled[-1]
step = (-1 if key == 'Left' else 1) * (-1 if rtl else 1)
if current not in enabled: return current
return enabled[(enabled.index(current) + step) % len(enabled)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('home', solve([1,3,7], 3, 'Home', False), 1)
check('end', solve([1,3,7], 3, 'End', False), 7)
check('rtl right', solve([1,3,7], 3, 'Right', True), 1)
check('ltr right', solve([1,3,7], 3, 'Right', False), 7)
check('removed', solve([1,3,7], 8, 'Right', False), 1)
check('wrap', solve([1,3,7], 7, 'Right', False), 1)
check('empty', solve([], 0, 'Home', False), None)
check('parameterized arrow', solve(list(range(N+3)), N, 'Right', False), N+1)
for repetition in range(N):
check('repeat empty', solve([], 0, 'Home', False), None)
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 |
|---|---|---|---|
| home | 1 | 1 | Passed |
| end | 7 | 7 | Passed |
| rtl right | 1 | 1 | Passed |
| ltr right | 7 | 7 | Passed |
| removed | 8 | 1 | Failed |
| wrap | 1 | 1 | Passed |
| empty | None | None | Passed |
| parameterized arrow | 2 | 2 | Passed |
| repeat empty | None | None | Passed |
SHA-256 / 1e5c1165d47742bf12980e8f3fb082afe94b1648962519ce2315ffe5840a852f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(enabled, current, key, rtl):
if not enabled: return None
if key == 'Home': return enabled[0]
if key == 'End': return enabled[-1]
step = (-1 if key == 'Left' else 1) * (-1 if rtl else 1)
if current not in enabled: return enabled[-1]
return enabled[(enabled.index(current) + step) % len(enabled)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('home', solve([1,3,7], 3, 'Home', False), 1)
check('end', solve([1,3,7], 3, 'End', False), 7)
check('rtl right', solve([1,3,7], 3, 'Right', True), 1)
check('ltr right', solve([1,3,7], 3, 'Right', False), 7)
check('removed', solve([1,3,7], 8, 'Right', False), 1)
check('wrap', solve([1,3,7], 7, 'Right', False), 1)
check('empty', solve([], 0, 'Home', False), None)
check('parameterized arrow', solve(list(range(N+3)), N, 'Right', False), N+1)
for repetition in range(N):
check('repeat empty', solve([], 0, 'Home', False), None)
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 |
|---|---|---|---|
| home | 1 | 1 | Passed |
| end | 7 | 7 | Passed |
| rtl right | 1 | 1 | Passed |
| ltr right | 7 | 7 | Passed |
| removed | 7 | 1 | Failed |
| wrap | 1 | 1 | Passed |
| empty | None | None | Passed |
| parameterized arrow | 2 | 2 | Passed |
| repeat empty | None | None | Passed |
SHA-256 / 1d6efff117616975282e4e5591bb2c9bff55aa0bd9e65d49e3da12fd3dfb340c
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(enabled, current, key, rtl):
if not enabled: return None
if key == 'Home': return enabled[0]
if key == 'End': return enabled[-1]
step = (-1 if key == 'Left' else 1) * (-1 if rtl else 1)
if current not in enabled: return enabled[0]
return enabled[(enabled.index(current) + step) % len(enabled)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('home', solve([1,3,7], 3, 'Home', False), 1)
check('end', solve([1,3,7], 3, 'End', False), 7)
check('rtl right', solve([1,3,7], 3, 'Right', True), 1)
check('ltr right', solve([1,3,7], 3, 'Right', False), 7)
check('removed', solve([1,3,7], 8, 'Right', False), 1)
check('wrap', solve([1,3,7], 7, 'Right', False), 1)
check('empty', solve([], 0, 'Home', False), None)
check('parameterized arrow', solve(list(range(N+3)), N, 'Right', False), N+1)
for repetition in range(N):
check('repeat empty', solve([], 0, 'Home', False), None)
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 |
|---|---|---|---|
| home | 1 | 1 | Passed |
| end | 7 | 7 | Passed |
| rtl right | 1 | 1 | Passed |
| ltr right | 7 | 7 | Passed |
| removed | 1 | 1 | Passed |
| wrap | 1 | 1 | Passed |
| empty | None | None | Passed |
| parameterized arrow | 2 | 2 | Passed |
| repeat empty | None | None | Passed |
SHA-256 / e682b0bd63403014ba0e32c92b4cff3ac8d294f86c791f9d2b91ae33a2741024
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:16.219159+00:00.
Case digest / 703aa7ca9ee1671125f981da59cbf09e7233efaf5ab02c30c4b4193dc1fc9c42