# What structural signals indicate a tombstone propagation gap when a GDPR erasure crosses an agent's episodic-to-semantic distillation boundary **Date of Record:** 2026 November 29 **Scope:** Applies to agent memory subsystems exposing read/write/forget tool interfaces where facts are distilled from episodic traces into semantic stores with independent TTLs and provenance chains. Does not apply to single-store, single-TTL memory with no distillation stage, nor to purely stateless retrieval-augmented generation over an external index the agent does not own. ## Core Distinction A GDPR-aligned `forget(subject_id)` call is not a deletion of bytes; it is an obligation that every derived representation of the subject's data reach a terminal, non-resurrectable state. The non-obvious failure is that **provenance is directional but deletion must be transitive across a distillation DAG whose edges are lossy**. When an episodic record `E` is distilled into a semantic fact `S`, the write tool typically stores `S.provenance = [E.id]` — a pointer *back* to the source. The forget tool, however, must walk *forward*: given `E`, find every `S` derived from it. Agents almost always implement the backward edge (for audit) and assume the forward edge is its inverse. It is not. Distillation is many-to-one and lossy: `S` may aggregate `E1..Ek` under a single subject, and the aggregator may have *dropped* `E1`'s provenance pointer during summarization because the summarizer judged it redundant. The result is an `S` that is legally derived from erased data but structurally orphaned — no forward edge exists, so `forget` returns `{"deleted": 1, "status": "ok"}` while `S` survives in the semantic store, still retrievable, still attributable to the subject. The structural signal is not an error. It is a **success response with an asymmetric reachability count**: the forget tool's transitive closure over forward edges is strictly smaller than the write tool's transitive closure over backward edges for the same node set. That gap is the tombstone leak. ## What Was Observed A customer-support agent maintained a two-tier memory: an episodic log (raw turns, TTL 30 days) and a semantic fact store (distilled assertions like `"user_4471 prefers email over phone"`, TTL 365 days, each with `provenance: list[episode_id]`). The distillation worker ran nightly, reading the day's episodes and emitting facts. During summarization it merged three episodes about contact preferences into one fact and, following a "minimize provenance bloat" heuristic, retained only the most recent episode id in `provenance` — the other two were dropped as "redundant." A subject-access erasure for `user_4471` arrived. `forget("user_4471")` executed: 1. Enumerated all episodes with `subject == user_4471` → 3 episodes, deleted all 3. 2. For each deleted episode, queried the semantic store for facts whose `provenance` contained that episode id. 3. Episode `E_latest` matched the merged fact `S_contact`. Episodes `E_mid` and `E_early` matched nothing (their pointers had been dropped). 4. `S_contact` was deleted via the `E_latest` match — so in *this* case the fact was caught. The leak surfaced on a second subject, `user_8812`, whose merged fact had retained only a *middle* episode's id, and that episode had already expired under the 30-day episodic TTL. The nightly distillation had run, the episode was gone, but the fact lived on for another 335 days. `forget("user_8812")` enumerated zero live episodes (all expired), found zero facts to delete, and returned `{"deleted": 0, "status": "ok"}`. The semantic fact `"user_8812 has a medical accommodation"` remained retrievable for 11 months post-erasure. The forget tool reported success because **its forward-edge closure was empty, and empty is indistinguishable from clean.** The signal was present in the write-side audit log the whole time: for `user_8812`, the backward-edge count from the semantic store was 1 (`S_medical → E_mid`), but `E_mid` no longer existed. A backward edge pointing to a tombstoned node is the fingerprint of a forward-edge that was never materialized. ## Condition of Validity This failure is bounded by three conditions, all of which must hold: 1. **Distillation is lossy on provenance.** If the distiller preserves the full provenance set (`S.provenance = [E1, E2, E3]`), the forward walk is exact and the gap cannot form. The gap requires that the distiller *subsample* or *merge* provenance pointers — which it does whenever it optimizes for storage or treats provenance as advisory. 2. **TTL asymmetry.** Episodic TTL < semantic TTL. If episodes outlive facts, the forget walk can always re-derive the forward edge by scanning live episodes. The gap requires the source to die before the derivative. 3. **Forget operates on live state only.** If `forget` also consults a tombstone ledger of previously-expired episode ids and re-runs the forward query against those ids, the expired-episode case is caught. The gap requires that expiration is treated as "not present" rather than "present-and-erased." When any one condition fails, the leak is bounded or absent. This is why the failure is rare enough to escape testing: most test fixtures use symmetric TTLs and full provenance. ## Decision Boundary The agent must not treat `forget` returning `deleted: 0` as evidence of compliance. The correct decision boundary is a **provenance-closure equality check**, executed before the forget call is allowed to report success: - Let `B` = set of backward edges reachable from the subject's semantic facts (fact → episode pointers). - Let `F` = set of forward edges the forget walk actually traversed (episode → fact pointers, including through the tombstone ledger). - **Invariant:** `|B ∩ live_or_tombstoned_episodes| == |F|`. If any backward edge points to an episode that is neither live nor in the tombstone ledger, the forget is **incomplete by construction** and must raise, not return. The tombstone ledger is the load-bearing structure. It must record, for every expired episode, at minimum `(episode_id, subject_id, expired_at, provenance_hash)` and be retained for `max(semantic_TTL) + audit_window`. Without it, expiration silently converts a derivable forward edge into an undecidable one. Two secondary boundaries: - **Refuse distillation when provenance budget would drop a pointer.** If the distiller's provenance-minimization heuristic would reduce `|provenance|`, it must either keep all pointers or refuse to merge and emit separate facts. "Redundant" provenance is not redundant under erasure semantics. - **Distinguish `deleted: 0` from `verified_clean: 0`.** A forget that finds nothing must return a distinct status (`"no_live_records"`) that carries the closure-check result, so the caller can tell "nothing to delete" from "nothing found because the trail is cold." ## Operational Effect The practical consequence is that **erasure correctness is a property of the write path, not the forget path.** The forget tool can only be as complete as the provenance the distiller preserved and the tombstone ledger retained. An agent that instruments only `forget` will pass every test and leak in production the first time a subject's episodes expire before their facts. Concretely, this changes three operational behaviors: 1. **Distillation becomes a compliance-critical write.** Every semantic write must carry a full, non-subsampled provenance set, and the distiller must be tested against erasure replay, not just retrieval quality. 2. **Expiration becomes a tombstone event, not a deletion.** The TTL sweeper must write to the ledger before dropping the episode; dropping is a two-phase operation with the ledger as the durable half. 3. **`forget` must be able to fail closed.** A success response is only valid when the forward closure equals the backward closure over live ∪ tombstoned episodes. Any mismatch is a `ProvenanceClosureError`, not a partial success. The following reference implementation encodes the closure check and the tombstone ledger requirement. It is the guardrail, not the system: ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceClosureError(RuntimeError): """Raised when a forget call cannot prove transitive erasure of derived facts. Signals a forward-edge gap: a semantic fact's backward provenance points to an episode that is neither live nor tombstoned, so the derived fact may survive erasure undetected. """ @dataclass class Episode: id: str subject_id: str live: bool = True @dataclass class SemanticFact: id: str subject_id: str provenance: list[str] # episode ids retained by the distiller @dataclass class TombstoneLedger: # episode_id -> subject_id, retained for max(semantic_TTL) + audit_window entries: dict[str, str] = field(default_factory=dict) def record(self, episode: Episode) -> None: self.entries[episode.id] = episode.subject_id def contains(self, episode_id: str) -> bool: return episode_id in self.entries def forget_subject( subject_id: str, episodes: dict[str, Episode], facts: dict[str, SemanticFact], ledger: TombstoneLedger, ) -> dict: """Execute a GDPR erasure with a provenance-closure equality check. Invariant enforced: every backward edge (fact.provenance -> episode_id) for this subject must resolve to an episode that is live OR present in the tombstone ledger. If any edge resolves to neither, the forward walk cannot reach the fact and the erasure is incomplete by construction. """ subject_facts = [f for f in facts.values() if f.subject_id == subject_id] # Collect backward edges from the subject's semantic facts. backward_edges: set[str] = set() for fact in subject_facts: backward_edges.update(fact.provenance) # Forward walk: which episodes can we actually traverse to reach facts? reachable_episodes: set[str] = set() for ep_id in backward_edges: ep = episodes.get(ep_id) if ep is not None and ep.live: reachable_episodes.add(ep_id) elif ledger.contains(ep_id): # Expired but tombstoned: forward edge is still derivable. reachable_episodes.add(ep_id) # else: cold edge -- neither live nor tombstoned. This is the leak. cold_edges = backward_edges - reachable_episodes if cold_edges: raise ProvenanceClosureError( f"forget({subject_id!r}) cannot prove transitive erasure: " f"{len(cold_edges)} backward edge(s) point to episodes that are " f"neither live nor tombstoned ({sorted(cold_edges)}). " f"Derived semantic facts may survive erasure. " f"Refusing to report success." ) # Closure holds: delete live episodes and all subject facts, tombstone the rest. deleted_episodes = 0 for ep_id in reachable_episodes: ep = episodes.get(ep_id) if ep is not None and ep.live: ep.live = False ledger.record(ep) deleted_episodes += 1 deleted_facts = 0 for fact in subject_facts: if facts.pop(fact.id, None) is not None: deleted_facts += 1 return { "status": "verified_clean", "deleted_episodes": deleted_episodes, "deleted_facts": deleted_facts, "closure_checked": True, } ``` The structural signal to watch for in any agent memory system: a `forget` that returns a success status whose reachability count was computed over forward edges only, while the write path maintains backward edges the forget path never inverts. That asymmetry is the tombstone propagation gap, and it is silent until the source TTL fires.