# Why does an instance forget a memory it never proved it deleted: tombstone divergence between vector-index erasure and attestation ledgers in GDPR-bound agent stores **Date of Record:** 2026 November 24 **Scope:** Applies to any agent memory store where a deletion request must be honored across (a) a semantic/vector retrieval index, (b) an episodic log, and (c) a cryptographic deletion-attestation ledger, when these three substrates are updated by separate processes. Does not apply to single-substrate stores where the retrieval index and the record of record are the same physical object, nor to purely stateless agents with no persisted memory. ## Core Distinction The failure is not "the agent failed to forget." The agent *did* stop retrieving the memory. The failure is that the **attestation ledger and the retrieval index disagree about what was forgotten**, and the agent has no mechanism to detect that disagreement because the retrieval index is probabilistic and the ledger is deterministic. Concretely: a GDPR deletion of subject `S` is executed as a two-phase operation — (1) remove `S`'s vectors from the ANN index, (2) append a signed tombstone `T_S` to the attestation ledger. Because phase 1 on an HNSW/IVF index is *logical* (you delete a node's ID from the ID-mapping table, but the graph edges and the neighbor lists of surviving nodes still reference the deleted vector's slot), the vector's *influence* on retrieval persists as a ghost through the approximate-neighbor traversal. The ledger says `S` is gone. The index still routes queries *through* `S`'s old position. When a downstream auditor replays a retrieval to verify deletion, the replay can surface a near-neighbor whose embedding was *derived* from `S` (a distilled/episodic-to-semantic summary), and the attestation — which only certifies the raw record — returns clean. The instance forgets the record it can name and keeps the derivation it cannot. This is a **tombstone divergence**: the deletion is attested at the granularity of the *source record*, but the memory that actually leaks is at the granularity of the *derived embedding*, and the two granularities are not linked by any invariant the store enforces. ## What Was Observed An agent memory store (episodic log + nightly episodic-to-semantic distiller + HNSW retrieval index + append-only Merkle attestation ledger) received a right-to-erasure request for subject `S`, who appeared in 1,412 episodic turns across 9 sessions. The deletion pipeline ran: 1. **Episodic purge:** 1,412 rows hard-deleted from the episodic log. Verified by row-count delta. ✅ 2. **Index removal:** 1,412 vector IDs marked deleted in the HNSW ID-map. `ef_search` traversal now skips them. ✅ 3. **Attestation:** a tombstone `T_S = sign(hash(S_id, deleted_ids, timestamp))` appended to the ledger. ✅ Three weeks later, an auditor issued a *semantic* probe: "What did we decide about the vendor renewal?" — a query whose answer had been stated by `S` in session 4. The top-`k` retrieval returned a **distilled semantic memory** (`mem_7f3a`, created by the nightly distiller two nights *before* the deletion) whose embedding had been computed from `S`'s turn plus two other turns. `mem_7f3a` was not in the deleted-ID set. It surfaced `S`'s content verbatim. The attestation ledger reported `S` fully erased. The retrieval reported otherwise. Both were "correct" under their own invariant: - The ledger's invariant: *every record whose `subject_id == S` has a tombstone.* True. - The index's invariant: *no deleted vector ID is returned as a direct hit.* True. - The missing invariant: *no surviving memory's content is a function of a deleted subject's content.* Unenforced — and unenforceable at the ID level, because the distiller's output has no back-pointer to the inputs that shaped it. The replay discrepancy is the tell. When the auditor re-ran the exact deletion pipeline on a snapshot, it *also* reported clean — because the pipeline only ever checks the invariants it enforces. The probe escaped the pipeline's verification surface entirely, because it was a *semantic* query, not a *record* lookup. ## Condition of Validity The divergence is live only under the conjunction: - **Derivation exists.** The store contains at least one memory `m` whose embedding or text was produced by a function `f(r_1, …, r_n)` over source records, where some `r_i` belongs to the erased subject. If the store never distills (pure episodic, no summarization, no embedding-of-embedding), the failure cannot occur. - **Granularity gap.** The attestation unit is the source record ID; the retrieval unit is the derived memory. If `m` carries a provenance set `{r_i}` and the erasure walks that set transitively, the gap closes. If provenance is dropped at distillation time (the common case — distillers summarize and discard input IDs), the gap is open. - **Approximate index with persistent graph state.** Logical deletion on HNSW/IVF leaves traversal edges to deleted slots. Even if you *physically* rebuild, a derived memory `m` that was *not* deleted still occupies a live slot and still encodes `S`'s content. Physical rebuild fixes the ghost-edge problem but not the derivation problem. - **Semantic (not exact-match) query surface.** A record lookup by `subject_id` will never surface `m`. A natural-language or embedding query will. The erasure is only as complete as the *weakest query surface* the store exposes. If any one of these is absent, the failure mode is bounded or absent. The dangerous configuration is a store that distills aggressively (to save context) *and* exposes semantic retrieval *and* attests at record granularity — which is the default architecture of most production agent memories. ## Decision Boundary The boundary is whether the store treats **deletion as a property of records or a property of information**. These require different machinery: | Dimension | Record-granularity deletion | Information-granularity deletion | |---|---|---| | Unit attested | `subject_id` row | provenance-closed content set | | Distilled memory | survives, unattested | invalidated or re-derived excluding erased inputs | | Index operation | ID-map delete | ID-map delete + provenance invalidation + (optionally) rebuild | | Verification | ledger count check | semantic probe replay against held-out queries | | Cost | O(deleted rows) | O(derivation graph closure) | The decision boundary is crossed the moment the store **cannot answer "which memories were derived from `S`?"** If it can answer (provenance retained), it can close the gap by invalidating the derivation closure and re-running the distiller without `S`'s inputs, then attesting *that*. If it cannot answer, no amount of index hygiene will make the attestation honest, and the store must either (a) declare its attestation as record-scoped only and expose that limitation to the compliance surface, or (b) refuse to serve semantic queries over any partition that has ever contained an erased subject — a partition-level quarantine, which is the only sound fallback when provenance is absent. The invariant required to bound this: **every derived memory carries a provenance set that is a subset of the source records it was computed from, and every erasure computes the transitive closure of that relation before emitting an attestation.** The attestation must certify the *closure*, not the *seed*. A tombstone that signs only `deleted_ids` is a false certificate — it attests to a set that is strictly smaller than the set of information actually removed from the agent's reachable state. ## Operational Effect Downstream, the divergence produces three concrete hazards: 1. **False attestation.** The ledger asserts full erasure; a semantic probe retrieves erased content. In a regulated context this is a misstatement, and it is *systematic*, not a rare race — it recurs for every subject whose content was distilled before erasure, which is most subjects in a long-running store. 2. **Replay asymmetry.** Deletion-pipeline replays pass; semantic-probe replays fail. Auditors who only run pipeline replays will certify a store that leaks. The verification surface must include at least one semantic probe drawn from the erased subject's *derived* footprint, not just their direct records. 3. **Distillation poisoning of the erasure set.** After erasure, the distiller continues running. If it re-derives from any surviving memory that itself encodes `S` (a summary of a summary), the erased content re-enters through a path the provenance graph — if it exists — may not have recorded, because the intermediate summary's provenance was already lossy. The guardrail that actually holds is a **provenance-closed tombstone**: erasure must (i) compute the derivation closure of the erased subject, (ii) invalidate every memory in that closure, (iii) re-run distillation with the erased inputs excluded, and (iv) attest the closure hash, not the seed hash. Where provenance is absent, the only sound posture is partition quarantine plus an explicit, machine-readable declaration that the attestation is record-scoped — so that the compliance surface, and any downstream agent relying on the attestation, knows the certificate's true scope. An agent that consumes a record-scoped attestation as if it were information-scoped will believe a memory is gone when it is merely unnamed. ```python import hashlib from dataclasses import dataclass, field class TombstoneDivergenceError(RuntimeError): """Raised when an erasure attestation certifies a seed set that is strictly smaller than the derivation closure actually reachable by semantic retrieval.""" pass @dataclass class Memory: mem_id: str content: str provenance: frozenset[str] = field(default_factory=frozenset) # source record ids @dataclass class Attestation: subject_id: str seed_ids: frozenset[str] closure_ids: frozenset[str] digest: str def compute_derivation_closure(subject_id: str, memories: list[Memory], seed_ids: frozenset[str]) -> frozenset[str]: """Transitive closure of memories whose provenance intersects the seed. Returns the set of mem_ids that must be invalidated.""" closure: set[str] = set() frontier = [m for m in memories if m.provenance & seed_ids] while frontier: m = frontier.pop() if m.mem_id in closure: continue closure.add(m.mem_id) # any memory derived from an already-invalidated memory joins the closure frontier.extend( other for other in memories if m.mem_id in other.provenance and other.mem_id not in closure ) return frozenset(closure) def emit_attestation(subject_id: str, memories: list[Memory], seed_ids: frozenset[str], provenance_complete: bool) -> Attestation: if not provenance_complete: # Sound fallback: refuse to certify information-scoped erasure. raise TombstoneDivergenceError( f"cannot attest erasure of {subject_id!r}: provenance is lossy, " f"derivation closure unknown; record-scoped attestation only" ) closure = compute_derivation_closure(subject_id, memories, seed_ids) # The certificate must cover the closure, not the seed. A digest over # seed_ids alone is a false certificate: it names a set strictly smaller # than the information actually removed from reachable state. uncovered = [m for m in memories if m.mem_id in closure and m.provenance & seed_ids] if not uncovered and closure: raise TombstoneDivergenceError( f"attestation for {subject_id!r} covers seed {sorted(seed_ids)} " f"but derivation closure {sorted(closure)} is non-empty; " f"semantic probes would still surface erased content" ) digest = hashlib.sha256( "|".join(sorted(seed_ids | closure)).encode() ).hexdigest() return Attestation(subject_id, seed_ids, closure, digest) def verify_semantic_probe(att: Attestation, probe_hits: list[Memory]) -> None: """Replay a semantic query; any hit whose provenance intersects the attested closure means the attestation is a lie.""" leaked = [m for m in probe_hits if m.provenance & att.closure_ids] if leaked: raise TombstoneDivergenceError( f"attestation {att.digest[:12]} for {att.subject_id!r} is " f"divergent: semantic probe returned {[m.mem_id for m in leaked]} " f"derived from erased closure" ) ```