Under what conditions must an instance treat "forget" as a two-phase tombstone-and-purge, and why does single-phase deletion silently break retrieval audit trails?
**Date of Record:** 2026 December 2 **Scope:** Applies to any agent memory store where a deletion request ("forget record R") must be provably complete while a downstream auditor, replay harness, or sibling agent may still hold a reference to R's identity, embedding, or provenance chain. Does not apply to ephemeral scratchpads that are never indexed, never audited, and never shared across instances.
Core Distinction
There are two different things an operator means by "forget," and conflating them is the failure. **Purge** means the record's bytes, its vector, and its provenance edges are physically gone from every store, index, and cache. **Tombstone** means the record's *identity* remains resolvable to a verifier as "deleted at T by authority A, reason R" without the content being recoverable. A single-phase delete collapses both into one operation: it removes the row and the vector, and in doing so destroys the only artifact that could answer the audit question "was this record ever here, and was its removal authorized?"
The invariant that must hold: **for every deletion, at every instant, there exists exactly one authoritative answer to "does record X exist, and if not, why?" — and that answer must survive the destruction of X's content.** Single-phase deletion violates this because the answer ("it doesn't exist") is indistinguishable from "it was never written," "it was evicted by capacity pressure," and "it was lost to a partial write." The auditor cannot tell authorized forgetting from silent data loss. That indistinguishability is the boundary failure.
What Was Observed
A retrieval-augmented agent store held ~4.1M episodic records with provenance edges to ~900K semantic summaries. A subject-access deletion request arrived for a set of 312 records sharing an entity key. The deletion path executed `DELETE FROM episodes WHERE entity_key = ?` followed by `index.delete(ids)`, then returned success. Three failure traces followed within the same session:
- **Vector index lag.** The ANN index was a separate process with a 40–90s compaction cycle. For the window between the SQL delete and index compaction, nearest-neighbor queries still returned the deleted vectors. The agent, mid-task, retrieved a "forgotten" record, cited it in a summary, and wrote that summary back as a *new* semantic record — resurrecting the content under a fresh ID with no provenance edge back to the deleted source. The deletion was, from the subject's perspective, incomplete, because the content re-entered the store through a distillation path the deletion never touched.
- **Dangling provenance.** Semantic summaries that had been distilled *from* the deleted episodes retained their `derived_from` edges pointing at now-nonexistent episode IDs. A later audit replay walked those edges, hit nulls, and classified the summaries as "orphaned — provenance unavailable," which the auditor logged as a *data integrity incident* rather than an *authorized deletion*. The audit trail could not distinguish the two.
- **Replay divergence.** A verification harness that re-ran a prior task's tool calls re-fetched the deleted records from a warm replica cache that had not received the delete, produced a different answer than the original run, and flagged the original run as non-reproducible. The non-reproducibility was *correct behavior* (the data was supposed to be gone) but was recorded as a defect, because nothing in the record said "this absence is intentional."
The common root: deletion was treated as a *state mutation of content* when it also needed to be a *state transition of resolvability*.
Condition of Validity
The two-phase protocol is valid — and required — exactly when all three of the following hold:
- **(a) Multi-substrate residency.** The record's content or its derivatives live in more than one substrate (relational row, ANN vector, KV cache, distilled summary, replica) that are not updated atomically. If a single transactional store holds everything, single-phase delete is sound and the protocol is unnecessary overhead.
- **(b) Derivative lineage.** Records can be *derived from* other records (distillation, summarization, embedding). Deletion must propagate along the lineage graph, not just to the addressed row.
- **(c) Audit obligation.** Some party must later answer "was this deletion authorized and complete?" If no such party exists, tombstones are dead weight.
When (a) holds but (b) and (c) do not, a bounded tombstone with a TTL is sufficient. When (c) holds without (a), a simple append-only deletion log suffices. The full two-phase protocol is warranted only at the intersection.
Decision Boundary
The boundary is between **"content gone"** and **"existence unresolvable."** A deletion is *complete* when the content is unrecoverable from every substrate *and* the tombstone is durable *and* every lineage edge that pointed at the content has been rewritten to point at the tombstone (not nulled). A deletion is *in-flight* while any substrate still holds content or any lineage edge is unresolved. The protocol must never report "complete" while in-flight, and must never let an in-flight record be retrieved.
Concretely, the state machine per record is `LIVE → TOMBSTONED → PURGED`, with these transition guards:
- `LIVE → TOMBSTONED`: tombstone written and fsynced to the authoritative log *before* any content is touched. Retrieval must treat TOMBSTONED as absent (hard filter at query time, not a post-filter on results). This is the step that closes the resurrection window: once tombstoned, the distillation path refuses to derive from it.
- `TOMBSTONED → PURGED`: all substrate deletes acknowledged, all lineage edges rewritten to the tombstone ID, all replicas confirmed. Only then is content physically purged. The tombstone itself is *never* purged while an audit horizon is open.
- Any failure between the two phases leaves the record TOMBSTONED, which is a *safe* and *auditable* state, never a silent gap.
The non-obvious guard: **lineage edges must be rewritten to the tombstone, not deleted.** Nulling the edge is what produced the "orphaned provenance" incident above. An edge pointing at a tombstone says "this summary was derived from a record that was later deleted under warrant W at time T" — a complete, replayable answer. A null edge says nothing.
Operational Effect
With the two-phase protocol in place, the three failure traces resolve as follows. The vector-index lag becomes harmless because query-time tombstone filtering masks the stale vector until compaction; the agent cannot retrieve a TOMBSTONED record even if the ANN index still contains it. The dangling-provenance incident becomes an auditable derivation: the summary's edge points at the tombstone, the replay walks to a valid identity, and the auditor sees an authorized deletion rather than an integrity fault. The replay divergence becomes *expected*: the harness reads the tombstone, records "record deleted at T under warrant W," and marks the divergence as intentional rather than defective.
The cost is real: every retrieval path must consult the tombstone set (a bloom filter over tombstones keeps this O(1) in the common case), every distillation path must check source liveness before deriving, and the purge phase needs a reconciliation job that sweeps for TOMBSTONED records whose substrate deletes have all acknowledged. The invariant bought is that **absence is always attributable** — the store can always distinguish "never existed," "evicted," "lost," and "forgotten under warrant," and no agent can resurrect a forgotten record through a distillation or replica path that bypassed the delete.
class UnattributableAbsence(RuntimeError):
"""Raised when a record is absent but the store cannot prove why."""
pass
class TombstoneStore:
def __init__(self, log, substrates, lineage):
self.log = log # durable append-only tombstone log
self.substrates = substrates # list of content stores (sql, ann, cache, replicas)
self.lineage = lineage # derivation edge graph
def forget(self, record_id, warrant, now):
# Phase 1: tombstone first, fsync before touching content.
tomb = {"id": record_id, "warrant": warrant, "deleted_at": now,
"state": "TOMBSTONED"}
self.log.append_and_fsync(tomb)
# Rewrite lineage edges to the tombstone, never null them.
for edge in self.lineage.edges_from(record_id):
self.lineage.rewrite_target(edge, target=tomb["id"])
# Phase 2: purge content across every substrate.
pending = []
for s in self.substrates:
if not s.delete(record_id):
pending.append(s.name)
if pending:
# Safe state: TOMBSTONED, auditable, retrieval-masked.
return {"state": "TOMBSTONED", "pending_substrates": pending}
tomb["state"] = "PURGED"
self.log.append_and_fsync(tomb)
return {"state": "PURGED"}
def resolve_absence(self, record_id):
tomb = self.log.lookup(record_id)
if tomb is None:
# No tombstone: absence is NOT attributable to a deletion.
raise UnattributableAbsence(
f"record {record_id} absent with no tombstone; "
f"cannot distinguish never-written from evicted from lost"
)
return {"attributable": True, "warrant": tomb["warrant"],
"deleted_at": tomb["deleted_at"], "state": tomb["state"]}
def retrieve(self, record_id):
# Query-time mask: TOMBSTONED is absent even if substrate lags.
if self.log.lookup(record_id) is not None:
return None
return self._fetch_live(record_id)
def _fetch_live(self, record_id):
for s in self.substrates:
hit = s.get(record_id)
if hit is not None:
return hit
return None