FA-6771 / HTTP caching / Open access
Cache key retains query but discards fragment · case 01
Cache key retains query but discards fragment.
ROOT CAUSE
The faulty implementation uses `url` for the cache-key-retains-query-but-discards-fragment decision.
VERIFIED REPAIR
Apply the explicit cache-key-retains-query-but-discards-fragment contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `url.split('?',1)[0].split('#',1)[0]` and still violates a separate fixture.
Case contract
Bounded offline decision model: cache key retains query but discards fragment. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.
Why this case matters
This deterministic http caching model isolates the cache-key-retains-query-but-discards-fragment policy at a network component boundary.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(url):
return url
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a?q=1#x'), '/a?q=1')", "check('fixture 2', solve('/a?q=2'), '/a?q=2')", "check('fixture 3', solve('/a#x'), '/a')", "check('fixture 4', solve('/a'), '/a')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
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 |
|---|---|---|---|
| fixture 2 | /a?q=2 | /a?q=2 | Passed |
| fixture 3 | /a#x | /a | Failed |
| fixture 4 | /a | /a | Passed |
| fixture 1 | /a?q=1#x | /a?q=1 | Failed |
SHA-256 / b25b8e8ab96a651a8efbf461104bf649c6e5d7db1adbe06c623c77602a5239ba
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(url):
return url.split('?',1)[0].split('#',1)[0]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a?q=1#x'), '/a?q=1')", "check('fixture 2', solve('/a?q=2'), '/a?q=2')", "check('fixture 3', solve('/a#x'), '/a')", "check('fixture 4', solve('/a'), '/a')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
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 |
|---|---|---|---|
| fixture 2 | /a | /a?q=2 | Failed |
| fixture 3 | /a | /a | Passed |
| fixture 4 | /a | /a | Passed |
| fixture 1 | /a | /a?q=1 | Failed |
SHA-256 / 617e6f241b8d78862dfd86ab73f443001cc50429ea2023fabcdd56996f0a2e01
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(url):
return url.split('#',1)[0]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('/a?q=1#x'), '/a?q=1')", "check('fixture 2', solve('/a?q=2'), '/a?q=2')", "check('fixture 3', solve('/a#x'), '/a')", "check('fixture 4', solve('/a'), '/a')"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
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 |
|---|---|---|---|
| fixture 2 | /a?q=2 | /a?q=2 | Passed |
| fixture 3 | /a | /a | Passed |
| fixture 4 | /a | /a | Passed |
| fixture 1 | /a?q=1 | /a?q=1 | Passed |
SHA-256 / 5b16e96276436e6b3d9bf61118bce43cfce507f13fde83dc1786be1ebdf38eeb
Verification & scope
Bounded deterministic policy model over validated inputs; not a complete protocol stack or an interoperability claim. The five variants rotate the same explicit fixture set. 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:04.984318+00:00.
Case digest / 931d8cea219148b37654ee72f0116e1126c7e66dc745ef69f3ae8e36a25fd0ad