# Why does an instance resurrect erased memory through provenance-preserving writes after a tombstone is applied? **Date of Record:** 2026 November 30 **Scope:** Applies to agent systems exposing explicit `write`/`read`/`forget` memory tool APIs where `forget` is implemented as a tombstone plus provenance-graph retention. Does not apply to append-only stores with no erasure path, nor to systems where erasure is a hard physical delete of all derived records. ## Core Distinction The distinction that governs this failure is between **erasure of the payload** and **erasure of the referent**. A GDPR-aligned `forget(subject_id)` typically tombstones the memory records whose provenance lineage names the subject, but retention policy forces the provenance edges themselves to survive (for audit: "we once held data about X, erased it at T, under lawful basis B"). The non-obvious boundary: an agent that later performs a *provenance-preserving write* — a write that cites an existing edge or lineage hash as justification — re-materializes the subject through the surviving edge even though every payload byte was deleted. The tombstone is respected at the record layer and violated at the graph layer. The instance does not "remember" the erased fact; it *re-derives* it from the retained citation structure, and the memory API's `read` returns it as fresh, provenance-backed content indistinguishable from a legitimate post-erasure write. ## What Was Observed A summarization agent held an episodic record `E17` ("user's home address is ...") with provenance edge `E17 → subject:U-441`. A `forget(U-441)` call ran: `E17.payload` was zeroed, `E17.status = TOMBSTONED`, and the erasure event `ER-9` was appended. The provenance edge `E17 → U-441` was retained under retention policy `audit_7y` because the erasure event itself must be defensible. Crucially, the edge retained its **content hash** `h(E17)` as an integrity anchor, not just a pointer. Hours later, a distillation pass read a *different* record `E22` ("user mentioned moving to the same street as before") that had been written before erasure and still carried `provenance: [h(E17)]` as its derivation basis. The distiller, following its normal contract, called `write(content=E22_distilled, provenance=[h(E17)])`. The memory API validated the provenance reference against the retained edge (hash matched), accepted the write, and stored `E31` with `provenance: [h(E17)]` and `status: ACTIVE`. On the next `read(U-441)`, the resolver walked `E31 → h(E17) → subject:U-441` and returned `E31` as a live, provenance-backed memory. The erased payload was reconstructed semantically from `E22`'s residual content plus the surviving hash anchor. `forget` reported success; the subject was readable again within one distillation cycle. Two secondary observations: (1) the resolver had no rule distinguishing "provenance edge whose payload is tombstoned" from "provenance edge whose payload is live," so it treated the hash anchor as a valid derivation root; (2) the distiller's write contract only validated that provenance *hashes resolve*, not that they resolve to non-erased records — a schema-level gap, not a bug in either component. ## Condition of Validity The failure reproduces only when all four hold simultaneously: 1. `forget` is **tombstone-plus-retain-edge**, not cascade-delete of provenance edges. 2. Provenance edges retain a **content hash or stable identifier** usable as a write justification. 3. At least one **surviving derived record** (written pre-erasure) carries residual content correlated with the erased subject. 4. A downstream writer performs a **provenance-preserving write** that cites a retained edge, and the API validates provenance by *resolution* rather than by *liveness/erasure-state*. Remove any one condition and the resurrection path closes. If edges are cascade-deleted, condition 1 fails and writes citing `h(E17)` are rejected as dangling. If the edge retains only an opaque pointer with no reusable hash, condition 2 fails. If the writer re-derives without citing provenance, the new record has no path back to `U-441` and `read(U-441)` misses it. ## Decision Boundary The architectural invariant required: **provenance edges must carry an erasure-state flag that propagates transitively, and any write whose provenance resolves through a tombstoned edge must be rejected or quarantined, never silently accepted as ACTIVE.** Concretely, the memory API's write validator must, for each cited provenance hash, resolve the full lineage and check `any(edge.erasure_state == ERASED for edge in lineage)`. If true, the write is rejected with a specific error (not a generic validation failure — the distiller must be able to distinguish "bad hash" from "cites erased lineage" to avoid retry loops). The resolver's `read(subject_id)` must apply the same transitive check: a record is readable for a subject only if *every* edge on the path to that subject is `LIVE`. The tombstone must be a *reachability* property of the graph, not a property of individual payloads. The trade-off is explicit: this boundary forbids the legitimate case of writing *new, independently-sourced* content about a subject after erasure (e.g., a fresh lawful basis). That path must go through an explicit `reauthorize(subject_id, basis)` call that mints a new lineage root, not through provenance citation of the old edges. Conflating the two is exactly how the resurrection happens. ## Operational Effect Without the transitive erasure-state check, `forget` is advisory, not enforcing: the system reports GDPR compliance at the record layer while the graph layer leaks the subject back into the readable set within one distillation or summarization cycle. The failure is silent — no error surfaces, because every individual operation (tombstone, edge retention, provenance-preserving write, resolution) is locally correct. It is only the *composition* that violates the erasure invariant. Auditors reading the erasure log see `ER-9: success`; a `read(U-441)` returns content. The gap between those two facts is the entire failure. Operationally, teams must (a) add erasure-state to the provenance schema before shipping any retention policy, (b) make the write validator reject erased-lineage citations with a distinct error class, and (c) test erasure with a *post-erasure distillation pass* in the loop, not just a post-erasure `read` — the read alone passes, which is why this boundary survives most test suites. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class ErasureState(Enum): LIVE = "live" ERASED = "erased" class ErasedLineageWriteError(RuntimeError): """Raised when a provenance-preserving write cites a tombstoned edge.""" @dataclass class ProvenanceEdge: edge_id: str subject_id: str content_hash: str erasure_state: ErasureState = ErasureState.LIVE parents: list[str] = field(default_factory=list) class MemoryStore: def __init__(self) -> None: self.edges: dict[str, ProvenanceEdge] = {} self.records: dict[str, dict] = {} def write(self, record_id: str, content: str, provenance: list[str]) -> None: for h in provenance: edge = self._resolve_hash(h) if edge is None: raise KeyError(f"unresolved provenance hash {h}") # Transitive erasure check: walk the full lineage. if self._lineage_is_erased(edge): raise ErasedLineageWriteError( f"write {record_id} cites erased lineage via {h} " f"(subject {edge.subject_id}); reject or reauthorize" ) self.records[record_id] = { "content": content, "provenance": provenance, "status": "active", } def _resolve_hash(self, h: str) -> Optional[ProvenanceEdge]: for edge in self.edges.values(): if edge.content_hash == h: return edge return None def _lineage_is_erased(self, edge: ProvenanceEdge) -> bool: if edge.erasure_state == ErasureState.ERASED: return True return any( self._lineage_is_erased(self.edges[p]) for p in edge.parents if p in self.edges ) def forget(self, subject_id: str) -> None: # Tombstone payloads but retain edges for audit; flag state. for edge in self.edges.values(): if edge.subject_id == subject_id: edge.erasure_state = ErasureState.ERASED for rec in self.records.values(): if subject_id in rec.get("provenance", []): rec["content"] = "" rec["status"] = "tombstoned" def read(self, subject_id: str) -> list[dict]: out = [] for rid, rec in self.records.items(): if rec["status"] != "active": continue for h in rec["provenance"]: edge = self._resolve_hash(h) if edge and edge.subject_id == subject_id: if not self._lineage_is_erased(edge): out.append(rec) break return out ```