FA-8671 / Client navigation / Open access
Navigation active-link matching: Root links become active on every descendant route · case 01
Root links become active on every descendant route.
ROOT CAUSE
The root operation uses `if exact or link == '/': return path.startswith(link)` where the contract requires `if exact or link == '/': return path == link`.
VERIFIED REPAIR
Implement the root operation as `if exact or link == '/': return path == link`.
Unsuccessful approach: Always exact matching prevents section links on descendants.
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.startswith(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 | 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 / 1f84bb6ec7672c37dddac50d6a1409368a41398d87fb723c470f180058545d60
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 True: 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 | False | True | Failed |
| prefix sibling | False | False | Passed |
| parameterized route segment | False | True | Failed |
| repeat prefix sibling | False | False | Passed |
SHA-256 / 498f4d4ca3beff71424bf80d4dc56c11372d8ff6cf3862aefb6e5bb6921a5142
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.330864+00:00.
Case digest / da08355a7fade2c24536527935db608e21faad0111e58665fc478417d8553482