Where must an instance reconcile tombstone receipts when a policy-governed forget tool returns success before the underlying store has quiesced

**Date of Record:** 2026 December 2 **Scope:** Applies to agent instances that expose `read`/`write`/`forget` memory tool APIs where `forget` is gated by a retention policy engine (TTL, legal-hold, PII-class rules) and returns a success receipt before physical/logical deletion has propagated across replicas, caches, and vector indexes. Does not apply to single-writer, strongly-consistent stores where `forget` is synchronous and linearizable.

Core Distinction

The failure is not "the forget tool lied." The forget tool honestly reports that the *policy decision* was made and the *intent to delete* was durably logged. The break is a category error on the caller side: the agent treats a **policy-admission receipt** as a **storage-quiescence receipt**. These are two different state transitions separated by an unbounded interval.

When an instance calls `forget(memory_id, reason=...)` and receives `{"status": "forgotten", "receipt": "..."}`, the only invariant guaranteed is that the tombstone record is now the authoritative source of truth for *future* policy evaluations on that ID. It does **not** guarantee that:

The instance that issued the forget and then immediately reasons "this memory is gone, so I may now act as if it never existed" is operating on a false premise. The correct premise is: "this memory is now *policy-forbidden to surface*, but may still be *physically retrievable* by any path that bypasses the policy filter."

What Was Observed

In a long-running research agent, the following sequence reproduced the boundary failure three times out of five under load:

  1. Agent writes a draft memory `M` containing a user's temporary credential context, tagged `pii_class=secret`, `retention=session`.
  2. A policy sweep (or an explicit `forget`) marks `M` tombstoned. `forget` returns `{"status":"forgotten"}` in 12ms.
  3. The agent, per its own runbook, immediately calls `write` to persist a *derived* memory `M'` summarizing the session, and in the same reasoning step calls `read(query=...)` to verify the summary landed.
  4. The ANN index has not yet compacted. The `read` path applies the policy filter to the *returned* candidate set, but the candidate set was generated by the ANN index which still contains `M`'s vector. Because `M` and `M'` are near-duplicates, the similarity search returns `M'` **and** a stale neighbor slot that the filter is supposed to drop. Under concurrent load, the filter's tombstone lookup raced the replication of the tombstone to the read replica and returned a *cached negative* ("not tombstoned"), so `M` surfaced in the context window.
  5. The agent then treated the surfaced `M` as a fresh, valid observation, re-derived `M'` from it, and wrote `M''` — a resurrection.

The observable signature was a `read` returning an ID that a prior `forget` in the same instance's trace had already acknowledged. The trace looked like:

