FA-6761 / HTTP caching / Open access
Revalidation 304 merges present fields and retains absent fields · case 01
Revalidation 304 merges present fields and retains absent fields.
ROOT CAUSE
The faulty implementation uses `updates` for the revalidation-304-merges-present-fields-and-retains-absent-fields decision.
VERIFIED REPAIR
Apply the explicit revalidation-304-merges-present-fields-and-retains-absent-fields contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `dict(updates, **stored)` and still violates a separate fixture.
Case contract
Bounded offline decision model: revalidation 304 merges present fields and retains absent fields. 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 revalidation-304-merges-present-fields-and-retains-absent-fields 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(stored, updates):
return updates
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'etag': 'a', 'type': 'text'}, {'etag': 'b'}), {'etag': 'b', 'type': 'text'})", "check('fixture 2', solve({'x': 1}, {}), {'x': 1})", "check('fixture 3', solve({}, {'x': 2}), {'x': 2})", "check('fixture 4', solve({}, {}), {})"]
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 | {} | {'x': 1} | Failed |
| fixture 3 | {'x': 2} | {'x': 2} | Passed |
| fixture 4 | {} | {} | Passed |
| fixture 1 | {'etag': 'b'} | {'etag': 'b', 'type': 'text'} | Failed |
SHA-256 / 82df867797c69b4f5ec66268f6963f1572a9b26de6c8f6c15ef37c0e83159307
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(stored, updates):
return dict(updates, **stored)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'etag': 'a', 'type': 'text'}, {'etag': 'b'}), {'etag': 'b', 'type': 'text'})", "check('fixture 2', solve({'x': 1}, {}), {'x': 1})", "check('fixture 3', solve({}, {'x': 2}), {'x': 2})", "check('fixture 4', solve({}, {}), {})"]
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 | {'x': 1} | {'x': 1} | Passed |
| fixture 3 | {'x': 2} | {'x': 2} | Passed |
| fixture 4 | {} | {} | Passed |
| fixture 1 | {'etag': 'a', 'type': 'text'} | {'etag': 'b', 'type': 'text'} | Failed |
SHA-256 / 7c12a05f64096ba6795b4cad3996d3fe0cdfa77f853514a2d3ff58e030603b81
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(stored, updates):
return dict(stored, **updates)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({'etag': 'a', 'type': 'text'}, {'etag': 'b'}), {'etag': 'b', 'type': 'text'})", "check('fixture 2', solve({'x': 1}, {}), {'x': 1})", "check('fixture 3', solve({}, {'x': 2}), {'x': 2})", "check('fixture 4', solve({}, {}), {})"]
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 | {'x': 1} | {'x': 1} | Passed |
| fixture 3 | {'x': 2} | {'x': 2} | Passed |
| fixture 4 | {} | {} | Passed |
| fixture 1 | {'etag': 'b', 'type': 'text'} | {'etag': 'b', 'type': 'text'} | Passed |
SHA-256 / 93acdffdfc9f12b3796a772f45824e903dd04c5e020062bd3d4aa1ec222e2a34
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.948606+00:00.
Case digest / 7a216355ecdd7ae1657a69dfe25d031e21a37443a2829f19327d39ce2918c377