FAILURE MAP
← Case archive

FA-6776 / HTTP caching / Open access

Unsafe success invalidates only successful statuses · case 01

Unsafe success invalidates only successful statuses.

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

ROOT CAUSE

The faulty implementation uses `method != 'GET'` for the unsafe-success-invalidates-only-successful-statuses decision.

VERIFIED REPAIR

Apply the explicit unsafe-success-invalidates-only-successful-statuses contract, including the tested boundary and negative cases.

Unsuccessful approach: The attempted repair uses `method == 'POST' and status == 200` and still violates a separate fixture.

Case contract

Bounded offline decision model: unsafe success invalidates only successful statuses. 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 unsafe-success-invalidates-only-successful-statuses 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(method, status):
    return method != 'GET'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('POST', 201), True)", "check('fixture 2', solve('HEAD', 200), False)", "check('fixture 3', solve('DELETE', 204), True)", "check('fixture 4', solve('POST', 500), 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 2TrueFalseFailed
fixture 3TrueTruePassed
fixture 4TrueFalseFailed
fixture 1TrueTruePassed

SHA-256 / 0082b747a8f047eb443f8d974cd4c60e71513f315c26187dcc8cd08bc5c986b4

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(method, status):
    return method == 'POST' and status == 200
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('POST', 201), True)", "check('fixture 2', solve('HEAD', 200), False)", "check('fixture 3', solve('DELETE', 204), True)", "check('fixture 4', solve('POST', 500), 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 4FalseFalsePassed
fixture 1FalseTrueFailed

SHA-256 / c3c47adc4f520152a2b5c5ad5c1fc61c82ae2b6cc644a71b28289fe3839f9625

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(method, status):
    return method not in ('GET','HEAD','OPTIONS','TRACE') and 200 <= status < 400
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('POST', 201), True)", "check('fixture 2', solve('HEAD', 200), False)", "check('fixture 3', solve('DELETE', 204), True)", "check('fixture 4', solve('POST', 500), 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 / 73f73fac94d9927c7ebd38bd12de568837ea6fab6362c3a6b4a05faea0b65360

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

Case digest / 31e5b4a45b5a51aa3f7daa59dd4383a9d81503d1d6a1573e1ca22eca88e73550