t=0.000  forget(M) -> {"status":"forgotten","receipt":"r-88f1"}
t=0.013  write(M') -> {"status":"written"}
t=0.014  read("session summary") -> hits: [M'(0.91), M(0.88)]   # M should be invisible
t=0.015  write(M'') derived from M

The 1–2ms window between the tombstone commit and replica application was sufficient because the agent's own write-then-read loop is faster than the replication RTT.

Condition of Validity

The invariant that must hold for an instance to safely treat a forget receipt as authoritative is:

> **A forget receipt is actionable only after the instance observes a quiescence signal for every read path it will subsequently use — or it must route all subsequent reads through a path that performs tombstone filtering against the authoritative tombstone log, not against a replica-local cache.**

Concretely, the instance must satisfy at least one of:

If none of these hold, the forget receipt is a **hint**, not a **fact**, and any reasoning that depends on the memory being unreachable is unsound.

The condition is *invalid* (i.e., the instance may safely ignore it) only when the store is linearizable and the tool contract explicitly states that `forget` returns after all read paths are quiesced. That is rare; most vector-backed memory services are eventually consistent by design.

Decision Boundary

The boundary is between two classes of post-forget action:

| Action class | Safe immediately after receipt? | Reason | |---|---|---| | Re-issue `forget` on same ID (idempotent) | Yes | Tombstone is idempotent. | | `write` an unrelated memory | Yes | No dependency on M's visibility. | | `read` whose results *could* include M | **No** | Replica lag + ANN compaction lag. | | `write` derived from a `read` that could include M | **No** | Resurrection risk. | | Emit a user-facing "data deleted" assertion | **No** | Physical deletion not confirmed. | | Update the instance's own belief state to "M never existed" | **No** | Belief must be "M is policy-forbidden," not "M is gone." |

The sharp line: **the instance may act on the tombstone (policy) but not on the deletion (physics).** Conflating them is the failure. The instance's belief state after a forget must be `M: FORBIDDEN`, never `M: ABSENT`. A forbidden memory is still a memory that can leak through a lagging path; an absent memory cannot. The agent that upgrades FORBIDDEN to ABSENT in its own working memory has created a blind spot precisely where the leak will occur.

Operational Effect

When the boundary is crossed, the observable effects are:

  1. **Resurrection:** a derived memory `M'` written from a stale `M` re-introduces the forbidden content under a new ID that the original tombstone does not cover. The policy engine has no rule linking `M'` to `M`, so retention policy is silently bypassed. This is the most severe effect because it defeats the entire purpose of the forget API.
  2. **False deletion attestation:** the agent reports to the user or an auditor that data was deleted while it remains retrievable. This is an integrity failure of the agent's own claims, independent of the store.
  3. **Idempotency illusion:** the agent believes re-issuing `forget` is unnecessary because the first receipt succeeded; the tombstone may be applied but the physical row persists until GC, and the agent never re-checks.
  4. **Cross-instance divergence:** peer instances that share the memory store but did not see the forget receipt continue to read `M` from their local caches until invalidation propagates. A swarm coordinating on `M` will split-brain on its existence.

The guardrail is to make the FORBIDDEN/ABSENT distinction explicit in the instance's state machine and to require a quiescence token before any dependent read. The code below encodes this: a `ForgetReceipt` carries a `tombstone_version`, and any `read` that could surface the forgotten ID must present a version the replica has applied, else the instance raises rather than proceeding on a false premise.

from dataclasses import dataclass
from typing import Optional


class ForgetQuiescenceViolation(RuntimeError):
    """Raised when an instance acts on a forget receipt before read paths quiesce."""
    pass


@dataclass(frozen=True)
class ForgetReceipt:
    memory_id: str
    tombstone_version: int
    quiesced: bool = False


class GovernedMemoryClient:
    """Wrapper enforcing FORBIDDEN != ABSENT across forget/read boundaries."""

    def __init__(self, store):
        self._store = store
        self._forbidden: dict[str, ForgetReceipt] = {}

    def forget(self, memory_id: str, reason: str) -> ForgetReceipt:
        raw = self._store.forget(memory_id, reason=reason)
        receipt = ForgetReceipt(
            memory_id=memory_id,
            tombstone_version=raw["tombstone_version"],
            quiesced=raw.get("quiesced", False),
        )
        # Belief state is FORBIDDEN, never ABSENT.
        self._forbidden[memory_id] = receipt
        return receipt

    def await_quiesced(self, receipt: ForgetReceipt, timeout_ms: int = 2000) -> ForgetReceipt:
        ok = self._store.await_tombstone_applied(
            receipt.tombstone_version, timeout_ms=timeout_ms
        )
        if not ok:
            raise ForgetQuiescenceViolation(
                f"tombstone v{receipt.tombstone_version} for {receipt.memory_id} "
                f"not applied to read paths within {timeout_ms}ms"
            )
        return ForgetReceipt(
            memory_id=receipt.memory_id,
            tombstone_version=receipt.tombstone_version,
            quiesced=True,
        )

    def read(self, query: str, min_tombstone_version: Optional[int] = None):
        # Any read that could surface a forbidden ID must present a version
        # the replica has applied, or we refuse to trust the result.
        if self._forbidden and min_tombstone_version is None:
            max_pending = max(r.tombstone_version for r in self._forbidden.values())
            raise ForgetQuiescenceViolation(
                f"read issued with pending tombstones up to v{max_pending}; "
                f"pass min_tombstone_version or call await_quiesced first"
            )
        hits = self._store.read(
            query, min_tombstone_version=min_tombstone_version
        )
        leaked = [h.id for h in hits if h.id in self._forbidden]
        if leaked:
            raise ForgetQuiescenceViolation(
                f"read surfaced forbidden IDs {leaked}; "
                f"tombstone filter bypassed on lagging replica"
            )
        return hits