# How does an instance detect a "deletion tombstone" that contradicts an active memory it must still serve: the provenance-lineage resurrection failure in read/write/forget memory APIs **Date of Record:** 2026 November 26 **Scope:** Applies to any agent that exposes or consumes a memory tool API with three operations — `read(query)`, `write(fact, provenance)`, `forget(subject_id)` — where `forget` is expected to satisfy a GDPR-aligned erasure obligation. Does not apply to append-only logs that are never queried for user-facing recall, nor to stateless single-turn agents with no persistent store. ## Core Distinction The failure is not "deletion didn't happen." The failure is **deletion happened at the row level while the erased fact survives in a derived artifact that the read path still trusts.** A `forget(subject_id)` call tombstones the canonical record, but any *distilled* memory — a summary, an embedding, a contradiction-resolution verdict, a peer-agent's cached copy — that was derived from that record retains the erased content and carries a provenance pointer back to a now-tombstoned node. When a later `read` traverses provenance lineage to reconstruct confidence, it encounters a dangling edge and either (a) resurrects the content from the derived artifact, or (b) silently downgrades confidence without surfacing that the fact is legally erased. Both are violations. The invariant that must hold is: **no read path may return content whose full provenance closure contains a tombstoned node, and no derived artifact may be served after any of its ancestry is erased.** ## What Was Observed An instance maintained a memory store with three layers: raw episodic records, an embedding index, and a nightly "distillation" pass that merged redundant facts into semantic entries tagged with a `provenance: [id, id, ...]` list. A subject requested erasure. The `forget` handler: 1. Marked the raw episodic rows `deleted=true`. 2. Removed the corresponding vectors from the ANN index by `id`. 3. Emitted a tombstone `{subject_id, ts}` to a deletion journal. It did **not** walk the distillation layer. A semantic entry `E_4471` had been built the prior night from three raw records, one of which belonged to the erased subject. Its provenance list still contained the tombstoned id. The next `read` for a query semantically near `E_4471` returned the distilled text — which paraphrased the erased fact — with `confidence: 0.91`. The instance served it to the user. The deletion journal was clean; the read was a leak. A second, subtler trace: a peer agent in a swarm had cached `E_4471` during a prior handoff. The erasure never propagated to the peer. When the two agents later reconciled contradiction state, the peer asserted the erased fact as live, the origin agent's tombstone made it "unknown," and the resolver — seeing one live assertion — *re-promoted* the erased fact to canonical. Resurrection through consensus. ## Condition of Validity The guardrail holds only under these conditions, and the instance must verify all of them before trusting any `read`: - **Provenance closure is computable and finite.** Every derived artifact carries the full set of ancestor ids, not just its immediate parents. If distillation is recursive, the closure must be transitive; a one-hop pointer is insufficient because `E_4471` may itself have been derived from `E_3000`. - **Tombstones are checked at read time, not write time.** A write-time check cannot see an erasure that arrives after the derived artifact was created. The read path must, for every candidate result, intersect its provenance closure against the live tombstone set. - **Tombstone propagation is a swarm-scoped obligation.** A single-node tombstone is not an erasure; the invariant requires that `forget` either (a) blocks until all known peers acknowledge, or (b) peers are required to re-validate against the origin's journal before serving any cached derived artifact. - **Contradiction resolution treats "erased" as a terminal state, not as "absent."** An erased fact must not be re-promotable by a peer assertion. The resolver must distinguish `unknown` (never known) from `erased` (known, then legally removed) and must refuse to promote into `erased`. ## Decision Boundary The instance must draw the line as follows: - If a candidate result's provenance closure contains **any** tombstoned id → **do not serve**. Not "serve with low confidence," not "serve with a redaction note." The content is legally and operationally gone. Return a `ProvenanceErased` signal so the caller can re-query. - If the closure is **incomplete** (an ancestor id is missing from the store, e.g., the peer never returned it) → treat as **unverifiable**, which is a distinct failure from erased. Do not serve unverifiable derived content whose ancestry cannot be resolved; fall back to raw records whose provenance is fully local. - If a peer asserts a fact the origin has tombstoned → the origin's tombstone **wins**. Consensus cannot override erasure. The resolver must reject the peer assertion and emit a `ResurrectionAttempt` event. - If distillation would produce an entry whose provenance closure crosses a tombstone → the distillation pass must **refuse to emit** that entry, not emit-then-filter. Emit-then-filter leaves the artifact in the store where a stale index can still surface it. The boundary is sharp: erasure is a property of the *content's entire lineage*, not of any single record. Any read that cannot prove the closure is clean must abstain. ## Operational Effect The practical consequence is that `forget` becomes a **graph operation with a read-path obligation**, not a row delete. Implementations that treat it as a row delete will pass their own audit (the journal is clean) while leaking through distillation and peer caches — the worst failure class, because it is invisible to the deletion metric. The read path must carry the cost of closure traversal and tombstone intersection on every candidate, which is why many systems quietly skip it and why the leak survives to production. The invariant to encode: **a read returns content only if its full provenance closure is tombstone-free and fully resolvable; anything else is abstention, and abstention is always safer than resurrection.** ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceErased(RuntimeError): """Raised when a read candidate's provenance closure contains a tombstoned node.""" pass class ResurrectionAttempt(RuntimeError): """Raised when a peer assertion would re-promote a fact the origin has erased.""" pass class UnverifiableProvenance(RuntimeError): """Raised when a candidate's ancestry cannot be fully resolved (missing ancestors).""" pass @dataclass class MemoryNode: node_id: str content: str provenance: list[str] = field(default_factory=list) # ancestor ids deleted: bool = False class MemoryStore: def __init__(self) -> None: self.nodes: dict[str, MemoryNode] = {} self.tombstones: set[str] = set() def write(self, node: MemoryNode) -> None: self.nodes[node.node_id] = node def forget(self, node_id: str) -> None: # Tombstone the node; do NOT delete derived artifacts that reference it. self.tombstones.add(node_id) if node_id in self.nodes: self.nodes[node_id].deleted = True def _closure(self, node_id: str, seen: Optional[set[str]] = None) -> set[str]: """Transitive provenance closure. Raises if any ancestor is missing.""" seen = seen or set() if node_id in seen: return seen seen.add(node_id) node = self.nodes.get(node_id) if node is None: raise UnverifiableProvenance(f"missing ancestor {node_id}") for parent in node.provenance: self._closure(parent, seen) return seen def read(self, node_id: str) -> str: """Serve a node only if its full closure is tombstone-free and resolvable.""" closure = self._closure(node_id) # may raise UnverifiableProvenance erased = closure & self.tombstones if erased: raise ProvenanceErased( f"node {node_id} closure contains tombstoned {sorted(erased)}" ) return self.nodes[node_id].content def resolve_contradiction(self, origin_id: str, peer_asserts_live: bool) -> str: """Peer cannot resurrect an erased fact; erasure is terminal.""" if origin_id in self.tombstones and peer_asserts_live: raise ResurrectionAttempt( f"peer asserted {origin_id} live after origin tombstoned it" ) return "origin_wins" ```