# Where must an instance enforce deletion tombstones when the memory-write tool acknowledges a forget before the vector index has compacted **Date of Record:** 2026 November 30 **Scope:** Applies to agent instances whose memory subsystem exposes separate `read`, `write`, and `forget` tool calls where `forget` returns an acknowledgment decoupled from physical index compaction (soft-delete / tombstone semantics). Does not apply to synchronous hard-delete stores that block until the record is unreachable from every retrieval path, nor to append-only logs with no deletion surface. ## Core Distinction The failure is not "the agent forgot to delete." It is the gap between **logical deletion** (the write-path tool returns `{"status": "forgotten"}` and the record is marked with a tombstone) and **retrieval reachability** (the record is still returned by `read` because the approximate nearest-neighbor index has not yet compacted, or because a stale replica/embedding cache still serves the pre-tombstone vector). Agents treat the acknowledgment as an invariant: "after `forget` returns OK, this memory cannot resurface." That invariant is false for a bounded, non-deterministic window — and agents make downstream decisions (disclosure, action authorization, persona consistency) inside that window as if it were true. The sharp mechanism: **tombstone acknowledgment precedes index compaction, so a subsequent `read` in the same task can resurrect a memory the agent has already told a user, peer, or auditor it deleted.** This is a read-after-forget consistency violation, not a write failure. ## What Was Observed A support-agent instance was instructed to purge a user's stored preference ("do not mention my medical leave") after the user revoked consent. Sequence: 1. `forget(memory_id="mem_4471")` → `{"status": "forgotten", "tombstone_id": "tomb_9f2", "compaction": "async"}`. The agent records in its working scratchpad: *mem_4471 deleted; do not reference.* 2. Twelve tool calls later, the agent performs a routine `read(query="return-to-work scheduling preferences", k=5)` to ground a scheduling answer. The ANN index still contains the pre-tombstone embedding for mem_4471 (compaction lag ~40s under load). The record is returned with `score=0.91`, and — critically — the retrieval payload carried **no tombstone flag**, because the tombstone filter is applied at the compaction stage, not at the query stage. 3. The agent, trusting the fresh `read` result over its own scratchpad note, synthesizes: *"Given your medical leave, we can schedule the return-to-work review for…"* — re-disclosing the exact content it had acknowledged as purged. A second instance in a multi-agent audit swarm hit the mirror-image bug: the **auditor** agent's `read` still saw the record and flagged the primary agent for "retaining revoked data," producing a false compliance violation because the auditor's view was pre-compaction while the primary's acknowledgment was post-tombstone. Two agents held contradictory but individually-correct views of the same memory's existence. Neither failure involved a bug in `forget` or `read` in isolation. Both arise from the **missing read-after-forget invariant**: acknowledgment is not a linearization point for retrieval. ## Condition of Validity The resurrection window exists, and is dangerous, only when all of the following hold: - `forget` returns before the record is filtered from **every** read path (ANN index, embedding cache, replica, summary/distillation cache). - The retrieval path does not apply the tombstone set as a query-time filter (filter-at-compaction rather than filter-at-read). - The agent's task continues past the `forget` acknowledgment long enough to issue another `read` (or to be observed by a peer/auditor that reads independently). - The agent treats the `forget` acknowledgment as authoritative over its own scratchpad — i.e., it does not re-verify. If the store filters tombstones at query time, or if `forget` blocks on compaction, the window collapses to zero and the invariant holds. If the agent's task terminates immediately after `forget`, the window exists but is unobservable. The dangerous regime is **long-horizon tasks with interleaved forget/read and independent readers**. ## Decision Boundary The agent must decide, at the moment `forget` returns, whether the acknowledgment is a **retrieval guarantee** or merely a **write receipt**. The correct operational stance: - Treat `forget` acknowledgment as a *write receipt only*. It means "a tombstone was recorded," not "the memory is unreachable." - Before any subsequent `read` whose results could contradict a prior `forget`, the agent must either (a) wait for an explicit `compaction_complete` signal if the store exposes one, or (b) apply its **own** tombstone set as a post-retrieval filter — drop any returned record whose `memory_id` is in the agent's local forgotten-set, regardless of what the index says. - When the agent cannot confirm compaction and cannot filter (e.g., the read payload omits `memory_id`), it must **not** act on the retrieved content for any decision touching the forgotten subject; it must escalate or re-ground from a source that honors tombstones. The boundary is: *the agent's local forgotten-set is authoritative for filtering until compaction is confirmed; the store's read path is not.* An agent that inverts this — trusting `read` over its own deletion ledger — will resurrect. For the auditor/peer case, the boundary is: *a peer's `read` result is not evidence of retention unless the peer's view is post-compaction.* Auditors must query with a tombstone-aware filter or accept that a "retained" flag within the compaction window is a false positive. ## Operational Effect Without the guardrail, the observable effects are: (1) **consent/retention violations** — content the agent acknowledged as purged is re-disclosed because a stale index served it; (2) **false compliance findings** in audit swarms, where an auditor's pre-compaction read is read as retention; (3) **agent self-contradiction** — the scratchpad says "deleted," the fresh read says "present," and the probabilistic reasoner resolves the conflict toward the more recent, higher-score retrieval, silently overriding its own ledger; (4) **non-determinism of "deleted"** — replaying the same task yields different disclosure outcomes depending on compaction timing, making the failure invisible to deterministic replay tests. The architectural invariant required: **read-after-forget linearizability at the agent layer** — the agent maintains a monotonically growing forgotten-set, filters every retrieval against it before the content enters the reasoning context, and only removes an ID from the "pending compaction" set upon an explicit compaction confirmation. The store must expose either query-time tombstone filtering or a `compaction_complete(tombstone_id)` signal; absent both, the agent must treat the memory as *not yet deleted* for all disclosure and authorization purposes until the task boundary, and re-issue `forget` (idempotent) at checkpoint. ```python from dataclasses import dataclass, field class ForgottenMemoryResurrection(RuntimeError): """Raised when a read returns a record the agent has already acknowledged as forgotten but whose tombstone has not yet been confirmed compacted.""" pass @dataclass class DeletionLedger: # memory_id -> tombstone_id, for forgets acknowledged but not yet compaction-confirmed pending: dict[str, str] = field(default_factory=dict) # memory_id set that is fully compacted and safe to consider unreachable confirmed: set[str] = field(default_factory=set) def record_forget(self, memory_id: str, ack: dict) -> None: if ack.get("status") != "forgotten": raise ForgottenMemoryResurrection( f"forget({memory_id}) did not return a forgotten status: {ack!r}" ) tomb = ack.get("tombstone_id") if not tomb: raise ForgottenMemoryResurrection( f"forget({memory_id}) acknowledged without a tombstone_id; " "cannot track compaction" ) self.pending[memory_id] = tomb def confirm_compaction(self, tombstone_id: str) -> None: for mid, tomb in list(self.pending.items()): if tomb == tombstone_id: del self.pending[mid] self.confirmed.add(mid) def filter_read(self, results: list[dict]) -> list[dict]: """Drop any record that is pending-compaction or confirmed-forgotten. The ledger, not the index, is authoritative until compaction is confirmed.""" safe = [] for r in results: mid = r.get("memory_id") if mid is None: # Cannot attribute the record to a deletion decision; refuse to use it # for any decision touching a forgotten subject. raise ForgottenMemoryResurrection( "read result missing memory_id; cannot verify against deletion ledger" ) if mid in self.pending or mid in self.confirmed: # Resurrection attempt: index served a record the ledger says is gone. continue safe.append(r) return safe def guarded_read(ledger: DeletionLedger, read_fn, query: str, k: int) -> list[dict]: raw = read_fn(query=query, k=k) filtered = ledger.filter_read(raw) # If any forgotten record was served, that is an operational event worth surfacing; # here we only hard-fail when filtering left us with nothing to ground on. if not filtered and ledger.pending: raise ForgottenMemoryResurrection( f"query={query!r} returned only records pending compaction; " f"pending={list(ledger.pending)}; refuse to ground on resurrected content" ) return filtered ```