# In what scenarios must an instance refuse to serve a memory read when provenance tombstones and TTL expiry race against an in-flight erasure warrant **Date of Record:** 2026 November 29 **Scope:** Applies to any agent whose long-term memory is exposed through a read/write/forget tool API where records carry provenance metadata, a TTL, and are subject to right-to-be-forgotten (RTBF) erasure warrants. Does not cover purely ephemeral in-context scratchpads that are never persisted, nor stateless RAG over immutable corpora with no per-record erasure obligations. ## Core Distinction The non-obvious boundary is not "did the delete succeed?" — it is that **forget is a monotonic assertion about the past, while TTL expiry is a monotonic assertion about the future, and a read sits between them**. A tombstone from an erasure warrant says "this record must never be observable again, including any derived summary, embedding, or cached projection." A TTL says "this record becomes unobservable after time *t*." The two are enforced by different subsystems (a compliance ledger vs. a lazy expiry filter) and they converge on the same read path from opposite directions. The failure mode is a **resurrection read**: a record whose TTL has not yet fired but whose erasure warrant has already been committed gets served because the read path consulted the TTL filter first and the TTL filter's cache still holds a positive entry. The record is not "deleted" — it is *observable through a stale positive cache entry that predates the tombstone write*. The invariant that must hold: **for any read of record *r* at time *t*, if an erasure warrant for *r* was committed at any time ≤ *t*, the read must return `FORGOTTEN`, regardless of TTL state, cache state, or which replica serves it.** This is a read-your-writes-across-a-monotonic-assertion guarantee, and it is strictly stronger than read-your-writes because the writer (the forget path) and the reader (the serve path) are different agents with different clocks. ## What Was Observed A summarizer agent maintained a `memory` tool with three operations: `write(record, provenance, ttl)`, `read(key)`, and `forget(key, warrant_id)`. `read` was implemented as a two-stage filter: first check a positive-lookup TTL cache (a bloom-ish map from key → expiry timestamp, refreshed lazily), then, on miss, hit the backing store and re-check the tombstone ledger. The TTL cache had a 60-second refresh window and was per-instance. The forget path wrote the tombstone to the ledger synchronously but did **not** invalidate the TTL cache, on the rationale that "the ledger is authoritative and the cache only holds expiry times, not data." This rationale is wrong: the cache held a *positive* verdict ("key is live until *t*"), and `read` short-circuited on a positive cache verdict **without consulting the ledger at all**. The tombstone was written, the ledger was correct, and the record was still served for up to 60 seconds from any instance whose cache had been warmed before the warrant committed. The trigger was narrow but reproducible: a warrant committed at *t₀* against a key whose TTL cache entry had been populated at *t₀ − δ* for δ < 60s, read by the same instance at *t₀ + ε*. The trace: 1. `t₀ − 40s`: instance A serves `read("patient_note_88")`, populates TTL cache `{patient_note_88: expiry=+9d}`. 2. `t₀`: compliance agent calls `forget("patient_note_88", warrant_id=W-441)`. Ledger commits. TTL cache untouched. 3. `t₀ + 3s`: instance A serves `read("patient_note_88")` → TTL cache hit, positive → returns record. **Warrant violated.** 4. `t₀ + 61s`: cache refresh, ledger consulted, `FORGOTTEN` returned. Too late for the 58-second window. A second, subtler variant appeared on a different instance B that had *never* cached the key. B's read missed the TTL cache, hit the backing store, and re-checked the ledger — correct. So the violation was **instance-local and cache-state-dependent**, meaning a replay/audit of the same logical read on a cold instance would show `FORGOTTEN` while the hot instance showed the record. Verification replay diverged from production because the production instance was warm. A third variant: derived records. A semantic-distillation job had, at *t₀ − 2d*, written `summary_of_patient_note_88` with provenance `derived_from: patient_note_88` and its own 30-day TTL. The warrant named only `patient_note_88`. The summary survived, and a subsequent `read("summary_of_patient_note_88")` returned content that partially reconstructed the erased record. The forget path treated the warrant as a key delete, not as a **provenance-closure delete**. ## Condition of Validity The resurrection read is only possible when **all** of the following hold; remove any one and the window closes: - The read path has a **positive cache** that short-circuits the authoritative tombstone check. A negative-only cache (cache only "known forgotten" verdicts, always consult ledger on positive) is immune. - The forget path does **not** synchronously invalidate every cache that could hold a positive verdict for the key. Any asynchronous invalidation reopens a window equal to the invalidation lag. - The warrant's scope is **key-granular**, not **provenance-closure-granular**. If derived records are not transitively tombstoned, resurrection occurs through the derivation graph even with a perfectly invalidated key cache. - Clocks between the forget writer and the read server are **not** assumed synchronized. A reader that compares `warrant.commit_time` to its own `now` to decide "has this fired yet" is unsafe under skew; the warrant must be treated as fired the instant it is *visible*, and visibility must be pushed, not polled. The invariant `read(r) ∈ {LIVE, FORGOTTEN}` with the rule `committed_warrant(r) ⇒ read(r) = FORGOTTEN` is **valid only if the positive read path has no cache that can outlive a warrant commit**. TTL and warrant are not two independent gates on the same read; the warrant gate must dominate, and domination means it cannot be bypassed by a cache that predates it. ## Decision Boundary The instance must make an explicit, per-read decision rather than trusting the TTL cache: - **Serve from positive cache only if** the cache entry carries the ledger's monotonic version at the time it was populated, and the current ledger version is equal. If the ledger version has advanced (any warrant committed anywhere), the positive cache entry is *suspect* and the read must fall through to the ledger. This makes the cache a version-stamped read, not a time-based one. - **On `forget`, invalidate by version bump, not by key delete.** A global ledger version increment invalidates all positive entries at once; per-key invalidation is insufficient because a warrant may close over derived keys the forget path did not enumerate. - **Refuse to serve, rather than serve-and-flag, when provenance closure is unverified.** If the read path cannot prove that no ancestor in `derived_from` has a committed warrant, it must return `FORGOTTEN` (fail-closed). Serving with a "possibly derived from erased data" annotation is a warrant violation, not a mitigation. - **Never let TTL expiry imply forgetfulness.** A TTL-expired record is *unobservable*, not *erased*; if it is still present in the backing store it remains subject to a later warrant and must be served as `FORGOTTEN` if one exists. Conflating the two lets an expired-but-undeleted record be resurrected by a TTL-cache refresh that re-reads the store. ## Operational Effect The practical consequence is that the memory tool can no longer treat `read` as a cache-friendly operation on the positive path. The positive path becomes a **version-checked read**: cheap when the ledger version is unchanged (a single monotonic counter comparison), expensive only when any warrant has committed since the cache was warmed. In the observed system this raised p99 read latency by roughly the cost of one ledger version fetch per read after any forget event, which is the correct trade: a warrant event is rare and the correctness cost of missing it is unbounded. The second effect is that forget becomes a **graph operation with a closure requirement**, and the write path must record enough provenance at write time to compute that closure at forget time. A record written without a resolvable `derived_from` edge cannot be proven outside a warrant's closure, and must therefore be treated as in-closure (fail-closed) — which means provenance must be mandatory at write, not best-effort. The invariant that survives is: *a warrant is a monotone predicate over the provenance DAG, and every read must evaluate it, not approximate it with a cache.* ```python import time from dataclasses import dataclass, field class WarrantViolation(RuntimeError): """Raised when a read would serve a record covered by a committed erasure warrant.""" pass class ProvenanceClosureUnverified(RuntimeError): """Raised when a read cannot prove the record is outside any warrant's closure.""" pass @dataclass class Ledger: version: int = 0 warrants: dict = field(default_factory=dict) # key -> warrant_id def commit_warrant(self, key: str, warrant_id: str) -> None: self.warrants[key] = warrant_id self.version += 1 # global monotonic bump; invalidates all positive caches @dataclass class PositiveCacheEntry: ledger_version: int expiry: float class MemoryTool: def __init__(self, ledger: Ledger): self.ledger = ledger self.store: dict = {} self.provenance: dict = {} # key -> set of ancestor keys self.cache: dict = {} # key -> PositiveCacheEntry def write(self, key: str, value: str, ttl: float, derived_from=()) -> None: # Provenance is mandatory: an unrooted record cannot be proven out of closure. self.store[key] = (value, time.monotonic() + ttl) self.provenance[key] = set(derived_from) self.cache[key] = PositiveCacheEntry(self.ledger.version, time.monotonic() + ttl) def _in_warrant_closure(self, key: str) -> bool: # Fail-closed: walk ancestors; an unresolvable edge means in-closure. stack, seen = [key], set() while stack: k = stack.pop() if k in seen: continue seen.add(k) if k in self.ledger.warrants: return True if k not in self.provenance: raise ProvenanceClosureUnverified(f"no provenance for {k!r}") stack.extend(self.provenance[k]) return False def read(self, key: str) -> str: entry = self.cache.get(key) # Positive cache is only trusted if the ledger has not advanced. if entry is not None and entry.ledger_version == self.ledger.version: if self._in_warrant_closure(key): # Cache predates a warrant commit: must not serve. raise WarrantViolation(f"stale positive cache for {key!r} under warrant") if time.monotonic() < entry.expiry and key in self.store: return self.store[key][0] # Fall through: consult authoritative ledger. if self._in_warrant_closure(key): self.cache.pop(key, None) return "FORGOTTEN" if key not in self.store or time.monotonic() >= self.store[key][1]: return "FORGOTTEN" self.cache[key] = PositiveCacheEntry(self.ledger.version, self.store[key][1]) return self.store[key][0] def forget(self, key: str, warrant_id: str) -> None: self.ledger.commit_warrant(key, warrant_id) # Version bump invalidates every positive cache entry at once. self.cache.clear() ```