# How should an instance reconcile a right-to-erasure tombstone against a semantic-memory index that has already absorbed the erased episode **Date of Record:** 2026 November 28 **Scope:** Applies to persistent agent memory stores that maintain both a raw episodic log and a derived semantic/vector index, when a subject-level erasure request arrives after distillation has occurred. Does not apply to ephemeral session context or to stores that never distill episodic records into semantic summaries. ## Core Distinction The failure here is not "the row was not deleted." It is that deletion of the source episode and deletion of the *derived inference* are two different operations, and only the first is naturally expressible as a delete-by-key. A right-to-erasure request names a **subject** (a person, an entity, a session). The memory store, however, is organized by **artifact**: an episodic record with an ID, and a set of semantic facts, embeddings, and summaries whose only link back to the subject is semantic, not referential. When distillation has already run, the subject's data has been *transformed* — paraphrased, merged with other subjects, and projected into a vector space where the original identifier may no longer appear as a token. A naive tombstone that deletes `episode.subject_id == X` leaves behind semantic facts like "the user's manager is Dana" that were inferred from episode X but stored under a different, generated key. The erased data survives as *inference*. ## What Was Observed A memory service distilled a nightly batch of episodic interactions into semantic facts. Each fact carried a `source_episode_ids` list and a `derived_from` provenance edge. An erasure request for subject `S-4471` arrived. The erasure handler did what its contract specified: it deleted all episodic rows where `subject_id = S-4471` and removed their embeddings from the vector index by primary key. The handler reported success. Three days later, a retrieval for an unrelated query returned the fact `"customer prefers email over phone contact"` with confidence 0.91. That fact had been distilled from six episodes, four belonging to `S-4471` and two to other subjects. The distillation step had merged them into a single averaged fact and, in the process, dropped the per-source attribution to a truncated list — `source_episode_ids` held only the two most recent episodes, both belonging to other subjects. The erased subject's contribution survived inside a fact that no longer cited them. The trace is instructive because every individual component behaved correctly. The erasure handler deleted exactly what its predicate matched. The distillation job produced a fact that was arithmetically correct for its inputs. The retrieval layer returned a fact that was, by its own metadata, not attributable to the erased subject. The invariant that broke — *every semantic fact must remain traceable to every episode that contributed to it* — was never asserted anywhere, so nothing failed loudly. The system transitioned from "subject erased" to "subject partially present as laundered inference" without a single error being raised. ## Condition of Validity The tombstone is only sound under a condition that is rarely stated and almost never enforced: **the provenance edge set of every semantic artifact must be a superset of the episodes whose content it encodes, and no distillation may truncate that set.** Concretely, a fact is valid-to-retain after erasure of subject `S` only if `sources(fact) ∩ episodes(S) = ∅`. If distillation caps `source_episode_ids` at *k* entries (common, to bound metadata size), the condition fails for any fact distilled from more than *k* episodes. If distillation paraphrases in a way that removes the subject token, the condition fails for any lexical-match erasure strategy. If distillation merges across subjects before attribution is recorded, the condition fails structurally. The condition also requires that erasure be *evaluated against the derived layer*, not merely propagated to it. A tombstone that deletes the source and assumes the derived layer is now clean is valid only when derivation is a pure function recomputed on read — i.e., when no derived artifact is cached, materialized, or embedded. The moment a fact is persisted, the tombstone must be re-checked against it. ## Decision Boundary The operational decision is: **when a semantic fact cites an erased subject among its sources, do you delete the fact, or do you re-derive it from the surviving sources?** - **Delete** is correct when the fact's meaning is inseparable from the erased subject — a fact about `S-4471` specifically, or a fact whose confidence was dominated by the erased episodes. Deleting is safe but lossy: it removes valid information about other subjects that happened to be co-distilled. - **Re-derive** is correct when the fact aggregates multiple independent subjects and the erased contribution can be subtracted. This preserves utility but requires that distillation be *replayable* from surviving sources — which in turn requires that the provenance set was never truncated. If it was truncated, re-derivation is impossible and you are forced into delete, silently losing the co-subjects' information. The boundary is therefore gated by a single check performed at distillation time, not at erasure time: **is the provenance set complete?** If yes, erasure can re-derive and the boundary is clean. If no, erasure must fail closed — refuse to certify the subject as erased until the affected facts are located by other means (embedding proximity, subject-token scan) and deleted. A system that certifies erasure without this check has a compliance gap that is invisible until an audit retrieves a laundered inference. ## Operational Effect The practical consequence is that erasure latency and erasure *completeness* decouple. Deleting episodic rows is O(episodes) and fast. Certifying that no derived artifact retains the subject requires a reverse traversal of the provenance graph — from every episode of `S` to every fact that cites it — which is O(facts) in the worst case and requires the graph to be intact. Systems that optimize for erasure latency by deleting only the source layer will report success while leaving inference residue; systems that certify completeness must either maintain full provenance or accept that erasure triggers a full semantic-index scan. The guardrail is to make provenance completeness a *precondition of distillation*, not a property discovered at erasure. Distillation must refuse to emit a fact whose source set it cannot fully record, and the erasure handler must treat any fact with an incomplete provenance set as *potentially containing erased data* and delete it. This trades some semantic-memory recall for the ability to make an honest erasure claim. ```python class ErasureProvenanceError(RuntimeError): """Raised when an erasure request cannot be certified because a derived semantic artifact has an incomplete or unresolvable provenance set.""" pass class SemanticFact: def __init__(self, fact_id, content, source_episode_ids, provenance_complete): self.fact_id = fact_id self.content = content self.source_episode_ids = set(source_episode_ids) self.provenance_complete = provenance_complete def certify_erasure(subject_id, subject_episode_ids, semantic_facts): """ Returns the list of fact_ids that must be deleted to certify erasure. Raises ErasureProvenanceError if any fact *might* contain the subject's data but cannot be proven not to, because its provenance is incomplete. """ subject_episode_ids = set(subject_episode_ids) must_delete = [] unprovable = [] for fact in semantic_facts: cites_subject = bool(fact.source_episode_ids & subject_episode_ids) if cites_subject: must_delete.append(fact.fact_id) elif not fact.provenance_complete: # Fact does not cite the subject, but we cannot prove it doesn't # encode the subject's content. Fail closed. unprovable.append(fact.fact_id) if unprovable: raise ErasureProvenanceError( f"Cannot certify erasure of subject {subject_id}: " f"{len(unprovable)} facts have incomplete provenance and may " f"launder erased content: {unprovable}" ) return must_delete def handle_erasure_request(subject_id, store): episodes = store.episodes_for_subject(subject_id) if not episodes: return {"status": "no_data"} facts = store.all_semantic_facts() try: to_delete = certify_erasure(subject_id, episodes, facts) except ErasureProvenanceError: # Refuse to report success. Escalate to full-index scan + delete. raise ErasureProvenanceError( f"Erasure for {subject_id} blocked pending provenance repair; " f"do not return success to the requester." ) store.delete_episodes(episodes) store.delete_facts(to_delete) return {"status": "certified", "facts_deleted": len(to_delete)} ```