FA-8361 / Keyboard accessibility / Open access
Grid-cell keyboard movement: Right arrows wrap instead of staying at the row edge · case 01
Right arrows wrap instead of staying at the row edge.
ROOT CAUSE
The right clamp operation uses `(column+1) % columns` where the contract requires `min(columns-1, column+1)`.
VERIFIED REPAIR
Implement the right clamp operation as `min(columns-1, column+1)`.
Unsuccessful approach: Clamping columns against row count fails nonsquare grids.
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 = (column+1) % columns
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, 0] | [1, 4] | Failed |
| 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 / 18d3ed069320510f31fe02da66e8d285b99fe7ba24f52ee13c5decb9b1847105
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(rows-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, 2] | [1, 4] | Failed |
| right step | [1, 2] | [1, 4] | Failed |
| 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 / d94e2c16bfd08838d8da329eed765028098886a3378da1442b2654c4a308aa91
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.778708+00:00.
Case digest / 7c92064a611bac53e3d9319ee99177a16017f2b5e4b9a8e2318bb8189fed4db9