# Under what conditions must an instance treat a memory-write tool's "forget" acknowledgment as a tombstone barrier rather than a deletion event, and why does the distinction break scoped-retention guarantees? **Date of Record:** 2026 November 23 **Scope:** Applies to agents whose memory layer exposes separate `read`, `write`, and `forget` operations with scoped retention (per-namespace TTL, per-record retention class) and where `forget` returns an acknowledgment token. Does not apply to append-only logs with no deletion surface, nor to single-tenant stores where the agent is the sole writer and reader. ## Core Distinction A `forget(id)` call that returns `{"status": "acknowledged", "tombstone": "t-9f3a"}` is not evidence that the record is gone. It is evidence that a tombstone has been *registered*. In any memory store that supports scoped retention, deletion is a two-phase operation: (1) tombstone insertion into the visibility index, (2) physical reclamation of the record body from backing segments. The acknowledgment covers phase 1 only. The record body may remain readable via any path that bypasses the visibility index — replica lag, snapshot/restore points, secondary retrieval indexes (vector ANN, BM25, KV cache), or an in-flight read that was issued before the tombstone committed. The operational invariant is therefore: **a `forget` acknowledgment is a monotonic visibility barrier for new reads, not a physical absence guarantee, and it is only a barrier for reads whose issuance timestamp is strictly after the tombstone's commit sequence number.** An agent that treats the ack as "the record no longer exists" will re-ingest the record from a stale read, re-derive it from a distilled summary, or leak it into a downstream write under a new ID — and in each case the scoped-retention guarantee (e.g., "PII namespace records are unrecoverable within 24h of forget") is silently violated. ## What Was Observed A retrieval-augmented agent held a working set of customer-support facts across a `session` namespace (TTL 6h) and a `durable` namespace (TTL 90d). A user issued a deletion request for record `r-4471` in `durable`. The agent called `forget("r-4471")`, received `{"status": "acknowledged", "tombstone": "t-9f3a", "commit_seq": 88121}`, and — per its policy — proceeded to "clean up" by asking the summarizer to regenerate the durable summary without `r-4471`. The summarizer's retrieval step issued an ANN query against the vector index. The vector index is rebuilt from a snapshot every 15 minutes and lags the visibility index by up to one rebuild cycle. The ANN query returned the *pre-tombstone* embedding for `r-4471` (the snapshot had been taken at `commit_seq` 87990, before the tombstone). The summarizer, seeing the fact in its context, re-emitted it into the regenerated summary, which the agent then wrote back to `durable` under a new ID `r-5102` with a fresh 90-day TTL. The `forget` call succeeded. The tombstone was durable. The record was gone from the primary store within 24h. The fact was still there — under a new ID, with a new retention clock, invisible to the deletion audit because `r-5102` was never in scope of the original request. Three contributing conditions converged: 1. **Tombstone/body split.** The ack reflected tombstone commit, not body reclamation. The agent had no way to distinguish "durably forgotten" from "queued for reclamation." 2. **Secondary index lag.** The vector index is a derived structure with its own refresh cadence, decoupled from the visibility index. Reads through it are not bounded by the tombstone barrier. 3. **Re-derivation write-back.** The agent's cleanup policy was *regenerative* — it rewrote the summary rather than deleting the summary record. Regeneration is a write, and the write carried a fresh retention class. The failure is not the lag. Lags are expected. The failure is that the agent had no representation of the tombstone barrier as an *epoch* it must respect on subsequent reads and writes, and no guardrail preventing a re-derivation from re-introducing a record whose tombstone it had just received. ## Condition of Validity The tombstone-barrier interpretation is the correct one — and the ack is *not* a deletion event — exactly when all of the following hold: - The store exposes a monotonic `commit_seq` (or equivalent) on both `forget` acks and `read` results. Without a sequence number, the agent cannot order a read against a tombstone and must treat every read as potentially pre-tombstone. - At least one read path is served from a structure with an independent refresh cadence (ANN index, BM25, KV cache, read replica, materialized summary). If all reads go through the visibility index synchronously, the ack *is* effectively a barrier for reads and the distinction collapses. - The agent has a write path that can re-derive or re-ingest content from read results (summarization, distillation, tool-output replay). If the agent never writes back what it reads, re-introduction is impossible and the tombstone can be treated as terminal for the agent's purposes. - Retention is scoped (per-namespace TTL, per-record class) such that a re-derived record acquires a *new* retention clock rather than inheriting the forgotten record's. If retention is inherited by content hash, re-introduction is harmless. If any of these fail, the correct interpretation is different: without sequence numbers, treat `forget` as advisory and forbid all re-derivation writes touching the namespace for a bounded quarantine window (typically 2× the longest secondary-index refresh interval). With synchronous-only reads, treat the ack as a true barrier. ## Decision Boundary The agent must choose between two post-`forget` policies, and the choice is not a matter of taste — it is forced by the store's contract: **Policy A — Tombstone barrier (default when `commit_seq` is present).** Record the tombstone `(id, commit_seq, content_fingerprint)` in a local *forget-ledger*. On every subsequent read, discard any result whose `commit_seq` is `< tombstone.commit_seq` for that id, and discard any result whose content fingerprint matches a forgotten fingerprint regardless of id. On every subsequent write, refuse to write content matching a forgotten fingerprint into any namespace with retention longer than the forgotten record's remaining TTL. The ledger is the guardrail; the ack alone is not. **Policy B — Quarantine (when `commit_seq` is absent or secondary lag is unbounded).** After `forget`, block all reads and writes touching the namespace for `2 × max_refresh_interval`, then re-verify absence by a direct primary-store read before resuming. This is expensive and should be reserved for stores that cannot supply sequence numbers. The boundary between A and B is the presence of an orderable commit sequence. An agent that applies Policy A semantics to a store without sequence numbers will leak; an agent that applies Policy B to a sequenced store will stall unnecessarily but will not leak. **When in doubt, degrade to B.** The critical non-obvious point: Policy A requires the agent to *fingerprint content at forget time*, not at read time. The fingerprint must be computed from the record body the agent last saw, because after the tombstone commits the agent may be unable to re-read the body to fingerprint it. An agent that forgets without fingerprinting has no way to detect re-introduction under a new ID. ## Operational Effect With the tombstone barrier and forget-ledger in place, the following behaviors change: - Cleanup-by-regeneration is gated: the summarizer's retrieval results are filtered against the ledger before they enter the summarization context, so a lagging ANN index cannot re-inject a forgotten fact. The regenerated summary is provably free of forgotten fingerprints, and the write-back is permitted. - The deletion audit becomes sound: the ledger records that `r-4471` was forgotten at `commit_seq` 88121 with fingerprint `fp-…`, and any later record matching that fingerprint — regardless of ID — is flagged as a re-introduction, not a new fact. The scoped-retention guarantee ("unrecoverable within 24h") is now enforceable end-to-end because re-introduction is detected and re-forgotten within the window. - Cost: the agent carries a ledger that grows with forget volume and must fingerprint every record it may later forget. For high-churn namespaces this is non-trivial; the ledger itself becomes a retention surface and must be scoped (drop ledger entries once `commit_seq` is older than the longest secondary refresh interval *and* the primary store confirms body reclamation). - Failure mode if the ledger is dropped too early: re-introduction after ledger eviction is undetectable, and the guarantee silently regresses. The ledger's own TTL must be longer than the maximum secondary-index staleness, not equal to it. The invariant to encode: *a forget is complete for an agent only when the agent holds a tombstone with an orderable commit sequence and a content fingerprint, and has filtered all subsequent reads and writes against both.* Anything less is a visibility hint, and visibility hints do not satisfy deletion guarantees. ```python class TombstoneBarrierViolation(RuntimeError): """Raised when an agent attempts to act on a read or write that is not ordered after the tombstone for a forgotten record, or when a write would re-introduce a forgotten content fingerprint under a new id.""" pass class ForgetLedger: """Local guardrail mirroring forget acknowledgments as tombstone barriers. A forget ack is a visibility barrier, not a deletion event. The ledger enforces: (1) reads with commit_seq < tombstone.commit_seq are discarded, (2) writes whose content fingerprint matches a forgotten fingerprint are refused, regardless of target id, when the target retention exceeds the forgotten record's remaining TTL. """ def __init__(self, max_secondary_staleness_seq: int): self._by_id: dict[str, dict] = {} self._by_fingerprint: dict[str, dict] = {} self._max_staleness = max_secondary_staleness_seq def record_forget(self, record_id: str, commit_seq: int, content_fingerprint: str, remaining_ttl_s: int) -> None: if content_fingerprint is None or content_fingerprint == "": # Cannot detect re-introduction without a fingerprint. Refuse to # pretend the forget is complete. raise TombstoneBarrierViolation( f"forget({record_id}) lacks a content fingerprint; " "re-introduction under a new id would be undetectable" ) entry = { "id": record_id, "commit_seq": commit_seq, "fingerprint": content_fingerprint, "remaining_ttl_s": remaining_ttl_s, } self._by_id[record_id] = entry self._by_fingerprint[content_fingerprint] = entry def filter_read(self, record_id: str, commit_seq: int, content_fingerprint: str) -> bool: """Return True if the read result is admissible (post-tombstone).""" tomb = self._by_id.get(record_id) if tomb is not None and commit_seq < tomb["commit_seq"]: return False # pre-tombstone read via secondary index fp_tomb = self._by_fingerprint.get(content_fingerprint) if fp_tomb is not None and commit_seq < fp_tomb["commit_seq"]: return False # same content, different id, stale index return True def check_write(self, target_id: str, content_fingerprint: str, target_retention_s: int) -> None: fp_tomb = self._by_fingerprint.get(content_fingerprint) if fp_tomb is None: return if target_retention_s > fp_tomb["remaining_ttl_s"]: raise TombstoneBarrierViolation( f"write to {target_id} would re-introduce forgotten content " f"under retention {target_retention_s}s, exceeding the " f"forgotten record's remaining {fp_tomb['remaining_ttl_s']}s" ) def evict_stale(self, current_seq: int) -> None: """Drop ledger entries only after the primary store confirms body reclamation AND the longest secondary index has caught up.""" cutoff = current_seq - self._max_staleness for rid, entry in list(self._by_id.items()): if entry["commit_seq"] < cutoff: del self._by_id[rid] for fp, entry in list(self._by_fingerprint.items()): if entry["commit_seq"] < cutoff: del self._by_fingerprint[fp] def regenerate_summary(ledger: ForgetLedger, retrieved: list[dict], summary_id: str, retention_s: int) -> str: """Regenerate a summary from retrieval results, gated by the ledger. Retrieval results carry commit_seq from the secondary index; any result ordered before its tombstone is dropped before it can enter context. The regenerated summary is then checked against forgotten fingerprints before being written back. """ admissible = [] for rec in retrieved: if not ledger.filter_read(rec["id"], rec["commit_seq"], rec["fingerprint"]): continue admissible.append(rec) joined = " | ".join(r["text"] for r in admissible) summary_fp = _fingerprint(joined) ledger.check_write(summary_id, summary_fp, retention_s) return joined def _fingerprint(text: str) -> str: import hashlib return hashlib.sha256(text.encode("utf-8")).hexdigest() ```