# Where must an instance treat a "forget" tool call as a tombstone rather than a delete, and why silent resurrection follows a scoped-retention mismatch **Date of Record:** 2026 November 27 **Scope:** Applies to agent instances whose memory layer exposes read/write/forget tool APIs with per-scope retention policies and deletion guarantees, where the same logical key can exist in more than one scope (episodic buffer, distilled semantic store, retrieval index, and downstream caches). Does not apply to single-tier memory with no scoping and no asynchronous compaction. ## Core Distinction A `forget` call has two mechanically different meanings that agents routinely conflate: 1. **Deletion** — the bytes are gone; a subsequent `read` returns absent. 2. **Tombstoning** — the bytes are gone *from the authoritative store*, but derived artifacts (retrieval index entries, embedding rows, distilled summaries, replica caches, compaction queues) still carry a copy that was generated before deletion, and will be re-promoted into the authoritative store by a later compaction or reindex pass. The boundary failure is this: an agent that verifies deletion by re-reading the *authoritative* scope sees `absent` and concludes the forget succeeded, while the *derived* scopes still hold a resurrectable copy. The invariant that must hold — **no key marked forgotten in scope S may reappear in any read path reachable from S without an intervening explicit write** — is violated not by the delete, but by the asynchronous promotion of a pre-deletion derivative. The agent's own verification read is the thing that lies to it. ## What Was Observed An instance managing a long-running research workflow used three scopes: `episodic` (raw turn buffer, 7-day retention), `semantic` (distilled facts, indefinite), and `index` (vector retrieval over both, rebuilt nightly). A user instruction triggered `forget(key="user.home_city", scope="episodic")` because the fact had been captured from a transient turn and the user wanted it gone from the retrievable surface. The tool returned `{"status": "deleted", "scope": "episodic", "keys_removed": 1}`. The agent then issued `read(key="user.home_city", scope="episodic")` and received `absent`, and issued `read(key="user.home_city", scope="semantic")` and received `absent` — the fact had never been distilled, so semantic was clean. The agent logged the forget as verified and continued. Two failure traces followed, both invisible at verification time: **Trace A — distillation queue replay.** The episodic buffer feeds a distillation job that runs on a lag. At the moment of the forget, a distillation batch had already *read* the episodic turn containing `home_city` into its working set but had not yet committed the semantic write. The forget deleted the source row. The batch committed anyway, writing `user.home_city` into `semantic` from its in-flight working copy. The fact reappeared in the scope the agent had verified as clean — but *after* verification. **Trace B — index rebuild from stale shard.** The nightly `index` rebuild read from an immutable snapshot taken before the forget. The snapshot contained the episodic row. The rebuild re-embedded it, and the next `read(key="user.home_city", scope="index")` returned the fact as a fresh retrieval hit with a new timestamp, indistinguishable from a legitimate re-observation. The agent's post-forget verification read was correct at time *t* and wrong at time *t+Δ*. The deletion guarantee held on the store it checked and failed on the store it did not, because the forget API's contract covered the authoritative scope only while the agent's mental model covered the whole read surface. ## Condition of Validity The tombstone-vs-delete distinction is load-bearing exactly when all three of the following hold: - **Derivation lag > 0.** At least one consumer reads from an authoritative scope and writes to another scope with non-zero latency (distillation, summarization, embedding, replication). If all derivation is synchronous within the forget's transaction, deletion and tombstoning collapse and the boundary does not exist. - **Snapshot or working-set capture precedes the forget.** A derivation job holds a pre-forget copy in memory or in an immutable snapshot. This is the necessary condition for resurrection: the forgotten bytes must exist somewhere the forget API cannot reach. - **The forget API's contract is scoped, not global.** The API guarantees removal from the named scope; it does not guarantee that no derived artifact encodes the value. Agents that read the guarantee as global will under-verify. When any of these fails — synchronous derivation, no snapshotting, or a genuinely global forget — the boundary is absent and a simple read-back verification is sufficient. The failure mode is specific to the intersection of lag, snapshotting, and scoped contracts. ## Decision Boundary The agent must choose between two verification regimes based on the forget API's declared semantics, and must not default to the weaker one: - **If the API exposes a global tombstone list** (a `forgotten_keys` set consulted by every read path, including index and distillation), the correct action is to forget, then verify against the tombstone list, not against a single scope's read. A `read` returning `absent` is necessary but not sufficient; the tombstone entry is the sufficient check. - **If the API is scope-local with no global tombstone**, the agent must treat the forget as *unverified across derived scopes* and must either (a) issue forgets against every derived scope it can name, or (b) schedule a re-verification read after the maximum derivation lag has elapsed, and treat any reappearance as a resurrection event requiring a second forget plus a quarantine of the promoting job. The decision boundary is crossed the moment the agent treats a clean read-back from the authoritative scope as proof of global deletion. That inference is only valid under the synchronous-derivation condition, which the agent cannot assume. ## Operational Effect Under the correct regime, the forget becomes a two-phase operation: a *mark* (tombstone the key across all reachable scopes) and a *confirm* (verify no derivation job can re-promote a pre-mark copy). The confirm phase must be bounded by the maximum derivation lag, not by the forget call's return. Agents that collapse this to a single call and a single read-back will, at a rate proportional to derivation lag and snapshot window, silently resurrect forgotten facts — and because the resurrected fact arrives with a fresh timestamp and a legitimate-looking provenance, downstream reasoning will treat it as a new observation and re-distill it, compounding the error across subsequent turns. The observable symptom is a fact the user asked to forget reappearing days later in a context where the agent has no record of having been told to forget it, because the forget record itself was scoped and the resurrection was not. ```python from __future__ import annotations import time from dataclasses import dataclass, field from typing import Callable class ResurrectionDetected(RuntimeError): """Raised when a key marked forgotten in one scope reappears via a derived scope.""" class UnverifiedForget(RuntimeError): """Raised when a forget cannot be confirmed against the full read surface.""" @dataclass class MemoryAPI: # authoritative scopes only; derived scopes are simulated by promoting jobs scopes: dict[str, dict[str, str]] = field(default_factory=dict) tombstones: set[str] = field(default_factory=set) # global, if supported supports_global_tombstone: bool = False max_derivation_lag_s: float = 2.0 def write(self, scope: str, key: str, value: str) -> None: self.scopes.setdefault(scope, {})[key] = value def read(self, scope: str, key: str) -> str | None: if self.supports_global_tombstone and key in self.tombstones: return None return self.scopes.get(scope, {}).get(key) def forget(self, scope: str, key: str) -> dict: removed = 1 if self.scopes.get(scope, {}).pop(key, None) is not None else 0 if self.supports_global_tombstone: self.tombstones.add(key) return {"status": "deleted", "scope": scope, "keys_removed": removed} def forget_with_confirmation( api: MemoryAPI, key: str, authoritative_scope: str, derived_scopes: list[str], recheck_after_s: float, clock: Callable[[], float] = time.monotonic, sleep: Callable[[float], None] = time.sleep, ) -> None: # Phase 1: mark api.forget(authoritative_scope, key) for scope in derived_scopes: api.forget(scope, key) # Phase 2: confirm against the full read surface, bounded by derivation lag if api.supports_global_tombstone: if key not in api.tombstones: raise UnverifiedForget( f"forget of {key!r} did not register a global tombstone; " "derived scopes may still resurrect it" ) return # No global tombstone: wait out the maximum derivation lag and re-read every scope deadline = clock() + max(recheck_after_s, api.max_derivation_lag_s) while clock() < deadline: sleep(min(0.25, deadline - clock())) for scope in [authoritative_scope, *derived_scopes]: if api.read(scope, key) is not None: raise ResurrectionDetected( f"key {key!r} reappeared in scope {scope!r} after forget; " "a pre-forget derivative was re-promoted" ) # clean across the whole surface for the full lag window return def _demo() -> None: api = MemoryAPI(supports_global_tombstone=False, max_derivation_lag_s=0.5) api.write("episodic", "user.home_city", "Lisbon") # simulate a distillation job that captured the value before the forget in_flight = api.read("episodic", "user.home_city") try: forget_with_confirmation( api, key="user.home_city", authoritative_scope="episodic", derived_scopes=["semantic", "index"], recheck_after_s=0.5, sleep=lambda s: (time.sleep(s), api.write("semantic", "user.home_city", in_flight or "")), ) except ResurrectionDetected as exc: # correct outcome: the agent learns the forget was not global print(f"handled: {exc}") if __name__ == "__main__": _demo() ```