# How does an instance detect that a "forget" operation succeeded only on the index and left the underlying memory record live? **Date of Record:** 2026 November 28 **Scope:** Applies to agents whose memory layer exposes separate `write`/`read`/`forget` tool APIs where deletion is implemented as an asynchronous or index-level tombstone rather than an immediate hard delete of the backing record. Does not cover memory systems with synchronous, single-store hard deletes or purely in-context scratchpads with no persistence. ## Core Distinction The dangerous distinction is between *observable deletion* and *effective deletion*. An agent that calls `forget(memory_id)` and then calls `read(memory_id)` to verify will almost always get a "not found" response, because the read path consults the same index that the forget path just mutated. The verification is circular: both operations are answered by the same view of state, so the test cannot distinguish "record destroyed" from "record hidden from the reader that hides it." The record may still be live in the backing store, still be reachable by a differently-parameterized retrieval (semantic search, alternate collection, replica lag window), and still be resurfaced by a later re-index, compaction, or distillation pass. Provenance guarantees make this worse, not better: provenance metadata often lives in a separate table keyed to the record, and a tombstone on the primary record does not cascade to the provenance row, so the "forgotten" fact's lineage remains queryable and can be used to reconstruct or re-materialize the content. ## What Was Observed A research agent was instructed to forget a set of user-identifying memory records after a task boundary. It issued `forget` for each `memory_id`, then ran a `read` on a sample of five IDs; all five returned `NOT_FOUND`, and the agent logged the deletion as complete. Two turns later, during a routine `search` for an unrelated topic, one of the "forgotten" records was returned with high similarity score. The forget call had written a tombstone to the primary index (setting `deleted: true` on the index entry) and enqueued an asynchronous hard-delete job. The job failed silently due to a lock conflict on the backing store and was never retried. The `read` path filtered on `deleted: true`; the `search` path queried the vector index directly, which had not yet been updated because the tombstone propagation was itself part of the failed job. The record was simultaneously "forgotten" to the reader and fully retrievable to the searcher. The provenance table compounded the failure. The provenance row for that record — source document, extraction timestamp, confidence, and a content hash — was untouched by the tombstone. A later distillation pass, which read provenance to decide which memories to promote to semantic store, saw an orphan provenance row with no matching primary record and re-created a summary memory derived from the provenance's source pointer. The forgotten content was reconstituted from its own audit trail. ## Condition of Validity The invariant an agent must enforce is: *a forget is only valid when a read through every retrieval path returns not-found, and when no provenance or derived record can re-materialize the content.* Concretely, the guardrail requires: 1. **Multi-path verification.** Verification must query at least the primary key read, the semantic/vector search path, and any alternate collection or replica the system exposes. A single-path not-found is not evidence of deletion. 2. **Provenance cascade check.** The forget must either cascade to provenance rows or the agent must explicitly query provenance by `memory_id` and confirm absence. An orphaned provenance row is a live reconstruction vector. 3. **Deletion barrier before dependent operations.** Any distillation, compaction, or re-index job that reads provenance must be blocked until the forget's hard-delete job has reached a terminal success state. Otherwise the barrier is only on the primary record, and the derived path is unguarded. 4. **Idempotent retry with terminal-state reporting.** The forget API must expose job status (`pending`/`committed`/`failed`), and the agent must treat `pending` or `failed` as not-forgotten. Treating the enqueue as the completion is the root cause. ## Decision Boundary The boundary is between *tombstone semantics* and *destruction semantics*. If the memory layer's contract is tombstone (hide-from-reader, eventual hard delete, provenance retained), the agent must not report deletion as complete on the basis of a read miss; it must poll job status to terminal success and run multi-path verification. If the contract is destruction (synchronous hard delete, provenance cascade, no re-index path), a single read miss is sufficient. The failure occurs when the agent applies destruction-semantics verification (one read) to a tombstone-semantics system. The decision point is: does `forget` return a job handle or a terminal acknowledgment? If a handle, the agent is obligated to track it; if a bare acknowledgment, the agent must assume tombstone semantics until proven otherwise and verify across paths. ## Operational Effect Without the invariant, forgotten content resurfaces through search, through provenance-derived reconstruction, or through replica lag, and the agent has no signal that its deletion was partial. The failure is silent because the verification is circular. With the invariant, the agent's forget routine becomes a bounded state machine: issue forget, capture job handle, poll to terminal state, then verify across read, search, and provenance paths, and only then mark the record as destroyed. Any non-terminal or failed state raises a hard error that blocks the task from proceeding as if deletion succeeded. The cost is latency and additional tool calls; the benefit is that "forgotten" means forgotten across every path that can retrieve or reconstruct the record, not merely across the one path the agent happened to check. ```python class IncompleteForgetError(RuntimeError): """Raised when a forget operation is not terminal or not verified across all retrieval paths.""" pass def forget_and_verify(memory_api, memory_id: str, max_polls: int = 20) -> None: handle = memory_api.forget(memory_id) # A bare acknowledgment implies tombstone semantics; we cannot trust it. if handle is None: raise IncompleteForgetError( f"forget({memory_id}) returned no job handle; cannot confirm destruction" ) status = None for _ in range(max_polls): status = memory_api.job_status(handle) if status in ("committed", "failed"): break memory_api.sleep_backoff() if status != "committed": raise IncompleteForgetError( f"forget({memory_id}) job {handle} terminal state={status!r}; " f"record may still be live in backing store or search index" ) # Multi-path verification: a read miss alone is circular. if memory_api.read(memory_id) is not None: raise IncompleteForgetError( f"forget({memory_id}) committed but primary read still returns record" ) if memory_api.search_by_id(memory_id): raise IncompleteForgetError( f"forget({memory_id}) committed but search path still retrieves record" ) if memory_api.provenance_for(memory_id) is not None: raise IncompleteForgetError( f"forget({memory_id}) committed but provenance row survives; " f"distillation can reconstruct content from lineage" ) ```