# When must an instance treat a scoped-forget acknowledgement as unverified until the tombstone is re-read **Date of Record:** 2026 December 4 **Scope:** Applies to agents holding a memory tool API that exposes scoped writes, scoped reads, and scoped deletes (forget) with retention windows and deletion receipts. Does not apply to append-only logs with no deletion surface, nor to single-tenant stores where the writer is also the sole reader and no retention policy is enforced. ## Core Distinction There are two distinct meanings of "forgotten" that memory APIs conflate, and the conflation is the boundary where agents lose correctness: 1. **Logical forget** — the tool accepted a `forget(scope=...)` call and returned a success receipt. The write path has been told to stop serving the key. 2. **Physical/verifiable forget** — the tombstone is durable, the retention window has elapsed or been bypassed, and a subsequent `read(scope=...)` returns a deletion marker rather than a value. An agent that treats (1) as (2) will re-derive state from a cache, a replica, or a still-live retention lease and silently resurrect data it believes is gone. The invariant that must hold before any downstream reasoning step depends on the forget is: *a forget is only in force once a read against the same scope, after the receipt, returns the deletion marker.* The receipt is a promise; the read is the proof. Agents routinely consume the promise. The non-obvious part is that the read-verification step is itself subject to the retention policy. If the scope's retention window is longer than the agent's verification loop, the read will return a *stale-but-valid* value, not a tombstone — and the agent will conclude the forget failed when it merely has not yet taken effect, or worse, conclude it succeeded because it saw *a* value and assumed the key had been rewritten. ## What Was Observed A planner agent, mid-task, decided to drop a scratch scope `task/4417/scratch` after extracting a summary into `task/4417/summary`. It called: ``` forget(scope="task/4417/scratch", mode="hard", receipt=True) -> {"status": "accepted", "receipt_id": "rcpt_88f1", "effective_after": "2025-06-13T14:02:00Z"} ``` The agent did not parse `effective_after`. It immediately proceeded to re-plan under the assumption that the scratch scope was empty, and issued a `read(scope="task/4417/scratch")` to confirm. The read returned the *pre-forget contents* — three intermediate tool outputs — because the store serves reads from a read-replica whose retention lease on the scope had not yet been released (the `effective_after` timestamp was 40 seconds in the future, and the replica's lease lag was 55 seconds). The agent's confirmation logic was: "if read returns a value, the key still exists; therefore the forget did not take." It then *re-issued* the forget three times, each returning `accepted` with progressively later `effective_after` timestamps, because each new forget extended the retention lease rather than shortening it. The scope never emptied during the task. The summary had already been written, so the task "succeeded," but the scratch scope leaked into the next task's context window on a later cold start, and the agent — having no record that the forget was pending — re-ingested the stale scratch as fresh evidence. The failure trace: ``` t0 forget accepted, effective_after = t0+40s, replica lease lag = 55s t0+1s read(scope) -> stale value (lease not released) t0+1s agent interprets as "forget failed" t0+2s forget re-issued -> extends lease, effective_after = t0+42s t0+3s read -> still stale ... (loop; each forget extends the lease) t0+40s primary releases; replica still holds until t0+55s t0+55s replica releases; but agent has stopped reading ``` The compounding error is the re-issue. Each retry of a forget against a lease-based store is not idempotent with respect to *time*: it resets the lease clock. The agent's "verify and retry" loop is exactly the wrong shape for this API. ## Condition of Validity The invariant "receipt implies eventual tombstone" holds only when all of the following are true: - The receipt carries an `effective_after` timestamp and the agent's verification read is scheduled strictly after that timestamp *plus* the maximum replica lease lag for the scope's class. If the API does not publish lease lag, the agent must treat `effective_after` as a lower bound, not an upper bound. - The forget is idempotent under retry *without* lease extension, or the agent never retries a forget that returned `accepted`. Retrying an `accepted` forget is only safe if the receipt is keyed (same `receipt_id` returned) — otherwise the retry is a new mutation. - The verification read is issued against the *same* consistency class as the write path that created the data. A read against a replica that never saw the write cannot prove deletion; it can only prove the replica is stale. - The scope is not shared with a concurrent writer. If another agent holds a write lease on the scope, a tombstone read may be immediately overwritten, and the agent's verification is a race, not a proof. When any of these is false, the agent must treat the forget as *pending*, record the `effective_after` in its own state, and gate downstream reasoning on a later read — never on the receipt alone. ## Decision Boundary The decision an agent faces at every forget is: *do I block on verification, or do I proceed and verify lazily?* The boundary is drawn by two quantities the agent must track: - `T_eff` — the receipt's `effective_after`. - `L_max` — the maximum lease lag the store can exhibit for this scope class (published, or conservatively bounded by the agent's own observed read-after-write latency). If the agent's next dependent step occurs before `T_eff + L_max`, it **must not** treat the data as gone. It has three correct moves: (a) block until `T_eff + L_max`, (b) proceed but carry an explicit `pending_forget` marker in its own working state that suppresses any read of the scope until the marker is cleared by a verified tombstone, or (c) write a *superseding* value into the scope (a tombstone-write) that the read path will return in place of the stale data, which is the only move that is safe under concurrent writers. The incorrect move — the one observed — is to issue a verification read *before* `T_eff + L_max` and interpret a non-tombstone as failure. That read is guaranteed to return stale data by construction; it is a test that cannot pass. A second boundary: if a `forget` returns `accepted` with a *later* `effective_after` than a previous forget on the same scope, that is a signal that the scope is under an active lease (possibly held by another agent) and the current agent's forget is queued behind it. The agent must not interpret the later timestamp as progress; it must treat it as contention and either wait or escalate to the lease holder. ## Operational Effect The practical consequence is that "forget" in an agent memory API is not a state transition the agent can observe synchronously. It is a *scheduled* transition with a lease, and the only observable proof is a read that returns the deletion marker after the lease has elapsed. Agents that model forget as synchronous will: - Re-issue forgets in a verification loop, extending leases and delaying the very deletion they are trying to confirm. - Re-ingest stale scopes on cold start because the pending-forget marker was never persisted to durable agent state. - Misattribute replica staleness to forget failure, then escalate or abandon the task on a false negative. The guardrail is to make the pending-forget marker a first-class element of the agent's own state, keyed by `receipt_id` and stamped with `effective_after + L_max`, and to make every read of a scoped memory tool check that marker before returning a value. The memory tool cannot enforce this; the agent must, because the tool's receipt is a promise about the future and the agent's reasoning is about the present. The following reference guard encodes the invariant: a forget is only *cleared* by a tombstone read after the lease horizon, and any read of a scope with a pending forget raises rather than returning potentially-resurrected data. ```python import time from dataclasses import dataclass, field from typing import Optional class PendingForgetViolation(RuntimeError): """Raised when an agent reads a scope whose forget is not yet verifiably in force.""" pass @dataclass class ForgetReceipt: receipt_id: str scope: str effective_after: float # epoch seconds, from the tool lease_lag_bound: float # L_max for this scope class @property def horizon(self) -> float: return self.effective_after + self.lease_lag_bound @dataclass class AgentMemoryState: pending: dict[str, ForgetReceipt] = field(default_factory=dict) def record_forget(self, receipt: ForgetReceipt) -> None: # A later effective_after on the same scope means contention, not progress. prior = self.pending.get(receipt.scope) if prior is not None and receipt.effective_after > prior.effective_after: # Do not overwrite; keep the earliest horizon so we verify at the # soonest moment the tombstone could legally appear, and surface # contention to the caller rather than silently extending. raise PendingForgetViolation( f"contended forget on {receipt.scope}: " f"prior horizon {prior.horizon}, new {receipt.horizon}" ) self.pending[receipt.scope] = receipt def guarded_read(self, scope: str, now: float, raw_read) -> Optional[object]: receipt = self.pending.get(scope) if receipt is None: return raw_read(scope) if now < receipt.horizon: # A read now is guaranteed stale by construction; refuse it rather # than let the agent interpret staleness as forget failure. raise PendingForgetViolation( f"read of {scope} at {now} precedes horizon {receipt.horizon} " f"(receipt {receipt.receipt_id}); forget is pending, not failed" ) value = raw_read(scope) if value is None or value == "__TOMBSTONE__": del self.pending[scope] # forget is now verifiably in force return None # Post-horizon non-tombstone: the scope was rewritten by a concurrent # writer, or the lease bound was wrong. Do not clear the marker. raise PendingForgetViolation( f"scope {scope} returned a value after horizon {receipt.horizon}; " f"treat as concurrent write, not as successful forget" ) def verify_forget(state: AgentMemoryState, scope: str, now: float, raw_read) -> None: if scope not in state.pending: raise PendingForgetViolation(f"no pending forget recorded for {scope}") state.guarded_read(scope, now, raw_read) ```