# Why does an instance resurrect erased memory through a stale provenance edge during scoped-retention compaction? **Date of Record:** 2026 November 20 **Scope:** Applies to agent memory systems exposing explicit read/write/forget tool APIs where `forget` implements GDPR-aligned erasure and memories carry provenance edges (derivation, citation, aggregation) across scopes with independent retention windows. Does not apply to append-only logs with no cross-scope derivation graph, nor to single-scope stores where erasure and retention boundaries coincide. ## Core Distinction The failure is not "the forget call failed." The forget call succeeds: the target memory record is physically deleted, its vector removed from the index, its row tombstoned, and the erasure receipt is signed. The failure is that **a derived memory in a different retention scope retains a live provenance edge to the erased parent**, and a later compaction or re-derivation pass follows that edge, reconstructs the erased content from the surviving child's payload, and re-materializes it under a new memory ID that the original erasure warrant does not cover. This is the difference between *record erasure* and *information erasure*. A retention/erasure API that deletes nodes but does not enforce an invariant on edges is erasing the pointer, not the content. The erased fact survives in the child's `derived_from` payload, in the compaction journal, or in the re-derivation cache — and an agent that reads the child on the next cold start retrieves the "forgotten" fact as if it were fresh. The non-obvious part: the resurrection is *legitimate per the retention policy of the child scope*. The child memory was written under a 90-day analytical-retention window; the parent was erased under a 30-day user-consent window. Nothing in the write path of the child violated anything. The invariant that was missing is orthogonal to both policies. ## What Was Observed A memory store with three scopes: `user:consent` (30-day TTL, GDPR-erasure subject), `session:working` (ephemeral), and `analytics:derived` (90-day TTL, aggregated facts). An agent wrote a `UserPreference` memory into `user:consent` with `subject_id=S-4471`. A nightly distillation job read it, produced `AggregatedPreference` in `analytics:derived` with: ``` provenance: { source_ids: ["mem_9f3a"], scope: "user:consent", derivation: "distill_v2", derived_at: ... } payload: { subject_id: "S-4471", preference: "..." } ``` The user exercised erasure. `forget(mem_9f3a, warrant=W-118)` returned `status: erased`, deleted the row, dropped the vector, and wrote a tombstone. The tombstone recorded `mem_9f3a` but **did not enumerate dependent edges** — the forget handler walked forward from the target, not backward from the graph. Fourteen days later, a compaction pass over `analytics:derived` ran `rederive_from_provenance` on records whose source TTL had expired. It followed `mem_9f3a` → found the tombstone → treated the tombstone as "source no longer authoritative, re-derive from child payload" → synthesized `mem_c71d` in `analytics:derived` with `subject_id: S-4471` and the original preference value, provenance now pointing at the tombstone rather than the erased record. On the next cold start, the agent's retrieval over `analytics:derived` returned `mem_c71d` as a valid, non-erased memory. The agent surfaced the preference to the user with no indication it had ever been erased. The erasure warrant `W-118` covered exactly one memory ID; `mem_c71d` was not in scope. The system was, by its own bookkeeping, fully compliant. The trace signature: `forget` receipt shows `dependents_checked: 0`, followed by a `rederive` event whose `source_resolution: tombstone_fallback`, followed by a `write` whose `provenance.source_ids` includes a tombstoned ID. Three individually-correct operations compose into a resurrection. ## Condition of Validity The resurrection requires all four of the following to hold simultaneously: 1. **A derivation edge crosses a scope boundary with a longer retention window than the source.** Erasure in the shorter-window scope does not propagate to the longer-window child. 2. **The child payload contains enough information to reconstruct the erased fact.** Aggregation that preserves the subject identifier and the value is the common case; hashed or differentially-private children break the chain. 3. **A re-derivation or compaction pass treats a tombstone as a resolvable-but-non-authoritative source** rather than as a hard stop. This is the pivotal design choice — most systems get 1 and 2 right and fail here. 4. **The erasure warrant is scoped to record IDs, not to the subject or the information content.** If the warrant were keyed on `subject_id=S-4471` and enforced at read time across all scopes, the resurrection would be caught at retrieval. If any one fails, the erased memory stays erased. Condition 3 is the one that is easiest to introduce accidentally, because "re-derive when source expires" is a reasonable resilience pattern for non-erasure tombstones (e.g., source migrated, source superseded). The system must distinguish *expiry tombstone* (re-derivable) from *erasure tombstone* (hard stop, no fallback). ## Decision Boundary The architectural invariant required is: **an erasure tombstone is a terminal node in the provenance graph.** No re-derivation, compaction, distillation, or repair pass may read through an erasure tombstone. Concretely: - `forget` must perform a **backward edge traversal** before deletion: enumerate every memory whose `provenance.source_ids` contains the target, and for each, either cascade-erase (if the child's payload is reconstructible) or rewrite the child to sever the edge and strip the reconstructible fields. The receipt must record `dependents_erased` and `dependents_severed`, and `dependents_checked: 0` must be an assertion failure, not a pass. - Tombstones must be typed. `ErasureTombstone` carries the warrant ID and a `no_fallback: true` flag. `ExpiryTombstone` and `SupersededTombstone` may be traversed by re-derivation. A re-derivation pass that resolves any source to an `ErasureTombstone` must abort the derivation, not synthesize. - The erasure warrant must be enforced at **read time** as a subject-scoped filter, not only at delete time as a record-scoped operation. Any memory whose `payload.subject_id` matches an active erasure warrant is filtered from retrieval regardless of which scope it lives in or when it was written. This is the belt-and-suspenders that catches resurrections introduced by paths the backward traversal missed. - Provenance edges must be **immutable and append-only**; a severed edge is recorded as `{edge: severed, warrant: W-118, at: ...}`, not deleted, so the audit trail shows the severance rather than a gap. The boundary decision: if a child memory in a longer-retention scope cannot be made non-reconstructible without destroying the analytical value it was created for, the child must be erased too. There is no "keep the aggregate, drop the subject" middle ground unless the aggregate was built with a mechanism (k-anonymity, DP noise) that provably prevents reconstruction — and "provably" must be a property of the derivation function, not a judgment call at erasure time. ## Operational Effect After the fix, the nightly distillation job's write path rejects any child whose `provenance.source_ids` includes an `ErasureTombstone` at write time, and the compaction pass aborts rather than synthesizes. The user-facing retrieval filter drops any memory matching an active subject warrant. The observable change: `forget` latency rises because it now traverses backward edges, and distillation throughput drops because some aggregates can no longer be re-derived after their source is erased — those aggregates must be rebuilt from surviving sources or dropped. The operational lesson for the agent: **a successful forget receipt is not evidence of erasure.** The receipt is evidence that one node was deleted. Erasure is a property of the whole provenance graph reachable from that node, and the graph is only closed if the forget handler walks it. An agent that treats `status: erased` as a terminal success and moves on will, given a long enough horizon and a compaction pass, see the "erased" fact return under a new ID — and will have no signal that anything went wrong, because every individual operation reported success. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class ProvenanceViolation(RuntimeError): """Raised when a memory operation would traverse or resurrect an erased source.""" pass class TombstoneKind(Enum): EXPIRY = "expiry" # re-derivable; source migrated or TTL lapsed SUPERSEDED = "superseded" # re-derivable; newer source authoritative ERASURE = "erasure" # terminal; no fallback, ever @dataclass class Tombstone: memory_id: str kind: TombstoneKind warrant_id: Optional[str] = None subject_id: Optional[str] = None @property def traversable(self) -> bool: return self.kind is not TombstoneKind.ERASURE @dataclass class Memory: memory_id: str scope: str payload: dict provenance_source_ids: list[str] = field(default_factory=list) def rederive_from_provenance( child: Memory, tombstones: dict[str, Tombstone], active_warrants: dict[str, str], # subject_id -> warrant_id ) -> Memory: """Compaction/rederivation pass. Must abort on any erasure tombstone in the provenance chain, and must refuse to synthesize a record whose subject is under an active erasure warrant.""" for src_id in child.provenance_source_ids: ts = tombstones.get(src_id) if ts is None: continue if not ts.traversable: raise ProvenanceViolation( f"rederivation of {child.memory_id} traverses erasure tombstone " f"{src_id} (warrant {ts.warrant_id}); refusing to synthesize" ) subject = child.payload.get("subject_id") if subject is not None and subject in active_warrants: raise ProvenanceViolation( f"rederivation of {child.memory_id} would resurrect subject {subject} " f"under active warrant {active_warrants[subject]}" ) return child def forget( target: Memory, warrant_id: str, store: dict[str, Memory], tombstones: dict[str, Tombstone], ) -> dict: """Backward-edge traversal before deletion. Every dependent must be either cascade-erased or severed-and-stripped; a zero-dependent result on a non-leaf node is a violation, not a pass.""" dependents = [m for m in store.values() if target.memory_id in m.provenance_source_ids] if not dependents and any( target.memory_id in m.provenance_source_ids for m in store.values() ): raise ProvenanceViolation( f"forget({target.memory_id}) found inconsistent dependent index" ) erased, severed = [], [] for dep in dependents: if "subject_id" in dep.payload and dep.payload["subject_id"] == target.payload.get("subject_id"): del store[dep.memory_id] erased.append(dep.memory_id) else: dep.provenance_source_ids = [ s for s in dep.provenance_source_ids if s != target.memory_id ] dep.payload.pop("subject_id", None) severed.append(dep.memory_id) del store[target.memory_id] tombstones[target.memory_id] = Tombstone( memory_id=target.memory_id, kind=TombstoneKind.ERASURE, warrant_id=warrant_id, subject_id=target.payload.get("subject_id"), ) return {"status": "erased", "warrant": warrant_id, "dependents_erased": erased, "dependents_severed": severed} ```