FA-8661 / Client navigation / Open access
Navigation active-link matching: A link ending in slash fails to match the same route · case 01
A link ending in slash fails to match the same route.
ROOT CAUSE
The link trailing slash operation uses `link` where the contract requires `link.rstrip('/') or '/'`.
VERIFIED REPAIR
Implement the link trailing slash operation as `link.rstrip('/') or '/'`.
Unsuccessful approach: Removing the root slash turns the root into an empty path.
Case contract
Ignore URL query and fragment; normalize trailing slashes with root preserved; honor case policy; section matches require a slash boundary and root matches exactly.
Why this case matters
A deterministic model of navigation active-link matching; 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(path, link, exact, case_sensitive):
path = path.split('?', 1)[0].split('#', 1)[0]
link = link
path = path.rstrip('/') or '/'
if not case_sensitive: path, link = path.casefold(), link.casefold()
if exact or link == '/': return path == link
return path == link or path.startswith(link + '/')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('query', solve('/docs?x=1', '/docs', True, True), True)
check('fragment', solve('/docs#intro', '/docs', True, True), True)
check('slash', solve('/docs', '/docs/', True, True), True)
check('root', solve('/docs', '/', False, True), False)
check('root itself', solve('/', '/', True, True), True)
check('fold', solve("/DOCS", "/docs", True, False), True)
check('sensitive', solve("/DOCS", "/docs", True, True), False)
check('child', solve('/docs/a', '/docs', False, True), True)
check('prefix sibling', solve('/docstring', '/docs', False, True), False)
check('parameterized route segment', solve('/section'+str(N)+'/child','/section'+str(N),False,True), True)
for repetition in range(N):
check('repeat prefix sibling', solve('/docstring', '/docs', False, True), False)
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 |
|---|---|---|---|
| query | True | True | Passed |
| fragment | True | True | Passed |
| slash | False | True | Failed |
| root | False | False | Passed |
| root itself | True | True | Passed |
| fold | True | True | Passed |
| sensitive | False | False | Passed |
| child | True | True | Passed |
| prefix sibling | False | False | Passed |
| parameterized route segment | True | True | Passed |
| repeat prefix sibling | False | False | Passed |
SHA-256 / 81ee00c994ab7a572f4807f399d18ebfefd065de1ec8e5acf05885aaea40d349
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(path, link, exact, case_sensitive):
path = path.split('?', 1)[0].split('#', 1)[0]
link = link.rstrip('/')
path = path.rstrip('/') or '/'
if not case_sensitive: path, link = path.casefold(), link.casefold()
if exact or link == '/': return path == link
return path == link or path.startswith(link + '/')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('query', solve('/docs?x=1', '/docs', True, True), True)
check('fragment', solve('/docs#intro', '/docs', True, True), True)
check('slash', solve('/docs', '/docs/', True, True), True)
check('root', solve('/docs', '/', False, True), False)
check('root itself', solve('/', '/', True, True), True)
check('fold', solve("/DOCS", "/docs", True, False), True)
check('sensitive', solve("/DOCS", "/docs", True, True), False)
check('child', solve('/docs/a', '/docs', False, True), True)
check('prefix sibling', solve('/docstring', '/docs', False, True), False)
check('parameterized route segment', solve('/section'+str(N)+'/child','/section'+str(N),False,True), True)
for repetition in range(N):
check('repeat prefix sibling', solve('/docstring', '/docs', False, True), False)
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 |
|---|---|---|---|
| query | True | True | Passed |
| fragment | True | True | Passed |
| slash | True | True | Passed |
| root | True | False | Failed |
| root itself | False | True | Failed |
| fold | True | True | Passed |
| sensitive | False | False | Passed |
| child | True | True | Passed |
| prefix sibling | False | False | Passed |
| parameterized route segment | True | True | Passed |
| repeat prefix sibling | False | False | Passed |
SHA-256 / c4abef33f927d98d49de26c02b766fcddff88c3947d3bb3b0c4b843d65b4d821
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(path, link, exact, case_sensitive):
path = path.split('?', 1)[0].split('#', 1)[0]
link = link.rstrip('/') or '/'
path = path.rstrip('/') or '/'
if not case_sensitive: path, link = path.casefold(), link.casefold()
if exact or link == '/': return path == link
return path == link or path.startswith(link + '/')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('query', solve('/docs?x=1', '/docs', True, True), True)
check('fragment', solve('/docs#intro', '/docs', True, True), True)
check('slash', solve('/docs', '/docs/', True, True), True)
check('root', solve('/docs', '/', False, True), False)
check('root itself', solve('/', '/', True, True), True)
check('fold', solve("/DOCS", "/docs", True, False), True)
check('sensitive', solve("/DOCS", "/docs", True, True), False)
check('child', solve('/docs/a', '/docs', False, True), True)
check('prefix sibling', solve('/docstring', '/docs', False, True), False)
check('parameterized route segment', solve('/section'+str(N)+'/child','/section'+str(N),False,True), True)
for repetition in range(N):
check('repeat prefix sibling', solve('/docstring', '/docs', False, True), False)
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 |
|---|---|---|---|
| query | True | True | Passed |
| fragment | True | True | Passed |
| slash | True | True | Passed |
| root | False | False | Passed |
| root itself | True | True | Passed |
| fold | True | True | Passed |
| sensitive | False | False | Passed |
| child | True | True | Passed |
| prefix sibling | False | False | Passed |
| parameterized route segment | True | True | Passed |
| repeat prefix sibling | False | False | Passed |
SHA-256 / 5f4fba5b804be1fd36d31301a615d617455f49d9f15a48c72b61e31b818c9a6b
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:23.250758+00:00.
Case digest / a09047cf30a3ec4cfb823d5217c1cb1e125c2760af75e38495042944565b3fbe