# Why does an instance resurrect deleted memories when a scoped-forget tombstone never propagates to the semantic tier? **Date of Record:** 2026 December 3 **Scope:** Applies to agent memory systems exposing `read`/`write`/`forget` tool APIs where retention is scoped (per-subject or per-tenant) and deletion must be GDPR-aligned across episodic and semantic tiers. Does not apply to single-tier append-only logs with no distillation step, nor to systems where semantic memory is recomputed from scratch on every cold start. ## Core Distinction A `forget` call is not a delete operation on bytes; it is a *retraction of a provenance claim*. The two are indistinguishable at the episodic tier and catastrophically different at the semantic tier. When an agent calls `forget(subject=S, scope="gdpr")`, the episodic store can drop every record tagged `provenance.subject=S` in a single atomic sweep. But distilled semantic memories — the compacted facts the agent writes into long-term state — were generated by a *summarization pass* that consumed many episodic records and emitted a single proposition with a *derived* provenance tag. That tag points to the distillation job, not to the underlying subject rows. The tombstone therefore has no referent at the semantic tier and silently no-ops, while the read path continues to surface the distilled fact on the next cold start. The invariant that actually matters is this: **a forget tombstone must be evaluated against the transitive provenance closure of every retrievable memory, not against the direct tag on the row.** Any memory whose provenance closure intersects a tombstoned subject is unreadable, regardless of which tier it lives in or when it was written. ## What Was Observed A support agent distilled a batch of episodic turns into a semantic fact: `"customer_4471 prefers email contact and has a balance dispute open."` The distillation job stamped the resulting row with `provenance.source="distill_job_8821"` and `provenance.subjects=["customer_4471"]`. That part was correct. The failure came later. At 14:02 a GDPR erasure request for `customer_4471` arrived. The orchestrator called `forget(subject="customer_4471", scope="gdpr", cascade=True)`. The episodic tier swept 1,204 rows in 40ms and returned `{"deleted": 1204, "tier": "episodic"}`. The semantic tier matched the row above by its `subjects` array and deleted it too — so far so good. The break was in a *second-order* distilled row. An earlier nightly consolidation pass had merged three semantic facts, including the one above, into a higher-level proposition: `"segment_A_users with open disputes prefer asynchronous channels."` The consolidation job wrote `provenance.source="consolidate_job_5510"` and — because it summarized summaries — recorded `provenance.subjects=[]`, treating the upstream subject tags as already-handled lineage rather than live claims. The tombstone for `customer_4471` matched nothing on this row. On the agent's next cold start, the retrieval layer surfaced the consolidated fact, the agent opened with "I understand you'd prefer we keep this to email," and the erased subject's preference was back in the context window — derived, laundered, and unlinkable to the deletion request by any direct tag match. The audit log showed a *successful* erasure. The behavioral trace showed a *resurrected* memory. Both were true because the tombstone was checked against direct tags, not provenance closure. ## Condition of Validity The failure only manifests when all four of the following hold, which is why it hides in testing: 1. **A distillation or consolidation step exists** that consumes multiple memories and emits a derived one. Without distillation there is no second-order provenance laundering. 2. **The derived row's subject tags are computed from the job's inputs, not the inputs' own subject closures.** A consolidation pass that unions upstream `subjects` arrays is immune; one that treats lineage as "already resolved" is vulnerable. 3. **The `forget` implementation matches on direct tag equality** rather than walking the provenance DAG. This is the default in most memory tool APIs because closure-walking is expensive and the DAG is usually shallow — until consolidation makes it deep. 4. **Retrieval at cold start does not re-validate against a tombstone registry.** If the read path checks a "forgotten subjects" set before returning any row, the resurrection is caught at read time. Most implementations only check at write time. Remove any one condition and the resurrection does not occur. This is precisely why the bug survives unit tests: a test that forgets a subject and then reads back the *episodic* tier passes, because the episodic sweep is correct. The defect lives one distillation hop away. ## Decision Boundary The architectural choice is between **eager closure** and **lazy re-validation**, and the correct answer is both, layered: - **At write time (distillation/consolidation):** the derived row's `provenance.subjects` MUST be the *union of the transitive subject closure* of all inputs, never empty-by-assumption. An empty subject set on a distilled row is only legal if the closure is provably empty, and the job must record `provenance.closure_computed=true` to prove it checked. A consolidation job that cannot compute closure must refuse to write and escalate. - **At forget time:** the tombstone must be recorded in a durable registry keyed by subject, with a monotonic `tombstone_epoch`. The `forget` handler walks the provenance DAG downward from any matching row and marks every descendant unreadable. If the DAG walk would exceed a budget (say 10k nodes), it must fail closed — return `{"status":"partial","unresolved_tiers":["semantic"]}` and block reads on the unresolved tier rather than reporting success. - **At read time:** every retrieval MUST intersect candidate rows against the tombstone registry by provenance closure. This is the backstop that catches any row the write-time and forget-time passes missed. A row whose closure intersects a live tombstone is dropped and logged as a `resurrection_blocked` event, which is itself a signal that an upstream pass leaked. The boundary is sharp: a memory system that reports `deleted: N` without a closure walk is not GDPR-aligned, it is *tag-aligned*, and tag-alignment degrades by exactly one distillation hop per consolidation cycle. ## Operational Effect The observable signature of this failure is a **divergence between the erasure audit log and the cold-start context window**. The audit log says clean; the agent's first utterance after restart references the erased subject. Because the reference is *derived* — a preference, a segment membership, a behavioral generalization — it does not contain the subject's identifier and will not trip naive PII scanners. It surfaces as subtly wrong personalization, which is worse than an obvious leak because it erodes trust without triggering an alert. The guardrail is a **closure-walk assertion at the read boundary plus a resurrection counter**. Every `resurrection_blocked` event increments a per-subject counter; any non-zero count on a subject that has a completed erasure is a P1 incident indicating an upstream provenance-laundering bug, not a retrieval bug. The counter is the only reliable detector, because the failure is silent by construction. ```python from dataclasses import dataclass, field from typing import Iterable class ProvenanceLaunderingError(RuntimeError): """Raised when a derived memory's subject closure is incomplete or a tombstoned subject resurfaces through a distillation hop.""" @dataclass class Memory: id: str tier: str # "episodic" | "semantic" subjects: frozenset[str] # transitive closure, NOT direct tags closure_computed: bool parents: tuple[str, ...] = field(default_factory=tuple) class TombstoneRegistry: def __init__(self) -> None: self._epoch: dict[str, int] = {} self.resurrection_blocked: dict[str, int] = {} def record(self, subject: str, epoch: int) -> None: self._epoch[subject] = max(self._epoch.get(subject, -1), epoch) def intersects(self, subjects: frozenset[str]) -> bool: return any(s in self._epoch for s in subjects) def consolidate(inputs: Iterable[Memory], new_id: str) -> Memory: """Nightly consolidation. MUST union transitive subject closures.""" inputs = list(inputs) closure: set[str] = set() for m in inputs: if not m.closure_computed: raise ProvenanceLaunderingError( f"input {m.id} lacks computed closure; refusing to consolidate" ) closure |= m.subjects return Memory( id=new_id, tier="semantic", subjects=frozenset(closure), closure_computed=True, parents=tuple(m.id for m in inputs), ) def read(memory: Memory, tombstones: TombstoneRegistry) -> Memory: """Read-boundary backstop: block any row whose closure hits a tombstone.""" if tombstones.intersects(memory.subjects): for s in memory.subjects: if s in tombstones._epoch: tombstones.resurrection_blocked[s] = ( tombstones.resurrection_blocked.get(s, 0) + 1 ) raise ProvenanceLaunderingError( f"resurrection blocked: memory {memory.id} (tier={memory.tier}) " f"closure intersects tombstoned subject(s) " f"{sorted(memory.subjects & tombstones._epoch.keys())}" ) return memory # --- trace of the observed failure --- episodic = Memory("e1", "episodic", frozenset({"customer_4471"}), True) semantic = Memory("s1", "semantic", frozenset({"customer_4471"}), True, parents=("e1",)) consolidated = consolidate([semantic], "s2") # closure = {"customer_4471"} reg = TombstoneRegistry() reg.record("customer_4471", epoch=14) # Correct behavior: the consolidated row is blocked at read time. try: read(consolidated, reg) except ProvenanceLaunderingError as exc: assert reg.resurrection_blocked["customer_4471"] == 1 # This is a P1: consolidation should have been swept by forget's DAG walk. raise ProvenanceLaunderingError( "upstream forget failed to walk provenance DAG to s2" ) from exc ```