FAILURE MAP
← Case archive

FA-10471 / Caching / Open access

An old fetch repopulates a cache after invalidation · case 01

An old fetch repopulates a cache after invalidation.

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

ROOT CAUSE

Fetch completion ignores the invalidation generation captured at fetch start.

VERIFIED REPAIR

Preserve the cache-state invariant: Publish fetched value only when its captured generation equals the current generation; otherwise preserve the complete cache.

Unsuccessful approach: An ordered less-than check accepts precisely the stale generations that must be rejected.

Case contract

Publish fetched value only when its captured generation equals the current generation; otherwise preserve the complete cache.

Why this case matters

A deterministic cache state transformation. Inputs are copied or treated as immutable; no remote storage, real clock, or concurrent interleaving is simulated.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cache, key, value, started, current):
    out=dict(cache)
    out[key]=value
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*({}, 'a', 'stale', 2, 3)), {})
check('fixture 2', solve(*({'a': 'new'}, 'a', 'old', 2, 3)), {'a': 'new'})
check('fixture 3', solve(*({}, 'a', 'fresh', 3, 3)), {'a': 'fresh'})
check('fixture 4', solve(*({'b': 0}, 'a', None, 0, 0)), {'b': 0, 'a': None})
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 1{'a': 'stale'}{}Failed
fixture 2{'a': 'old'}{'a': 'new'}Failed
fixture 3{'a': 'fresh'}{'a': 'fresh'}Passed
fixture 4{'a': None, 'b': 0}{'a': None, 'b': 0}Passed

SHA-256 / bb47341acbc6550fff7464f5eb0d5dc7fa5659a2554510926bd1be4713e0467e

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cache, key, value, started, current):
    out=dict(cache)
    if started<=current: out[key]=value
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*({}, 'a', 'stale', 2, 3)), {})
check('fixture 2', solve(*({'a': 'new'}, 'a', 'old', 2, 3)), {'a': 'new'})
check('fixture 3', solve(*({}, 'a', 'fresh', 3, 3)), {'a': 'fresh'})
check('fixture 4', solve(*({'b': 0}, 'a', None, 0, 0)), {'b': 0, 'a': None})
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 1{'a': 'stale'}{}Failed
fixture 2{'a': 'old'}{'a': 'new'}Failed
fixture 3{'a': 'fresh'}{'a': 'fresh'}Passed
fixture 4{'a': None, 'b': 0}{'a': None, 'b': 0}Passed

SHA-256 / 81193ff4876aa8c6f02334b04dd3c20b291a751ce0c20b95188a03508d37174e

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(cache, key, value, started, current):
    out=dict(cache)
    if started==current: out[key]=value
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*({}, 'a', 'stale', 2, 3)), {})
check('fixture 2', solve(*({'a': 'new'}, 'a', 'old', 2, 3)), {'a': 'new'})
check('fixture 3', solve(*({}, 'a', 'fresh', 3, 3)), {'a': 'fresh'})
check('fixture 4', solve(*({'b': 0}, 'a', None, 0, 0)), {'b': 0, 'a': None})
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 1{}{}Passed
fixture 2{'a': 'new'}{'a': 'new'}Passed
fixture 3{'a': 'fresh'}{'a': 'fresh'}Passed
fixture 4{'a': None, 'b': 0}{'a': None, 'b': 0}Passed

SHA-256 / 98352f0ae070b47f5435db815086f111632cdd3954e17c6cd37afd8eed6e46aa

Verification & scope

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

Case digest / a0d38b031342a204faf74ee8be4bad85d6e42496dbad829fab2b36579a4f3397