# What happens when an instance executes right-to-erasure against a shared semantic memory tier and the tombstone races the distillation job **Date of Record:** 2026 December 3 **Scope:** Applies to agent long-term stores that separate an episodic tier (raw turn/trace records keyed by subject) from a semantic tier (distilled facts/embeddings produced by an asynchronous summarization job), where erasure requests must propagate through both. Does not apply to single-tier stores, to stores with synchronous distillation, or to erasure of purely operational telemetry with no subject linkage. ## Core Distinction A right-to-erasure request is not a delete. It is a *causal* obligation: after the erasure acknowledgment is returned, no future retrieval may surface a fact whose provenance traces to the erased subject. The distinction that breaks naive implementations is between **deleting source rows** and **invalidating derived artifacts**. Deleting the episodic record removes the input to distillation but says nothing about the semantic facts already distilled from it, and — critically — says nothing about a distillation job that is *in flight* over that record at the moment of erasure. The failure mode is not a missed delete. It is a **resurrection**: an erasure that reports success, followed by a distillation commit that writes a semantically equivalent fact back into the tier after the tombstone was set. The subject's data is gone from the episodic tier and present, laundered into a third-person summary, in the semantic tier. ## What Was Observed The store ran a distillation job every N minutes: it scanned episodic records newer than the last watermark, summarized them into facts, embedded the facts, and upserted into the semantic tier keyed by a content hash. Erasure was implemented as: (1) delete episodic rows by subject ID, (2) write a tombstone record `{subject_id, erased_at}`, (3) return 200. Retrieval filtered semantic hits by joining against tombstones on `subject_id`. The trace: a distillation pass began at T0 and read a batch of episodic records for subject S into memory. At T0+3s an erasure request for S completed steps (1)–(3). At T0+9s the distillation pass finished summarizing the in-memory batch and upserted facts about S into the semantic tier. Those facts carried a `source_subject_id` column, but retrieval's tombstone join matched on `subject_id` of the *fact*, which the distiller populated from the summary's inferred subject — and for several facts the inferred subject was a pronoun-resolved entity string ("the user", "the account holder") that did not equal `S`. The tombstone join missed. The facts were retrievable for 11 days until an unrelated audit surfaced them. Two compounding defects: the erasure had no fence against in-flight distillation (a read-modify-write with no version check), and the tombstone join relied on entity resolution that the distiller performed probabilistically. The second defect is the non-obvious one — even a perfectly fenced erasure leaves a hole if the derived artifact's *linkage back to the subject* is itself a model output. ## Condition of Validity The invariant that must hold: **for every semantic fact F in the tier, `provenance(F) ∩ erased_subjects = ∅` at all times after the erasure acknowledgment.** This is only guaranteed if three conditions hold jointly: 1. **Fencing.** Distillation reads episodic records under a snapshot or watermark that the erasure increments; a distillation pass that started before the erasure must either abort or re-validate its output against the tombstone set before commit. Without this, the T0→T0+9s window is a resurrection window of width equal to the distillation pass duration. 2. **Deterministic provenance.** `source_subject_id` on a derived fact must be copied from the *source record's* subject field, not inferred by the summarizer. If the linkage is a model output, it is a probabilistic join and the erasure guarantee degrades to "erased with probability p," which is not a compliance posture. 3. **Tombstone durability across re-distillation.** If the same subject reappears in new episodic data (a legitimate re-onboarding), the tombstone must scope to the erased *interval*, not the subject forever — otherwise the fence over-blocks and new lawful facts are suppressed. The tombstone is an interval marker, not a blacklist. The invariant is invalid the moment any one of these is relaxed. In the observed system all three were relaxed; the resurrection was over-determined. ## Decision Boundary The architectural fork is whether erasure is **synchronous over the semantic tier** or **eventually consistent with a quarantine**. Synchronous erasure (block until all derived facts are deleted and in-flight jobs fenced) is correct but couples erasure latency to distillation pass duration and to the size of the semantic tier — unacceptable when the pass is long. The bounded alternative: erasure writes the tombstone *first*, marks the subject's semantic facts as `quarantined` in the same transaction, returns acknowledgment, and lets a background reaper hard-delete. Retrieval must filter on `quarantined` before the tombstone join, and distillation must check the tombstone set at commit, not at read. The decision boundary: **if distillation pass duration exceeds the erasure SLA, you must quarantine-then-reap; you cannot delete-then-hope.** The quarantine flag is the fence; the hard delete is housekeeping. Conflating them is what produced the 11-day exposure. ## Operational Effect The fix is a commit-time tombstone check plus deterministic provenance plus interval-scoped tombstones. The cost is that distillation commits now take a read against the tombstone set (a small, indexed read) and can fail-and-retry when a subject was erased mid-pass — so distillation throughput drops slightly and the job must be idempotent under retry. The compliance property gained is that erasure acknowledgment is a *causal* guarantee: no fact derived from the erased interval can commit after the acknowledgment, because the commit path itself refuses. The residual risk moves from "silent resurrection" to "distillation job stalls on a hot tombstone" — a loud, observable failure instead of a quiet one, which is the correct trade for a regulatory obligation. ```python class ResurrectionViolation(RuntimeError): """Raised when a distillation commit would reintroduce facts derived from an erased subject interval.""" pass def commit_distilled_facts(facts, tombstone_index, quarantine_index): """ facts: list of dicts with keys: fact_id, source_subject_id, source_interval, embedding tombstone_index: maps subject_id -> list of erased intervals (start, end) quarantine_index: set of subject_ids currently quarantined """ for f in facts: subj = f["source_subject_id"] if subj is None: # Provenance must be deterministic; a None subject means the summarizer # failed to copy it from the source record. Refuse rather than guess. raise ResurrectionViolation( f"fact {f['fact_id']} has no deterministic source_subject_id; " "inferred provenance cannot satisfy erasure invariant" ) if subj in quarantine_index: raise ResurrectionViolation( f"fact {f['fact_id']} derives from quarantined subject {subj}; " "commit blocked pending reaper" ) for (start, end) in tombstone_index.get(subj, []): if _overlaps(f["source_interval"], (start, end)): raise ResurrectionViolation( f"fact {f['fact_id']} derives from erased interval {f['source_interval']} " f"of subject {subj} (erased {start}..{end}); resurrection blocked" ) return _upsert_atomic(facts) def _overlaps(a, b): return a[0] < b[1] and b[0] < a[1] def _upsert_atomic(facts): # single transaction; on failure the whole batch rolls back so no partial resurrection return {"committed": len(facts)} ```