FA-8676 / Client navigation / Open access
Navigation active-link matching: Sibling prefixes mark unrelated navigation items active · case 01
Sibling prefixes mark unrelated navigation items active.
ROOT CAUSE
The segment operation uses `path.startswith(link)` where the contract requires `path.startswith(link + '/')`.
VERIFIED REPAIR
Implement the segment operation as `path.startswith(link + '/')`.
Unsuccessful approach: Substring matching also activates nested unrelated segment names.
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.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 | True | False | Failed |
| parameterized route segment | True | True | Passed |
| repeat prefix sibling | True | False | Failed |
SHA-256 / ee64f88d5b7f9d5e44d6bd53c93087bb51b8156baac29ea7b33a2c06116d4302
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('/') 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 link in path
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 | True | False | Failed |
| parameterized route segment | True | True | Passed |
| repeat prefix sibling | True | False | Failed |
SHA-256 / 2965d05e45eb5ad29245c5956cb9343830832df57e47b10cec642a7da2e5ea00
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.444198+00:00.
Case digest / abc5128f2c0eb77c526ad4cd7829a6c87571d891f4c7df7c913142c84575134d