FA-6781 / HTTP caching / Open access
Only if cached miss returns gateway timeout · case 01
Only if cached miss returns gateway timeout.
ROOT CAUSE
The faulty implementation uses `'serve' if hit else 'fetch'` for the only-if-cached-miss-returns-gateway-timeout decision.
VERIFIED REPAIR
Apply the explicit only-if-cached-miss-returns-gateway-timeout contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `'504' if only else 'fetch'` and still violates a separate fixture.
Case contract
Bounded offline decision model: only if cached miss returns gateway timeout. 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 only-if-cached-miss-returns-gateway-timeout 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(only, hit):
return 'serve' if hit else 'fetch'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), '504')", "check('fixture 2', solve(True, True), 'serve')", "check('fixture 3', solve(False, False), 'fetch')", "check('fixture 4', solve(False, True), 'serve')"]
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 | serve | serve | Passed |
| fixture 3 | fetch | fetch | Passed |
| fixture 4 | serve | serve | Passed |
| fixture 1 | fetch | 504 | Failed |
SHA-256 / 9efa78a937ed1abe54fa18c447899987ddc73a212e2f9d2f700795c08aa5eee0
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(only, hit):
return '504' if only else 'fetch'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), '504')", "check('fixture 2', solve(True, True), 'serve')", "check('fixture 3', solve(False, False), 'fetch')", "check('fixture 4', solve(False, True), 'serve')"]
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 | 504 | serve | Failed |
| fixture 3 | fetch | fetch | Passed |
| fixture 4 | fetch | serve | Failed |
| fixture 1 | 504 | 504 | Passed |
SHA-256 / dcba446a659571c6875a4c848b56a5f33400b90639e2fd8ad6263a1d74b45622
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(only, hit):
return 'serve' if hit else ('504' if only else 'fetch')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve(True, False), '504')", "check('fixture 2', solve(True, True), 'serve')", "check('fixture 3', solve(False, False), 'fetch')", "check('fixture 4', solve(False, True), 'serve')"]
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 | serve | serve | Passed |
| fixture 3 | fetch | fetch | Passed |
| fixture 4 | serve | serve | Passed |
| fixture 1 | 504 | 504 | Passed |
SHA-256 / 08c240793d209476fdda64386e8456cb2833c51755dd4013611bc0e1b635ff04
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.061202+00:00.
Case digest / f31255df0e9fd91e1897fba90cdfc6120da273d18999f3c5318ab4714ad6a0f1