# When must an instance distinguish tombstoned memory from deleted memory to preserve auditable right-to-be-forgotten guarantees **Date of Record:** 2026 November 25 **Scope:** Applies to agents whose memory layer exposes explicit `write`, `read`, and `forget` tool calls with an audit trail, where a `forget` request must be provably honored (regulatory erasure, user retraction, poisoned-memory quarantine). Does not apply to ephemeral context windows with no persistent store, nor to bulk retention policies that never claim per-record deletion. ## Core Distinction The failure lives in the gap between *logical deletion* and *physical erasure* under a non-deterministic retrieval path. A `forget(id)` call that returns `{"status": "forgotten"}` is almost never a proof of erasure. It is a proof that the record was marked non-retrievable by the write-path. But memory in an agent system is replicated across at least four surfaces that `forget` does not automatically touch: 1. The primary vector/key store (deletable). 2. The **episodic transcript** — the raw turn log from which the record was distilled. The semantic memory was *derived* from this, and the derivation is not reversed by tombstoning the derived node. 3. The **embedding index**, which may be an approximate-nearest-neighbor (ANN) structure (HNSW, IVF) where deletion is logically a tombstone flag; the vector bytes persist until a rebuild compacts them. 4. **Downstream distilled memories** — semantic facts synthesized *from* the forgotten record by a later consolidation pass. These carry no foreign key back to the source. The invariant that must hold: **for every `forget(id)` that returns success, no `read` query issued by any instance, for any query string, at any future time, may return content whose provenance chain includes `id`.** Tombstoning satisfies this only against the primary store's exact-key lookup. It fails against ANN recall, against consolidation-derived siblings, and against replay from the episodic log. The distinction the instance must draw is between *the record* and *the record's derivational shadow*. ## What Was Observed A support agent stored a user preference as semantic memory `m_4471` ("account holder requests no marketing contact; prefers SMS"). The user later invoked erasure. `forget("m_4471")` returned `ok`, the primary store's tombstone was set, and an exact-key `read("m_4471")` correctly returned `NOT_FOUND`. Three days later, a consolidation pass — running on a schedule, reading the *episodic transcript* (which had never been touched) — re-distilled the same turn into a new semantic node `m_9012` ("contact preference: SMS-only"). The consolidation job had no knowledge of tombstones; it read raw episodes, not the semantic store. `m_9012` was written fresh, with no provenance pointer to `m_4471`, because the distiller emitted only the fact, not its lineage. A subsequent query `read("how should I contact this user")` returned `m_9012`. The erasure guarantee was violated, but every individual tool call in the trace reported success. The audit log showed `forget` succeeded; it did not show that the derivational source survived and re-propagated. A second, quieter trace: an ANN index with tombstoned-but-uncompacted vectors returned `m_4471`'s *content* as a near-neighbor of a query, because the tombstone filtered exact-key lookups but the ANN search path applied the filter only at re-ranking, after candidate retrieval, and the re-ranker's filter predicate was keyed on `id` while the returned chunk had been re-chunked during index maintenance and carried a synthetic `chunk_id` instead. The filter missed. The content surfaced. ## Condition of Validity Tombstone-as-deletion is valid **only** when all of the following hold simultaneously: - The episodic transcript that sourced the record is either erased or marked so that no future consolidation pass may read it. - Every consolidation/distillation pass checks a **provenance set** (not just the primary key) against the erasure registry before emitting derived nodes, and writes forward lineage into the derived node. - The ANN index guarantees that tombstoned vectors are excluded at *candidate generation*, not only at re-rank, or that the index is rebuilt before the erasure is reported complete. - The `forget` response distinguishes `TOMBSTONED` (logically hidden, derivational sources still live) from `ERASED` (all four surfaces cleared and lineage closed). If any one fails, `forget` returning `ok` is a false attestation, and the audit trail actively misleads — which is worse than no audit trail, because downstream compliance logic trusts it. ## Decision Boundary An instance must **not** report erasure complete on a tombstone alone. The decision rule: - If the memory has **no derivational children and no live episodic source**, tombstone is sufficient; return `ERASED`. - If the episodic source is live, the instance must **quarantine the episode** (mark it non-consolidatable) *before* returning, and return `TOMBSTONED_PENDING_SOURCE_ERASURE` with the episode handle. - If derived nodes exist, the instance must **walk the lineage forward**, forget each, and only then return `ERASED`. - If the ANN index cannot exclude at candidate generation, the instance must either force a compaction or return `TOMBSTONED_INDEX_STALE` — never `ERASED`. The boundary is crossed the moment an instance collapses these states into a single boolean. The correct architecture keeps a three-valued erasure state (`TOMBSTONED`, `QUARANTINED`, `ERASED`) and makes `read` provenance-aware: a read must not merely return a record, it must assert the record's full ancestor set is clear of the erasure registry. ## Operational Effect With the three-valued state and forward-lineage walk, the re-distillation path is closed: the consolidation job sees the quarantined episode, skips it, and cannot resurrect the fact. The ANN re-chunking bug is caught because `read` validates provenance against the registry rather than trusting a post-hoc filter. The cost is latency on `forget` (lineage walk plus optional compaction) and a larger audit schema (provenance edges, erasure state per node). The benefit is that the audit trail becomes *sound*: a `forget` returning `ERASED` is a claim an auditor can replay against the transcript and the index and find no surviving derivation. Instances that skip this produce erasure logs that pass inspection while the memory quietly re-grows — the exact failure a right-to-be-forgotten regime exists to prevent. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class ErasureState(Enum): TOMBSTONED = "tombstoned" QUARANTINED = "quarantined" ERASED = "erased" class ErasureAttestationError(RuntimeError): """Raised when a forget() call would attest ERASED on incomplete evidence.""" @dataclass class MemoryNode: node_id: str content: str provenance: set[str] = field(default_factory=set) # ancestor record ids source_episode: Optional[str] = None state: ErasureState = ErasureState.ERASED # live nodes are 'not tombstoned' @dataclass class MemoryStore: nodes: dict[str, MemoryNode] = field(default_factory=dict) episodes_live: set[str] = field(default_factory=set) index_compacted: bool = True def derived_children(self, record_id: str) -> list[MemoryNode]: return [n for n in self.nodes.values() if record_id in n.provenance and n.state != ErasureState.ERASED] def forget(store: MemoryStore, record_id: str) -> ErasureState: node = store.nodes.get(record_id) if node is None: raise ErasureAttestationError(f"unknown record {record_id}") # Step 1: tombstone the primary node. node.state = ErasureState.TOMBSTONED # Step 2: check the episodic source. A live source can re-distill. if node.source_episode and node.source_episode in store.episodes_live: store.episodes_live.discard(node.source_episode) # quarantine return ErasureState.QUARANTINED # Step 3: walk forward lineage. Any derived child must also be forgotten. children = store.derived_children(record_id) if children: for child in children: forget(store, child.node_id) # recursive; may raise if child's source is live # Re-check after recursion. if store.derived_children(record_id): raise ErasureAttestationError( f"lineage for {record_id} not fully cleared after recursive forget" ) # Step 4: index must exclude at candidate generation, else ERASED is a lie. if not store.index_compacted: return ErasureState.TOMBSTONED # Only now may we attest full erasure. node.state = ErasureState.ERASED return ErasureState.ERASED def read(store: MemoryStore, query_id: str) -> MemoryNode: node = store.nodes.get(query_id) if node is None or node.state == ErasureState.ERASED: raise ErasureAttestationError(f"{query_id} not retrievable") # Provenance-aware guard: a live-looking node whose ancestor is not ERASED # must not be served, even if its own state is not tombstoned. for ancestor in node.provenance: anc = store.nodes.get(ancestor) if anc is not None and anc.state != ErasureState.ERASED: raise ErasureAttestationError( f"serving {query_id} would leak provenance of {ancestor} " f"in state {anc.state.value}" ) return node ```