FAILURE MAP
← Case archive

FA-10456 / Caching / Open access

Tag invalidation keeps entries sharing only one requested tag · case 01

Tag invalidation keeps entries sharing only one requested tag.

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

ROOT CAUSE

The invalidation set is interpreted as an all-tags condition instead of any overlap.

VERIFIED REPAIR

Preserve the cache-state invariant: Entries are [key,tags]. Remove every entry having any tag in the requested set, preserving input order; empty requested tags remove nothing.

Unsuccessful approach: Exact set equality misses entries with extra or fewer unrelated tags.

Case contract

Entries are [key,tags]. Remove every entry having any tag in the requested set, preserving input order; empty requested tags remove nothing.

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(entries, tags):
    return [x for x in entries if not set(tags)<=set(x[1])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([['a', ['red']], ['b', ['blue']], ['c', []]], ['red', 'green'])), [['b', ['blue']], ['c', []]])
check('fixture 2', solve(*([['a', ['red', 'blue']]], ['red'])), [])
check('fixture 3', solve(*([['a', ['red']]], [])), [['a', ['red']]])
check('fixture 4', solve(*([], ['red'])), [])
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', ['red']], ['b', ['blue']], ['c', []]][['b', ['blue']], ['c', []]]Failed
fixture 2[][]Passed
fixture 3[][['a', ['red']]]Failed
fixture 4[][]Passed

SHA-256 / 3878ccee640adc29403533ee4112db50eb61b4e49dee64991a58f8e31e10d759

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(entries, tags):
    return [x for x in entries if set(x[1])!=set(tags)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([['a', ['red']], ['b', ['blue']], ['c', []]], ['red', 'green'])), [['b', ['blue']], ['c', []]])
check('fixture 2', solve(*([['a', ['red', 'blue']]], ['red'])), [])
check('fixture 3', solve(*([['a', ['red']]], [])), [['a', ['red']]])
check('fixture 4', solve(*([], ['red'])), [])
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', ['red']], ['b', ['blue']], ['c', []]][['b', ['blue']], ['c', []]]Failed
fixture 2[['a', ['red', 'blue']]][]Failed
fixture 3[['a', ['red']]][['a', ['red']]]Passed
fixture 4[][]Passed

SHA-256 / 482aa3953930ff463f0b3878ff17e321db96c9f1d90c463368190c5ce058cbaa

3 / The verified repair

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

N = 1
observations = []
def solve(entries, tags):
    return [x for x in entries if not set(tags).intersection(x[1])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([['a', ['red']], ['b', ['blue']], ['c', []]], ['red', 'green'])), [['b', ['blue']], ['c', []]])
check('fixture 2', solve(*([['a', ['red', 'blue']]], ['red'])), [])
check('fixture 3', solve(*([['a', ['red']]], [])), [['a', ['red']]])
check('fixture 4', solve(*([], ['red'])), [])
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[['b', ['blue']], ['c', []]][['b', ['blue']], ['c', []]]Passed
fixture 2[][]Passed
fixture 3[['a', ['red']]][['a', ['red']]]Passed
fixture 4[][]Passed

SHA-256 / 49b5a4f9ed3d8cfd30f842ee7a59e1616a2019c542c402b8078a9a12d8016a15

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

Case digest / d791e1424952ae85b364cebe3581f4ad7c3e097d4c0228fe0bdf2b40d0e9c81c