FA-7886 / Keyboard accessibility / Open access
Roving tabindex navigation: End fails to reach the last enabled item · case 01
End fails to reach the last enabled item.
ROOT CAUSE
The end operation uses `if key == 'End': return current` where the contract requires `if key == 'End': return enabled[-1]`.
VERIFIED REPAIR
Implement the end operation as `if key == 'End': return enabled[-1]`.
Unsuccessful approach: Routing End to the first item swaps endpoint semantics.
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 current
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 | 3 | 7 | Failed |
| 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 / 401d526fd126508fa204184d927420a0103bc1add829632e5e7c30734d92e132
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[0]
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 | 1 | 7 | Failed |
| 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 / b157e83158d0328c7e2a7ca326ae1685ff22726066d5b4740eb9c057bba1762e
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.178046+00:00.
Case digest / e184240391d6d2559d98c1f0b0895ff70fdca07fc0d7ebd38fe8210a9f253166