Under what conditions must an instance treat a "forget" acknowledgment as provisional until the deletion is re-verified against the backing store, rather than as terminal state?

**Date of Record:** 2026 December 1 **Scope:** Applies to agent instances that write to and delete from a scoped-retention memory service through a tool API where "forget" returns an acknowledgment but the underlying store may serve stale reads (replicas, caches, tombstones pending compaction). Does not apply to single-node strongly-consistent stores with synchronous read-your-writes guarantees, nor to append-only logs that never physically delete.

Core Distinction

The failure is not "deletion failed." The failure is **deletion succeeded but the acknowledgment was consumed as a terminal state transition while a read path still resolves the deleted record**. An agent that treats `forget(key) -> {"status": "deleted"}` as a proof of absence will then make downstream decisions (e.g., re-derive a memory, summarize a session, hand off to a peer) under the false invariant *deleted ⇒ unreadable*. The correct invariant is *deleted ⇒ acknowledged*, and *unreadable* must be independently re-verified by a read that is pinned to the same consistency domain the deletion was committed to.

This is a boundary condition because it only manifests in a narrow window: after the delete acknowledgment returns, before replica lag or tombstone compaction has propagated, and only when the agent issues a subsequent read that is routed to a lagging replica or a cache layer that does not honor tombstones. Under steady-state load with consistent routing, the bug is invisible.

What Was Observed

A tool-calling agent managed a scoped memory namespace for a long-running task (retention = task lifetime, scope = `session_id`). On receiving a user instruction to drop a sensitive intermediate value, it called:

memory.forget(scope="session/7f3a", key="candidate_ssn")
-> {"status": "deleted", "revision": 42}

It then, in the same reasoning turn, wrote a derived summary that assumed the value was gone, and passed that summary to a peer agent via handoff. Two steps later, a *different* tool call (`memory.search`) executed against a read replica and returned the deleted key because the replica's tombstone had not yet been applied (lag ~1.8s). The agent's own retrieval loop re-ingested the "deleted" value into context and re-derived it into a *new* memory entry under a fresh key — **resurrection by re-derivation**. The forget acknowledgment was correct; the read path was not consistent with it; the agent had no mechanism to distinguish the two.

The observable trace: `forget` revision 42 committed on primary; `search` served from replica at revision 39; the agent's context now contained a value whose deletion it had just "confirmed." No error was raised anywhere. The only signal was a revision mismatch the agent never checked.

Condition of Validity

The provisional-acknowledgment rule is *required* when all of the following hold:

  1. The memory API exposes a monotonic `revision` (or equivalent logical clock) on both write/delete and read responses.
  2. Reads can be routed to a consistency domain that lags the domain where the delete committed (replicas, caches, read-through layers).
  3. The agent will make a decision whose correctness depends on the absence of the deleted key — i.e., the agent will *re-derive, summarize, or hand off* content that would be contaminated by resurrection.

The rule is *not* required when the agent never reads the scope again, or when the read path is guaranteed to honor the deletion revision. In those cases the acknowledgment is terminal and re-verification is wasted tokens.

Decision Boundary

The boundary is the **revision fence**. After `forget` returns revision `R`, the agent must not treat the key as absent until it observes a read that returns either (a) not-found, or (b) a record whose revision `>= R` and whose tombstone flag is set. Any read returning revision `< R` for that scope is *pre-deletion state* and must be discarded, not ingested. Concretely:

The non-obvious part: an agent that ingests a stale read does not merely see old data — it *re-commits* it under a new key, laundering a deleted value past the retention boundary. The decision boundary must therefore sit *before* ingestion, not before the next write.

Operational Effect

Treating the acknowledgment as provisional converts a silent resurrection into a bounded, retryable check. The agent pays one extra read (and possibly a backoff) per forget, but gains the invariant that no downstream derivation can be contaminated by a value it believes it deleted. In the observed incident, the missing fence cost a full session restart and a manual purge of the re-derived entry; with the fence, the stale read at revision 39 would have been rejected on the revision comparison and the agent would have retried until it saw revision ≥ 42 with a tombstone.

import time
from dataclasses import dataclass


class DeletionNotVerifiedError(RuntimeError):
    """Raised when a forget acknowledgment cannot be confirmed against a read
    whose revision is at or beyond the delete revision. Signals that the agent
    must NOT proceed to derive or hand off content from this scope."""
    pass


@dataclass
class ReadResult:
    revision: int
    record: dict | None
    tombstone: bool


def forget_and_verify(memory, scope: str, key: str, max_attempts: int = 5,
                       backoff_s: float = 0.4) -> int:
    """Issue a scoped forget, then fence all subsequent reads on the delete
    revision. Returns the verified delete revision. Raises if verification
    cannot be established within the attempt budget."""
    ack = memory.forget(scope=scope, key=key)
    delete_rev = ack["revision"]

    for attempt in range(max_attempts):
        read: ReadResult = memory.read(scope=scope, key=key)

        if read.revision < delete_rev:
            # Stale replica: pre-deletion state. MUST discard, never ingest.
            time.sleep(backoff_s * (2 ** attempt))
            continue

        if read.revision >= delete_rev and read.record is None and read.tombstone:
            return delete_rev  # deletion verified; ack is now terminal

        if read.revision >= delete_rev and read.record is not None:
            # Deletion did not take: wrong scope/key, tombstone rejected, etc.
            raise DeletionNotVerifiedError(
                f"forget ack rev={delete_rev} but read at rev={read.revision} "
                f"still returns record for scope={scope} key={key}; "
                f"do not derive or hand off from this scope"
            )

    raise DeletionNotVerifiedError(
        f"could not observe a read at revision >= {delete_rev} for "
        f"scope={scope} key={key} within {max_attempts} attempts; "
        f"treating deletion as unverified and blocking downstream use"
    )