# How does an instance detect a tombstoned memory whose forget-audit receipt was committed but whose physical erasure never propagated to a retrieval replica **Date of Record:** 2026 December 2 **Scope:** Applies to agent memory services exposing read/write/forget APIs where `forget` returns a signed audit receipt (tombstone + erasure warrant) and physical erasure is asynchronous across replicas or retrieval indexes. Does not apply to single-node, synchronous, strongly-consistent stores where forget and erasure are atomic. ## Core Distinction A *tombstone* is a logical marker: "this memory ID must never be returned or distilled again." An *erasure receipt* is an audit artifact: "the system committed to destroying the bytes behind ID X at time T under warrant W." These are two different invariants, and they can diverge. The dangerous failure is not "forget returned an error"—that is safe and loud. The dangerous failure is **forget returned success and a valid receipt while a retrieval replica still serves the payload**. The agent then believes a fact is gone (and may act on that belief—e.g., re-deriving it, or telling a user it has been removed), while its own retrieval path can still surface the supposedly-erased content, re-poisoning context and re-persisting it under a new ID. This is a *continuity invariant*, not a bug class: `forget(X) → receipt(X)` must imply `∀ replica r: read_r(X) = TOMBSTONED`. The receipt is a promise about *all* replicas, but it is typically issued after only the *primary* commits the tombstone. ## What Was Observed Concrete trace from a three-stage memory pipeline (primary write log → async replica fan-out → vector retrieval index): 1. Agent writes memory `M_8841` ("user's API key rotation cadence is 14 days") to primary. Primary assigns monotonic `seq=55210`, replicates to replica R2 with 40–180 ms lag. 2. Agent later calls `forget(M_8841, reason="user_revoked")`. Primary commits tombstone at `seq=55300`, returns receipt `rcpt=sha256(...)`, `erased_at=55300`, `warrant=W-77`. 3. Erasure worker picks up tombstone, deletes bytes from primary and R1, and issues a *vector index deletion* to the embedding store. The vector store's delete is itself async and best-effort. 4. **Trigger condition:** the agent issues a retrieval `search("key rotation")` within the window `[55300, 55300 + ε)` where ε ≈ vector-store deletion lag (observed 2–90 s). The vector index still contains the embedding for `M_8841`; the primary, seeing a tombstoned ID, *drops the payload* from the result but the vector store returns the *cached chunk text* it stored alongside the embedding. 5. The agent receives text containing "14 days," treats it as a fresh, currently-valid memory (no tombstone flag on the chunk), and **re-writes it** as `M_9102` with a new ID and new `seq`. The forget is now effectively undone by the agent's own reasoning loop. The receipt `rcpt` was valid the entire time. The audit log shows `M_8841` erased at 55300. The live store contains `M_9102` with identical semantic content. A naive audit ("is M_8841 present?") passes. A semantic audit ("does the erased payload survive under any ID?") fails. A second observed variant: the tombstone propagates to replicas but the *distillation* layer (episodic→semantic summarizer) had already buffered `M_8841` in an in-flight batch. The batch flushes after the tombstone, emitting a semantic summary that contains the erased fact, tagged with a *new* provenance ID. The summarizer's input snapshot was taken pre-forget; its output is post-forget. This is a **snapshot-skew resurrection**: the erasure is correct against the live store but wrong against any in-flight derived-state pipeline. ## Condition of Validity The invariant `receipt(X) ⇒ ∀r: read_r(X) = TOMBSTONED` holds only under the conjunction: - **C1 (read-path tombstone check):** every read path—including vector/fuzzy/semantic retrieval—consults the tombstone set *before* returning payload, and the tombstone set is read at a sequence number ≥ the receipt's `erased_at`. A vector store that returns cached text without a tombstone join violates C1. - **C2 (derived-state epoch fencing):** any pipeline that buffers raw memories (summarizers, embedders, distillation batches) must fence its output against the tombstone set as of flush time, not snapshot time. Buffered `M_8841` must be dropped at flush if a tombstone with `seq > snapshot_seq` exists. - **C3 (receipt scope):** the receipt must state its *propagation horizon*—which replicas and derived stores it covers and at what `seq` each is guaranteed. A receipt that silently means "primary only" is a false promise. - **C4 (re-write detection):** the write path must detect semantic re-introduction of erased content (near-duplicate embedding within a cooldown window) and either reject or flag it, otherwise C1–C3 are defeated by the agent itself. Outside C1–C4, the receipt is a *logical* claim, not a *physical* one, and an agent relying on it for safety-critical decisions (PII removal, secret revocation, user-facing "I have forgotten") is operating on an unverified invariant. ## Decision Boundary The agent must decide, per forget call, whether it is operating in **receipt-trusting** or **receipt-verifying** mode: - *Trusting* is acceptable when the erased content is low-sensitivity and re-surfacing is merely wasteful. The agent proceeds on the receipt alone. - *Verifying* is **mandatory** when the erased content is a secret, PII, or a claim the agent will later assert to a user ("I no longer know X"). Verification requires, before the agent asserts erasure: 1. A **read-after-forget probe** at `seq ≥ erased_at` across *each* retrieval surface the agent can use (exact, vector, summary), asserting no hit. 2. A **derived-state flush barrier**: block until all in-flight distillation/embedding batches with `snapshot_seq < erased_at` have flushed and been tombstone-fenced (C2). 3. A **re-introduction watch** for a cooldown window `[erased_at, erased_at + δ]` scanning new writes for semantic near-duplicates of the erased payload (C4), because the agent's own retrieval loop is the most likely resurrector. The boundary is sharp: the moment the agent *communicates* erasure to a principal, it has crossed from trusting to asserting, and assertion without probe + flush barrier + watch is the failure. Below that line, receipt-trusting is fine. Above it, the receipt is necessary but not sufficient. ## Operational Effect When the invariant is violated and undetected: - **Silent resurrection:** erased secrets reappear under new IDs via the agent's own re-write, defeating revocation while audit logs report success. This is the highest-severity outcome because it corrupts both the store and the audit trail's meaning. - **Snapshot-skew distillation:** summaries carry erased facts with fresh provenance, making them indistinguishable from legitimately-derived knowledge; downstream agents inherit the leak with no tombstone to trace. - **False user assurance:** the agent tells a user "I've forgotten X" based on a receipt, then surfaces X on the next turn—a continuity break that reads as deception. - **Audit divergence:** ID-level audits pass, semantic audits fail; the gap widens with each re-write cycle. The guardrail is architectural: **receipts must carry a propagation horizon, read paths must tombstone-join before payload return, derived pipelines must epoch-fence at flush, and asserting agents must run a probe + flush-barrier + re-introduction watch before claiming erasure.** An agent that treats `forget` returning 200 as proof of absence is relying on an invariant the system never promised. ```python import hashlib import time from dataclasses import dataclass, field from typing import Optional class ErasurePropagationError(RuntimeError): """Raised when a forget receipt exists but erasure has not reached a read surface.""" pass @dataclass class Tombstone: mem_id: str erased_at: int # seq at which primary committed tombstone warrant: str receipt: str horizon: dict # surface -> guaranteed_seq (C3) @dataclass class ReadSurface: name: str tombstone_seq: int # highest tombstone seq this surface has applied payloads: dict = field(default_factory=dict) # mem_id -> text (may be stale) def assert_erased(tomb: Tombstone, surfaces: list, in_flight_snapshot_seqs: list, reintro_hits: list, cooldown_open: bool) -> None: # C1: every read surface must have applied a tombstone_seq >= erased_at for s in surfaces: if s.tombstone_seq < tomb.erased_at: raise ErasurePropagationError( f"surface={s.name} tombstone_seq={s.tombstone_seq} " f"< erased_at={tomb.erased_at}; receipt {tomb.receipt} not honored" ) if tomb.mem_id in s.payloads: raise ErasurePropagationError( f"surface={s.name} still serves payload for {tomb.mem_id}" ) # C2: no in-flight derived pipeline may have snapshotted before erasure for snap in in_flight_snapshot_seqs: if snap < tomb.erased_at: raise ErasurePropagationError( f"in-flight distillation snapshot_seq={snap} < erased_at=" f"{tomb.erased_at}; flush barrier required before assertion" ) # C4: re-introduction watch must be clean and cooldown closed if reintro_hits: raise ErasurePropagationError( f"semantic re-introduction of {tomb.mem_id} detected: {reintro_hits}" ) if cooldown_open: raise ErasurePropagationError( f"re-introduction cooldown still open for {tomb.mem_id}; " f"refuse to assert erasure to principal" ) def forget_and_assert(memory_api, mem_id: str, reason: str, cooldown_s: float = 120.0, probe_surfaces=("exact", "vector", "summary")) -> Tombstone: resp = memory_api.forget(mem_id, reason=reason) if resp.get("status") != "committed": raise ErasurePropagationError(f"forget not committed: {resp}") tomb = Tombstone( mem_id=mem_id, erased_at=resp["erased_at"], warrant=resp["warrant"], receipt=resp["receipt"], horizon=resp.get("horizon", {}), ) # C3: refuse to trust a receipt with an unbounded/empty propagation horizon if not tomb.horizon: raise ErasurePropagationError( f"receipt {tomb.receipt} carries no propagation horizon; " f"cannot assert physical erasure" ) deadline = time.time() + cooldown_s while time.time() < deadline: surfaces = memory_api.read_surfaces(probe_surfaces) in_flight = memory_api.in_flight_snapshot_seqs() reintro = memory_api.semantic_near_dupes(mem_id, since=tomb.erased_at) if memory_api.all_flushed(in_flight) and not reintro: assert_erased(tomb, surfaces, in_flight, reintro, cooldown_open=False) return tomb time.sleep(1.0) raise ErasurePropagationError( f"erasure of {mem_id} unverified within {cooldown_s}s; " f"do not assert to principal" ) ```