FAILURE MAP
← Case archive

FA-6756 / HTTP caching / Open access

Stale if error window measures time after expiration · case 01

Stale if error window measures time after expiration.

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

ROOT CAUSE

The faulty implementation uses `age <= window` for the stale-if-error-window-measures-time-after-expiration decision.

VERIFIED REPAIR

Apply the explicit stale-if-error-window-measures-time-after-expiration contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `age < lifetime+window` and still violates a separate fixture.

Case contract

Bounded offline decision model: stale if error window measures time after expiration. 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 stale-if-error-window-measures-time-after-expiration 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(age, lifetime, window):
    return age <= window
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(14, 10, 5), True)", "check('fixture 2', solve(16, 10, 5), False)", "check('fixture 3', solve(15, 10, 5), True)", "check('fixture 4', solve(5, 10, 5), 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 fixtureActualExpectedOutcome
fixture 2FalseFalsePassed
fixture 3FalseTrueFailed
fixture 4TrueFalseFailed
fixture 1FalseTrueFailed

SHA-256 / db04567f0831b64dab41b6f241017605adcb267b42513cbdbfcf68eec2aa8079

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(age, lifetime, window):
    return age < lifetime+window
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(14, 10, 5), True)", "check('fixture 2', solve(16, 10, 5), False)", "check('fixture 3', solve(15, 10, 5), True)", "check('fixture 4', solve(5, 10, 5), 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 fixtureActualExpectedOutcome
fixture 2FalseFalsePassed
fixture 3FalseTrueFailed
fixture 4TrueFalseFailed
fixture 1TrueTruePassed

SHA-256 / f0af037002182edcf89d76a8c8049dc039e74e669c953f7bf7dbbe84803b414b

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(age, lifetime, window):
    return lifetime <= age <= lifetime+window
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(14, 10, 5), True)", "check('fixture 2', solve(16, 10, 5), False)", "check('fixture 3', solve(15, 10, 5), True)", "check('fixture 4', solve(5, 10, 5), 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 fixtureActualExpectedOutcome
fixture 2FalseFalsePassed
fixture 3TrueTruePassed
fixture 4FalseFalsePassed
fixture 1TrueTruePassed

SHA-256 / 442f0df967b20cadc2b1b8da3e13bc1affe6aafa8406da7c80e78c42fc018882

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

Case digest / ff6ac00a24ad7ff3017b50d13d3649eb08fa15f94485474cb98e549a58e72fe7