FAILURE MAP
← Case archive

FA-8056 / Client navigation / Open access

Browser-style history transitions: Push preserves a forward branch after navigating back · case 01

Push preserves a forward branch after navigating back.

Verified by executionVariant 1 · 9 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The push branch operation uses `entries + [url]` where the contract requires `entries[:index+1] + [url]`.

VERIFIED REPAIR

Implement the push branch operation as `entries[:index+1] + [url]`.

Unsuccessful approach: Truncating at the current entry removes the current page.

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 + [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 fixtureActualExpectedOutcome
branch[['a', 'b', 'c', 'x'], 2][['a', 'b', 'x'], 2]Failed
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 / 2c925545f4a379b5b0ba92a999574025901f0565c25a4e5b656cd7e5148d1c92

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] + [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 fixtureActualExpectedOutcome
branch[['a', 'x'], 2][['a', 'b', 'x'], 2]Failed
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, 2], 2][[0, 1, 2], 2]Failed
repeat reload[['a', 'b'], 1][['a', 'b'], 1]Passed

SHA-256 / fa342eb9459c7299a0dd8196415bb7661bd3939680679e2c411a48af96680614

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 fixtureActualExpectedOutcome
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:17.785854+00:00.

Case digest / cb146be2a4ef41e822010d2e09fb614ed306c9c1bbb2a502bb756d36407b3f60