FAILURE MAP
← Case archive

FA-6821 / HTTP caching / Open access

Cache variants distinguish missing header from empty header · case 01

Cache variants distinguish missing header from empty header.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The faulty implementation uses `headers.get(name, "")` for the cache-variants-distinguish-missing-header-from-empty-header decision.

VERIFIED REPAIR

Apply the explicit cache-variants-distinguish-missing-header-from-empty-header contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `bool(headers.get(name))` and still violates a separate fixture.

Case contract

Bounded offline decision model: cache variants distinguish missing header from empty header. 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-variants-distinguish-missing-header-from-empty-header 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(headers, name):
    return headers.get(name, "")
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({}, 'accept'), (False, None))", "check('fixture 2', solve({'accept': ''}, 'accept'), (True, ''))", "check('fixture 3', solve({'accept': 'x'}, 'accept'), (True, 'x'))", "check('fixture 4', solve({'other': 'x'}, 'accept'), (False, None))"]
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 fixtureActualExpectedOutcome
fixture 2[True, '']Failed
fixture 3x[True, 'x']Failed
fixture 4[False, None]Failed
fixture 1[False, None]Failed

SHA-256 / 967a6e8250c26154da29e77388bd18d8578919a62e7ed90655091dc4a285b74b

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(headers, name):
    return bool(headers.get(name))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({}, 'accept'), (False, None))", "check('fixture 2', solve({'accept': ''}, 'accept'), (True, ''))", "check('fixture 3', solve({'accept': 'x'}, 'accept'), (True, 'x'))", "check('fixture 4', solve({'other': 'x'}, 'accept'), (False, None))"]
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 fixtureActualExpectedOutcome
fixture 2False[True, '']Failed
fixture 3True[True, 'x']Failed
fixture 4False[False, None]Failed
fixture 1False[False, None]Failed

SHA-256 / 3c5be4930b90711a02fbc6d1fbd4d8938019def10d48b5a3f001fbe7b0ba4d8f

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(headers, name):
    return (name in headers, headers.get(name))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve({}, 'accept'), (False, None))", "check('fixture 2', solve({'accept': ''}, 'accept'), (True, ''))", "check('fixture 3', solve({'accept': 'x'}, 'accept'), (True, 'x'))", "check('fixture 4', solve({'other': 'x'}, 'accept'), (False, None))"]
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 fixtureActualExpectedOutcome
fixture 2[True, ''][True, '']Passed
fixture 3[True, 'x'][True, 'x']Passed
fixture 4[False, None][False, None]Passed
fixture 1[False, None][False, None]Passed

SHA-256 / 4100ef6cc5bea00d2a01de9556a94ce5a42ff816202683f495edc3ea8f941f8d

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.565723+00:00.

Case digest / bb0edd37fc3b94379e9003437a6864650df52f0ff555953ded8f38b1a430468e