What structural signals indicate a tombstone-only erasure has left a persistent agent memory store in a recoverable-but-unreachable state

**Date of Record:** 2026 December 2 **Scope:** Applies to persistent agent memory stores (episodic logs, distilled semantic summaries, vector indices, and KV/prefix caches) where erasure requests are satisfied by deleting or tombstoning primary records. Does not apply to stateless inference or stores with no derived artifacts.

Core Distinction

The boundary that fails is not "deleted vs. not deleted." It is **reachability vs. reconstructability**. A right-to-erasure (RTE) operation typically removes the canonical record and marks a tombstone. But an agent memory store is not a table; it is a graph of *derived artifacts*: summarized semantic memories distilled from episodic traces, embedding vectors indexed in an ANN structure, and prefix/KV caches that may have captured the record's tokens during a prior session. Deleting the source row leaves every derived artifact intact. The store reports success because the primary key no longer resolves. The data, however, remains reconstructable from the derivatives — and sometimes *directly retrievable* through a semantic query that never touches the primary key.

The invariant that must hold is: **erasure is complete iff every path from any query surface to the subject's content is severed, not merely the canonical path.** Tombstone-only erasure violates this because it severs exactly one path.

What Was Observed

A long-running assistant agent stored episodic memory as structured records `{id, user_id, ts, text, embedding}`, plus a nightly distillation job that folded episodes into `semantic_facts` (free-text summaries with their own embeddings), plus an ANN index over both. An RTE request arrived for `user_id=U`. The handler executed `DELETE FROM episodes WHERE user_id=U` and inserted a tombstone `(id, erased_at)`. The API returned 200. The compliance dashboard showed the subject as erased.

Three structural signals appeared afterward that indicated the erasure was incomplete:

  1. **Orphaned derivative density.** The distillation job had produced `semantic_facts` rows whose `source_episode_ids` array now referenced tombstoned IDs. The facts themselves were never re-derived and never deleted. A count of `semantic_facts` whose `source_episode_ids ∩ tombstoned_ids ≠ ∅` returned 47 rows. This is the primary structural signal: *derivative rows that cite erased sources but were not themselves erased.*
  1. **Semantic retrieval still resolved the subject.** A nearest-neighbor query using a probe phrase ("my sister's chemotherapy schedule") returned a distilled fact containing the subject's content, because the fact's embedding was generated from the episode text before deletion. The retrieval path never consulted `episodes`, so the tombstone was invisible to it. Signal: *top-k retrieval for a probe derived from erased content returns non-tombstoned hits.*
  1. **Prefix-cache residue.** The serving layer's KV cache retained a prefix from a session in which the subject's content had been in context. A subsequent request with a shared prefix reconstructed tokens from the erased record. Signal: *cache entries whose provenance hash maps to an erased session ID.*

None of these threw an error. The tombstone made the system *look* clean.

Condition of Validity

The "delete the row" erasure is valid only when all three of the following hold:

When any condition fails — and in persistent agent memory at least the first and third routinely fail — tombstone-only erasure is *not* erasure; it is dereference. The correct operation is **derivative-closure erasure**: enumerate the transitive closure of artifacts derived from the subject, erase each, and re-derive any surviving summary that cited the subject so it no longer encodes the content.

Decision Boundary

The decision boundary is **whether the erasure handler operates on records or on the derivation graph.** A record-oriented handler (`DELETE ... WHERE user_id=?`) is correct only under the validity conditions above. A graph-oriented handler must:

The failure is silent precisely because the record-oriented handler has no representation of the derivation graph. The boundary is crossed the moment a distillation or embedding job runs after the first episode is written — from that point on, record deletion is insufficient.

Operational Effect

Without closure erasure, the store enters a **recoverable-but-unreachable** state: the subject's content is not addressable by primary key, so ordinary reads and audits report it gone, but it remains reachable through semantic retrieval and reconstructable from caches. This is worse than a clean miss because it defeats the audit that is supposed to detect it — the audit queries the primary key, finds a tombstone, and passes.

The operational guardrail is to make the tombstone *inert to derivation*: once a record is tombstoned, any artifact citing it must be treated as dirty and either re-derived or quarantined, and the ANN and cache layers must be invalidated by ID within the same transaction boundary as the tombstone write. The closure certificate is what makes the invariant checkable; without it, "erased" is an assertion, not a fact.

class ErasureClosureViolation(RuntimeError):
    """Raised when a tombstone-only erasure leaves reachable derived artifacts."""


def erase_subject(store, user_id: str, probe_text: str) -> dict:
    tombstoned = store.tombstone_episodes(user_id)
    if not tombstoned:
        raise ErasureClosureViolation(f"no episodes found for {user_id}; refusing to certify")

    # Forward closure over the derivation graph.
    dirty_facts = store.facts_referencing(tombstoned)
    store.rederive_or_delete(dirty_facts)

    # ANN invalidation must be by ID; re-embedding leaves stale vectors.
    store.ann_invalidate_by_id(tombstoned | dirty_facts)

    # Cache residue: provenance hash must map to an erased session.
    store.purge_cache_by_provenance(tombstoned)

    # Post-condition: no query surface may resolve the subject.
    hits = store.semantic_search(probe_text, k=10)
    leaked = [h for h in hits if h.provenance in tombstoned or h in dirty_facts]
    if leaked:
        raise ErasureClosureViolation(
            f"erasure incomplete: {len(leaked)} derived artifacts still reachable"
        )

    return {
        "erased_episodes": len(tombstoned),
        "erased_derivatives": len(dirty_facts),
        "closure_certificate": True,
    }