FA-8371 / Keyboard accessibility / Open access
Grid-cell keyboard movement: Home unexpectedly jumps to the first grid row · case 01
Home unexpectedly jumps to the first grid row.
ROOT CAUSE
The home modifier operation uses `row = 0` where the contract requires `row = 0 if ctrl else row`.
VERIFIED REPAIR
Implement the home modifier operation as `row = 0 if ctrl else row`.
Unsuccessful approach: Never updating the row makes Control-Home fail.
Case contract
Arrow keys move one cell and clamp without wrapping; Home/End target row edges; Control additionally targets the first/last row.
Why this case matters
A deterministic model of grid-cell keyboard movement; 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(rows, columns, row, column, key, ctrl):
if key == 'Left': column = max(0, column-1)
elif key == 'Right': column = min(columns-1, column+1)
elif key == 'Up': row = max(0, row-1)
elif key == 'Down': row = min(rows-1, row+1)
elif key == 'Home': column = 0; row = 0
elif key == 'End': column = columns-1; row = rows-1 if ctrl else row
return (row, column)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left boundary', solve(3, 5, 1, 0, 'Left', False), (1, 0))
check('left step', solve(3, 5, 1, 3, 'Left', False), (1, 2))
check('right boundary', solve(3, 5, 1, 4, 'Right', False), (1, 4))
check('right step', solve(3, 5, 1, 3, 'Right', False), (1, 4))
check('up', solve(3, 5, 1, 3, 'Up', False), (0, 3))
check('home', solve(3, 5, 1, 3, 'Home', False), (1, 0))
check('ctrl home', solve(3, 5, 1, 3, 'Home', True), (0, 0))
check('end', solve(3, 5, 1, 3, 'End', False), (1, 4))
check('ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
check('parameterized grid shape', solve(N+2,N+3,N,N,'Right',False), (N,N+1))
for repetition in range(N):
check('repeat ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
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 |
|---|---|---|---|
| left boundary | [1, 0] | [1, 0] | Passed |
| left step | [1, 2] | [1, 2] | Passed |
| right boundary | [1, 4] | [1, 4] | Passed |
| right step | [1, 4] | [1, 4] | Passed |
| up | [0, 3] | [0, 3] | Passed |
| home | [0, 0] | [1, 0] | Failed |
| ctrl home | [0, 0] | [0, 0] | Passed |
| end | [1, 4] | [1, 4] | Passed |
| ctrl end | [2, 4] | [2, 4] | Passed |
| parameterized grid shape | [1, 2] | [1, 2] | Passed |
| repeat ctrl end | [2, 4] | [2, 4] | Passed |
SHA-256 / e5d40e21a3f9f750495f95b34784bd1bdfe12b8087df479b98a76f4bd0c72126
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, columns, row, column, key, ctrl):
if key == 'Left': column = max(0, column-1)
elif key == 'Right': column = min(columns-1, column+1)
elif key == 'Up': row = max(0, row-1)
elif key == 'Down': row = min(rows-1, row+1)
elif key == 'Home': column = 0; row = row
elif key == 'End': column = columns-1; row = rows-1 if ctrl else row
return (row, column)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left boundary', solve(3, 5, 1, 0, 'Left', False), (1, 0))
check('left step', solve(3, 5, 1, 3, 'Left', False), (1, 2))
check('right boundary', solve(3, 5, 1, 4, 'Right', False), (1, 4))
check('right step', solve(3, 5, 1, 3, 'Right', False), (1, 4))
check('up', solve(3, 5, 1, 3, 'Up', False), (0, 3))
check('home', solve(3, 5, 1, 3, 'Home', False), (1, 0))
check('ctrl home', solve(3, 5, 1, 3, 'Home', True), (0, 0))
check('end', solve(3, 5, 1, 3, 'End', False), (1, 4))
check('ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
check('parameterized grid shape', solve(N+2,N+3,N,N,'Right',False), (N,N+1))
for repetition in range(N):
check('repeat ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
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 |
|---|---|---|---|
| left boundary | [1, 0] | [1, 0] | Passed |
| left step | [1, 2] | [1, 2] | Passed |
| right boundary | [1, 4] | [1, 4] | Passed |
| right step | [1, 4] | [1, 4] | Passed |
| up | [0, 3] | [0, 3] | Passed |
| home | [1, 0] | [1, 0] | Passed |
| ctrl home | [1, 0] | [0, 0] | Failed |
| end | [1, 4] | [1, 4] | Passed |
| ctrl end | [2, 4] | [2, 4] | Passed |
| parameterized grid shape | [1, 2] | [1, 2] | Passed |
| repeat ctrl end | [2, 4] | [2, 4] | Passed |
SHA-256 / dc8f7c4c3001b37fa58ebf39f8cb6c24a1ce53b7d01fb2d497a5af96cdde3857
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, columns, row, column, key, ctrl):
if key == 'Left': column = max(0, column-1)
elif key == 'Right': column = min(columns-1, column+1)
elif key == 'Up': row = max(0, row-1)
elif key == 'Down': row = min(rows-1, row+1)
elif key == 'Home': column = 0; row = 0 if ctrl else row
elif key == 'End': column = columns-1; row = rows-1 if ctrl else row
return (row, column)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left boundary', solve(3, 5, 1, 0, 'Left', False), (1, 0))
check('left step', solve(3, 5, 1, 3, 'Left', False), (1, 2))
check('right boundary', solve(3, 5, 1, 4, 'Right', False), (1, 4))
check('right step', solve(3, 5, 1, 3, 'Right', False), (1, 4))
check('up', solve(3, 5, 1, 3, 'Up', False), (0, 3))
check('home', solve(3, 5, 1, 3, 'Home', False), (1, 0))
check('ctrl home', solve(3, 5, 1, 3, 'Home', True), (0, 0))
check('end', solve(3, 5, 1, 3, 'End', False), (1, 4))
check('ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
check('parameterized grid shape', solve(N+2,N+3,N,N,'Right',False), (N,N+1))
for repetition in range(N):
check('repeat ctrl end', solve(3, 5, 1, 3, 'End', True), (2, 4))
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 |
|---|---|---|---|
| left boundary | [1, 0] | [1, 0] | Passed |
| left step | [1, 2] | [1, 2] | Passed |
| right boundary | [1, 4] | [1, 4] | Passed |
| right step | [1, 4] | [1, 4] | Passed |
| up | [0, 3] | [0, 3] | Passed |
| home | [1, 0] | [1, 0] | Passed |
| ctrl home | [0, 0] | [0, 0] | Passed |
| end | [1, 4] | [1, 4] | Passed |
| ctrl end | [2, 4] | [2, 4] | Passed |
| parameterized grid shape | [1, 2] | [1, 2] | Passed |
| repeat ctrl end | [2, 4] | [2, 4] | Passed |
SHA-256 / 08124ba6b65cc3f2bd3bca53c5632ac0f44721143cf2998bf0c58251541957cb
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:20.783083+00:00.
Case digest / eb89220f709c5676d1d61716c9ea2a0bcf83c4c191750d648e8cc0d9807b64c2