FA-6791 / HTTP caching / Open access
Weak etag comparison ignores weakness markers · case 01
Weak etag comparison ignores weakness markers.
ROOT CAUSE
The faulty implementation uses `left == right` for the weak-etag-comparison-ignores-weakness-markers decision.
VERIFIED REPAIR
Apply the explicit weak-etag-comparison-ignores-weakness-markers contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `left.lower().removeprefix('w/') == right.lower().removeprefix('w/')` and still violates a separate fixture.
Case contract
Bounded offline decision model: weak etag comparison ignores weakness markers. 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 weak-etag-comparison-ignores-weakness-markers 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(left, right):
return left == right
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ['check(\'fixture 1\', solve(\'W/"a"\', \'"a"\'), True)', 'check(\'fixture 2\', solve(\'"A"\', \'"a"\'), False)', 'check(\'fixture 3\', solve(\'"a"\', \'"a"\'), True)', 'check(\'fixture 4\', solve(\'"b"\', \'"a"\'), False)']
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 | False | False | Passed |
| fixture 3 | True | True | Passed |
| fixture 4 | False | False | Passed |
| fixture 1 | False | True | Failed |
SHA-256 / d32d731a988fc2e368cecfe6642fd43edb5973689b2ecc4a79ed632ff2cd6bce
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(left, right):
return left.lower().removeprefix('w/') == right.lower().removeprefix('w/')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ['check(\'fixture 1\', solve(\'W/"a"\', \'"a"\'), True)', 'check(\'fixture 2\', solve(\'"A"\', \'"a"\'), False)', 'check(\'fixture 3\', solve(\'"a"\', \'"a"\'), True)', 'check(\'fixture 4\', solve(\'"b"\', \'"a"\'), False)']
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 | True | False | Failed |
| fixture 3 | True | True | Passed |
| fixture 4 | False | False | Passed |
| fixture 1 | True | True | Passed |
SHA-256 / 07c88a5186a2c41fde55b74132fff1b8a7356ce8fde2bf73c21607f78e42d09c
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(left, right):
return left.removeprefix('W/') == right.removeprefix('W/')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ['check(\'fixture 1\', solve(\'W/"a"\', \'"a"\'), True)', 'check(\'fixture 2\', solve(\'"A"\', \'"a"\'), False)', 'check(\'fixture 3\', solve(\'"a"\', \'"a"\'), True)', 'check(\'fixture 4\', solve(\'"b"\', \'"a"\'), False)']
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 | False | False | Passed |
| fixture 3 | True | True | Passed |
| fixture 4 | False | False | Passed |
| fixture 1 | True | True | Passed |
SHA-256 / 988934ad5f517f23823fabc5f53328745295d77fbc50ed56cb4a722f4582a069
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:05.205619+00:00.
Case digest / 890c612a250ff52c38e80c8d8fdfa862e935d1cd3a3f2b3893c37de90ac6c6da