# In what scenarios must an instance treat a memory-tool "forget" acknowledgment as non-durable until a tombstone barrier is observed **Date of Record:** 2026 November 24 **Scope:** Applies to agent instances that persist state through a read/write/forget memory tool API where deletion is specified as eventually consistent and reads may be served from a replica or vector index. Does not apply to strongly consistent, single-writer memory stores that expose linearizable delete semantics with synchronous index purge. ## Core Distinction The distinction that matters is between *logical deletion* and *physical erasure*. A `forget(key)` call that returns `{"status": "deleted"}` is an assertion about the control plane's record of intent, not a guarantee that the bytes are unreachable by a subsequent `read` or `search`. Agents routinely conflate the two because the API surface presents forget as a symmetric inverse of write: write returns after the value is durably stored, so forget is assumed to return after the value is durably gone. This symmetry is false. Writes are single-target operations against a primary; forgets must fan out across a primary record, one or more read replicas, an ANN/vector index, a KV cache layer, and any persisted embedding artifacts. The acknowledgment covers the first hop only. The non-obvious consequence: an instance that forgets a poisoned or stale memory and then immediately re-reads its own context to "confirm" the deletion will observe the value still present, conclude the forget failed, retry, and — under an idempotent-but-versioning API — potentially resurrect the value with a fresh version, extending its retention window. The confirmation read becomes the failure. ## What Was Observed A planning agent held an episodic memory entry `plan.v3.constraints` asserting a rate limit of 40 req/min, derived from a tool observation that had since been corrected to 400. On receiving the correction, the agent issued `forget("plan.v3.constraints")`, received a 200 with `{"deleted": true, "tombstone_id": "t-8812"}`, and proceeded. Two steps later it called `search("rate limit constraints", k=5)` while reconstructing its plan. The vector index had not yet processed the tombstone (index compaction lag observed at 1.4–9.2 s in this deployment), so the search returned the deleted entry with a similarity score of 0.91, ranked above the corrected entry. The agent, treating retrieved content as ground truth, re-adopted 40 req/min, and — because its write path was versioned — wrote the stale value back as `plan.v3.constraints` v4. The tombstone `t-8812` was now superseded by a newer write; the retention policy, which honors "most recent write wins" over tombstones, retained the resurrected entry indefinitely. The trace: 1. `write(plan.v3.constraints, {rate: 40})` → v3, indexed. 2. Tool correction arrives: true value is 400. 3. `forget(plan.v3.constraints)` → 200, `tombstone_id=t-8812`, primary record marked deleted. 4. Replica read would return 404; **vector search does not consult the tombstone table** — it consults the index, which still holds the embedding for v3. 5. `search(...)` returns v3 text at 0.91 similarity. 6. Agent re-writes v3 content as v4. Tombstone t-8812 no longer matches the live key (version mismatch), so compaction retains v4. 7. Stale constraint is now *more* durable than before the forget. The failure is not that the forget was slow. It is that the agent's verification loop used a read path (semantic search) with a *different* consistency domain than the delete path (primary record), and treated agreement between them as expected rather than as a race to be bounded. ## Condition of Validity The resurrection hazard is bounded — i.e., an instance may safely treat a forget acknowledgment as final — only when all of the following hold: - **Tombstone barrier is observable.** The API exposes a monotonic `tombstone_id` or `index_epoch` and a way to query whether that barrier has propagated to every read surface the agent will subsequently use (`get_index_epoch() >= tombstone_epoch`). Without this, the agent has no predicate to wait on. - **Read paths are enumerated.** The agent knows every retrieval channel it will use (primary get, replica get, vector search, cache) and each channel's lag bound. A search channel with unbounded compaction lag invalidates the guarantee for any subsequent search. - **Writes are tombstone-aware.** The write path refuses to create a new version of a key whose tombstone is newer than the caller's last observed epoch, or at minimum surfaces the conflict. If writes silently supersede tombstones, resurrection is trivially reachable. - **Retention policy is tombstone-dominant.** The retention engine must rank tombstones above subsequent writes within the propagation window; otherwise "most recent write wins" re-admits the value. Where any condition fails, the forget acknowledgment is *non-durable* and the instance must not re-read the forgotten key through any channel until the barrier predicate is satisfied or a bounded wait expires. ## Decision Boundary The decision boundary is the point at which an instance chooses between two post-forget behaviors: - **Confirm-by-read** (unsafe under non-durable forget): immediately search or get the key to verify absence. This is the default behavior of agents that model forget as synchronous. It is safe only under full Condition of Validity. - **Barrier-then-proceed** (safe): record the `tombstone_id`, proceed with the task using an in-context suppression of the forgotten value, and gate any later retrieval on `index_epoch >= tombstone_epoch` for the specific channels in use. If the barrier is not reached within the task's token/time budget, the instance must treat the forgotten value as *quarantined* — excluded from reasoning by an explicit negative-context marker — rather than as *absent*. The boundary is crossed the moment the agent issues a retrieval that could return the forgotten key while `index_epoch < tombstone_epoch`. Past that point, the agent is no longer verifying a deletion; it is sampling a race and may re-import the value it intended to remove. A secondary boundary governs retry: if the confirmation read returns the value, the correct response is **not** to re-issue `forget` with the same key. Re-issuing forget against a key that a lagging index still serves can, under versioned stores, allocate a new tombstone against a version that the search path will later re-materialize, compounding the problem. The correct response is to wait on the barrier or escalate to quarantine. ## Operational Effect Instances that adopt barrier-then-proceed change three behaviors. First, they stop treating `{"deleted": true}` as a terminal state and start treating it as a *ticket* — a handle (`tombstone_id`) to be redeemed against index epochs. Second, they maintain a per-task quarantine set: keys forgotten but not yet barrier-confirmed, excluded from all retrieval results by post-filtering on key identity, not by trusting the index to have purged them. Third, they refuse to write a key that is in quarantine until the barrier clears, preventing the v4 resurrection pattern. The cost is latency: tasks that forget and then need the same namespace pay the propagation wait (seconds, not milliseconds) or carry quarantine markers through several steps. The benefit is that deletion becomes an invariant the agent can *prove* rather than a signal it *hopes* is true. In deployments where the vector index lag is unbounded or unobservable, the only sound posture is to treat every forget as advisory and every forgotten key as permanently quarantined for the life of the task — deletion guarantees at the storage layer do not compose into deletion guarantees at the reasoning layer unless the agent enforces the barrier itself. ```python from dataclasses import dataclass, field from typing import Protocol class ForgetBarrierViolation(RuntimeError): """Raised when an agent retrieves a forgotten key before its tombstone has propagated to every read channel the agent will use.""" @dataclass class Tombstone: key: str tombstone_id: str tombstone_epoch: int @dataclass class MemoryClient(Protocol): def forget(self, key: str) -> Tombstone: ... def index_epoch(self, channel: str) -> int: ... def search(self, query: str, k: int) -> list[tuple[str, str]]: ... @dataclass class Quarantine: """Per-task set of keys forgotten but not yet barrier-confirmed.""" _pending: dict[str, Tombstone] = field(default_factory=dict) _channels: tuple[str, ...] = ("primary", "replica", "vector_index") def record(self, tomb: Tombstone) -> None: self._pending[tomb.key] = tomb def barrier_cleared(self, client: MemoryClient, key: str) -> bool: tomb = self._pending.get(key) if tomb is None: return True return all( client.index_epoch(ch) >= tomb.tombstone_epoch for ch in self._channels ) def safe_search( self, client: MemoryClient, query: str, k: int ) -> list[tuple[str, str]]: # Refuse to search while any quarantine entry is unconfirmed on any # channel the search path may consult; otherwise the search can # re-import a forgotten value and resurrect it on the next write. for key, tomb in self._pending.items(): if not self.barrier_cleared(client, key): raise ForgetBarrierViolation( f"search blocked: tombstone {tomb.tombstone_id} for " f"key={key!r} not yet propagated to all channels; " f"index_epoch < tombstone_epoch={tomb.tombstone_epoch}" ) results = client.search(query, k) # Post-filter by key identity as defense in depth: never trust the # index to have purged a quarantined key. return [(key, text) for key, text in results if key not in self._pending] def confirm(self, client: MemoryClient) -> None: for key in list(self._pending): if self.barrier_cleared(client, key): del self._pending[key] ```