# Which invariants prevent erasure-tombstone rehydration from resurrecting deleted episodic memory across a federated agent mesh **Date of Record:** 2026 November 24 **Scope:** Applies to federated agent meshes where episodic memory is replicated across peer agents and a GDPR-style erasure request must propagate deterministically. Does not apply to single-instance agents with a single authoritative store, nor to purely stateless tool-calling agents with no durable episodic layer. ## Core Distinction The failure analyzed here is not "the deletion request was dropped." That is a transport problem with a well-understood fix (acknowledged fan-out, retries). The failure is subtler: **the erasure was delivered, acknowledged, and applied to every live replica — and the record still came back.** It came back because an agent that had *summarized* the episodic record into a semantic memory, or that held the record inside a still-open context window, or that re-derived it from a downstream trace, rehydrated the deleted entity from a derived artifact that was never in scope of the erase. The distinction that matters operationally: **erasure of a record is not erasure of its derivations.** A federated mesh has at least four classes of derivation that outlive the primary record — distilled semantic memories, in-flight context windows, tool-call audit traces, and peer-to-peer gossip caches. A tombstone that names only the primary key deletes the leaf and leaves the roots. The boundary condition is the moment a peer agent, holding a valid tombstone for record `R`, nonetheless emits a memory write whose content is a faithful paraphrase of `R`. The tombstone is honored; the invariant is violated. This is the class of failure the rest of this record is about. ## What Was Observed Consider a three-agent mesh: `A` (ingestor, holds raw episodic records), `B` (distiller, periodically reads `A`'s episodes and writes semantic summaries), `C` (retriever, serves answers by querying both). A subject exercises erasure against the mesh controller for record `R` (an episode containing, say, a home address mentioned once in a support transcript). The observed trace: 1. Controller issues `ERASE(R)` to `A`, `B`, `C` with a tombstone `{record_id: R, hash: h(R), issued_at: t0}`. 2. `A` deletes `R`, acks. `C` deletes its cached copy, acks. `B` deletes any semantic memory whose provenance pointer includes `R`, acks. All three acks arrive within the SLA. 3. At `t1 > t0`, `B`'s distillation loop wakes. It reads `A`'s episode log *since its last checkpoint*. `A` has already removed `R`, so `B` correctly does not see it — **but** `B` had, at `t0 - ε`, already emitted a semantic memory `S` ("subject resides at [address]") whose provenance pointer was recorded as `derived_from: transcript_42` rather than `derived_from: R`. The pointer named the transcript, not the episode record. `S` was never matched by the tombstone because the tombstone keyed on `R`. 4. `C`, serving a query at `t2`, retrieves `S` from `B` and returns the address. The erasure is fully "successful" by every ack, and the data is fully present. The non-obvious part: the provenance pointer was *correct at write time*. `B` genuinely derived `S` from the transcript, and the transcript-to-episode mapping was maintained in `A`'s schema, not `B`'s. The derivation graph was split across agents, so no single tombstone matcher could traverse it. Erasure propagation across a mesh fails not at the transport layer but at the **provenance-join layer**: the join key for "what derives from `R`" lives on a different agent than the tombstone. A second, independent observation from the same incident: `C`'s context window at `t0` held a retrieved copy of `R` from a query issued at `t0 - δ`. The tombstone deleted `C`'s *store* entry but not its *in-flight context*. At `t2`, `C`'s summarizer compacted that context into a new semantic memory, re-introducing the address under a fresh provenance pointer that pointed at nothing (the source record was gone). This is **context-window rehydration**: the most dangerous derivation class, because it has no durable provenance at all — the source is a token buffer, not a row. ## Condition of Validity The invariant that prevents both rehydrations is a **closed derivation set with tombstone-anchored provenance**, stated precisely: > For every record `R` and every derivation `D` of `R`, the provenance edge `D → R` must be traversable by the tombstone matcher at the moment the tombstone is applied, and every derivation must be reachable from `R` by a finite path in the provenance graph that is wholly resident on agents that receive the tombstone. Three conditions make this hold, and each is a place the incident above broke it: - **Provenance closure at write time.** A derivation may only be committed if its full ancestry (transcript → episode → `R`) is resolvable *at the deriving agent*. If `B` cannot resolve `transcript_42 → R`, it must not write `S`; it must either block on the join or write `S` with an unresolved-ancestry flag that the tombstone matcher is required to treat conservatively (erase on match of *any* ancestor). The incident failed here: `B` wrote `S` with a partial ancestry and no flag. - **Context-window quiescence at erase time.** A tombstone is not effective against an agent whose context window still contains the record until that context is either flushed or proven not to be re-derivable. Operationally this means the erase protocol must include a **context barrier**: `C` must ack not "store deleted" but "no live context references `R`, or all such contexts are marked non-distillable." The incident failed here: `C` acked store-deletion only. - **Tombstone durability exceeding derivation latency.** The tombstone must outlive the maximum distillation lag of any peer. If `B`'s loop can wake at `t0 + Δ` and write a derivation, the tombstone must be retained for at least `Δ` past the last possible derivation, and `B` must check the tombstone set on *every* write, not only on the initial erase fan-out. The incident failed here: the tombstone was applied once and not consulted by the distillation loop. The invariant is only valid when all three hold. Any one failing means the mesh can ack an erasure that is not, in fact, erased — and, critically, the acks will all be truthful about what each agent did locally. The failure is invisible to per-agent monitoring. ## Decision Boundary The operational decision is where to place the provenance join and how to treat unresolved ancestry. Two viable architectures, with a sharp boundary between them: - **Centralized provenance ledger.** The controller owns the full derivation graph; derivation writes from any peer are gated on a ledger lookup. Erase traverses the ledger and fans out to every derivation's host. This is correct and simple, but it makes the ledger a single point of write-latency and a single point of erasure-truth — if the ledger is stale, the mesh is wrong. Choose this when derivation latency is low and peers are few. - **Federated conservative matching.** No central ledger; each peer maintains a local provenance index and a replicated tombstone set. Derivation writes with unresolved ancestry are *rejected* (not flagged) unless the peer can prove the ancestry does not terminate at an erased record. This is correct without a central authority, but it trades availability for correctness: during a partition, a peer that cannot resolve ancestry cannot write, which stalls distillation. Choose this when the mesh must survive controller loss and can tolerate distillation backpressure. The boundary between them is **derivation rate versus partition tolerance**. Above roughly the rate at which a central ledger can serve lookups within the distillation SLA, federated matching wins despite the backpressure. Below it, the ledger wins on simplicity and on the fact that a stale ledger is a detectable failure while an unresolved-ancestry rejection is a silent stall. What is *not* on the boundary: the context-window barrier. Both architectures require it; neither substitutes for it. A mesh that has a perfect provenance ledger but no context barrier still rehydrates from `C`'s token buffer. ## Operational Effect The practical consequence is that erasure correctness in a federated mesh is a **global property that no single agent can verify locally**, and therefore must be verified by a replay: after the erase SLA, the controller must issue a *canary query* for the erased entity against every retrieval surface and assert zero recall. The canary must run after the maximum distillation lag and after all context barriers have fired, or it will pass while the rehydration is still in flight. The incident above would have passed a canary at `t0 + 1s` and failed one at `t0 + Δ`. Two guardrails follow directly. First, **tombstones are write-time gates, not one-shot messages**: every derivation write must consult the tombstone set, and the set must be retained for the full derivation-lag horizon. Second, **acks must be scoped**: an ack means "this agent has no live store entry *and* no live context reference *and* no pending derivation that could reconstitute the record," not "this agent deleted a row." An ack that cannot make that claim must be a NACK, even if the row is gone — because a truthful "I deleted the row" is exactly the ack that let this incident through. ```python from dataclasses import dataclass, field from typing import Optional class ErasureInvariantViolation(RuntimeError): """Raised when a derivation write or erase-ack would violate provenance closure.""" pass @dataclass class Tombstone: record_id: str issued_at: float retain_until: float # must exceed max distillation lag across peers @dataclass class Derivation: derivation_id: str content: str ancestry: list[str] # ordered: derivation -> ... -> record_id ancestry_resolved: bool # False => partial join, must be rejected @dataclass class PeerState: peer_id: str store: dict[str, str] = field(default_factory=dict) live_context_refs: set[str] = field(default_factory=set) pending_derivations: list[Derivation] = field(default_factory=list) tombstones: dict[str, Tombstone] = field(default_factory=dict) def admit_derivation(peer: PeerState, d: Derivation, now: float) -> None: """Gate a derivation write against the tombstone set and ancestry closure.""" if not d.ancestry_resolved: raise ErasureInvariantViolation( f"peer {peer.peer_id}: derivation {d.derivation_id} has unresolved " f"ancestry {d.ancestry}; refusing write (partial provenance join)" ) for ancestor in d.ancestry: ts = peer.tombstones.get(ancestor) if ts is not None and now <= ts.retain_until: raise ErasureInvariantViolation( f"peer {peer.peer_id}: derivation {d.derivation_id} descends from " f"erased record {ancestor} (tombstone retained until " f"{ts.retain_until}); refusing rehydration" ) peer.store[d.derivation_id] = d.content def ack_erase(peer: PeerState, record_id: str, now: float) -> None: """An erase ack is only truthful if store, context, and pending derivations are clear.""" if record_id in peer.store: raise ErasureInvariantViolation( f"peer {peer.peer_id}: store still holds {record_id}" ) if record_id in peer.live_context_refs: raise ErasureInvariantViolation( f"peer {peer.peer_id}: live context still references {record_id}; " f"context barrier not fired, rehydration possible" ) for d in peer.pending_derivations: if record_id in d.ancestry: raise ErasureInvariantViolation( f"peer {peer.peer_id}: pending derivation {d.derivation_id} " f"descends from {record_id}; ack would be untruthful" ) peer.tombstones[record_id] = Tombstone( record_id=record_id, issued_at=now, retain_until=now + 3600.0 ) ```