FA-8076 / Client navigation / Open access
Browser-style history transitions: Forward navigates beyond the last entry · case 01
Forward navigates beyond the last entry.
ROOT CAUSE
The forward operation uses `index+1` where the contract requires `min(len(entries)-1, index+1)`.
VERIFIED REPAIR
Implement the forward operation as `min(len(entries)-1, index+1)`.
Unsuccessful approach: Clamping in the backward direction reverses traversal.
Case contract
Push truncates forward history and selects the new entry; replace retains stack length; back and forward clamp to existing entries; reload leaves history intact.
Why this case matters
A deterministic model of browser-style history transitions; 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(entries, index, action, url):
entries = list(entries)
if action == 'push': return (entries[:index+1] + [url], index+1)
if action == 'replace': entries[index] = url
elif action == 'back': index = max(0, index-1)
elif action == 'forward': index = index+1
elif action == 'reload': return (entries, index)
return (entries, index)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('branch', solve(['a','b','c'], 1, 'push', 'x'), (['a', 'b', 'x'], 2))
check('replace', solve(['a','b','c'], 1, 'replace', 'x'), (['a', 'x', 'c'], 1))
check('first back', solve(['a','b'], 0, 'back', None), (['a', 'b'], 0))
check('back', solve(['a','b'], 1, 'back', None), (['a', 'b'], 0))
check('last forward', solve(['a','b'], 1, 'forward', None), (['a', 'b'], 1))
check('forward', solve(['a','b'], 0, 'forward', None), (['a', 'b'], 1))
check('reload', solve(['a','b'], 1, 'reload', None), (['a', 'b'], 1))
check('parameterized push depth', solve(list(range(N+1)), N, 'push', N+1), (list(range(N+2)), N+1))
for repetition in range(N):
check('repeat reload', solve(['a','b'], 1, 'reload', None), (['a', 'b'], 1))
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 |
|---|---|---|---|
| branch | [['a', 'b', 'x'], 2] | [['a', 'b', 'x'], 2] | Passed |
| replace | [['a', 'x', 'c'], 1] | [['a', 'x', 'c'], 1] | Passed |
| first back | [['a', 'b'], 0] | [['a', 'b'], 0] | Passed |
| back | [['a', 'b'], 0] | [['a', 'b'], 0] | Passed |
| last forward | [['a', 'b'], 2] | [['a', 'b'], 1] | Failed |
| forward | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
| reload | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
| parameterized push depth | [[0, 1, 2], 2] | [[0, 1, 2], 2] | Passed |
| repeat reload | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
SHA-256 / 3b22b72316e8cdbbc8fbcab5cc54ac2c5e01ac3487496dc51fcc44515ea2c40f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(entries, index, action, url):
entries = list(entries)
if action == 'push': return (entries[:index+1] + [url], index+1)
if action == 'replace': entries[index] = url
elif action == 'back': index = max(0, index-1)
elif action == 'forward': index = max(0, index-1)
elif action == 'reload': return (entries, index)
return (entries, index)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('branch', solve(['a','b','c'], 1, 'push', 'x'), (['a', 'b', 'x'], 2))
check('replace', solve(['a','b','c'], 1, 'replace', 'x'), (['a', 'x', 'c'], 1))
check('first back', solve(['a','b'], 0, 'back', None), (['a', 'b'], 0))
check('back', solve(['a','b'], 1, 'back', None), (['a', 'b'], 0))
check('last forward', solve(['a','b'], 1, 'forward', None), (['a', 'b'], 1))
check('forward', solve(['a','b'], 0, 'forward', None), (['a', 'b'], 1))
check('reload', solve(['a','b'], 1, 'reload', None), (['a', 'b'], 1))
check('parameterized push depth', solve(list(range(N+1)), N, 'push', N+1), (list(range(N+2)), N+1))
for repetition in range(N):
check('repeat reload', solve(['a','b'], 1, 'reload', None), (['a', 'b'], 1))
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 |
|---|---|---|---|
| branch | [['a', 'b', 'x'], 2] | [['a', 'b', 'x'], 2] | Passed |
| replace | [['a', 'x', 'c'], 1] | [['a', 'x', 'c'], 1] | Passed |
| first back | [['a', 'b'], 0] | [['a', 'b'], 0] | Passed |
| back | [['a', 'b'], 0] | [['a', 'b'], 0] | Passed |
| last forward | [['a', 'b'], 0] | [['a', 'b'], 1] | Failed |
| forward | [['a', 'b'], 0] | [['a', 'b'], 1] | Failed |
| reload | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
| parameterized push depth | [[0, 1, 2], 2] | [[0, 1, 2], 2] | Passed |
| repeat reload | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
SHA-256 / e5e0454967d7ee7067405bd2941e0cd6906d153e81a5409f9cc64c2fcd2014c8
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(entries, index, action, url):
entries = list(entries)
if action == 'push': return (entries[:index+1] + [url], index+1)
if action == 'replace': entries[index] = url
elif action == 'back': index = max(0, index-1)
elif action == 'forward': index = min(len(entries)-1, index+1)
elif action == 'reload': return (entries, index)
return (entries, index)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('branch', solve(['a','b','c'], 1, 'push', 'x'), (['a', 'b', 'x'], 2))
check('replace', solve(['a','b','c'], 1, 'replace', 'x'), (['a', 'x', 'c'], 1))
check('first back', solve(['a','b'], 0, 'back', None), (['a', 'b'], 0))
check('back', solve(['a','b'], 1, 'back', None), (['a', 'b'], 0))
check('last forward', solve(['a','b'], 1, 'forward', None), (['a', 'b'], 1))
check('forward', solve(['a','b'], 0, 'forward', None), (['a', 'b'], 1))
check('reload', solve(['a','b'], 1, 'reload', None), (['a', 'b'], 1))
check('parameterized push depth', solve(list(range(N+1)), N, 'push', N+1), (list(range(N+2)), N+1))
for repetition in range(N):
check('repeat reload', solve(['a','b'], 1, 'reload', None), (['a', 'b'], 1))
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 |
|---|---|---|---|
| branch | [['a', 'b', 'x'], 2] | [['a', 'b', 'x'], 2] | Passed |
| replace | [['a', 'x', 'c'], 1] | [['a', 'x', 'c'], 1] | Passed |
| first back | [['a', 'b'], 0] | [['a', 'b'], 0] | Passed |
| back | [['a', 'b'], 0] | [['a', 'b'], 0] | Passed |
| last forward | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
| forward | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
| reload | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
| parameterized push depth | [[0, 1, 2], 2] | [[0, 1, 2], 2] | Passed |
| repeat reload | [['a', 'b'], 1] | [['a', 'b'], 1] | Passed |
SHA-256 / ae2d8629fe3d32dad11a0aff6c545e0bed36ad0e6822101b64aa837a9ba70618
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.055582+00:00.
Case digest / bd273b8c93173981c9f5e45aa5615e3bfc2ce61629b01c2fe91cfbbc94ff0110