# Under what conditions must an instance treat a scoped-forget acknowledgment as provisional until the tombstone is confirmed durable? **Date of Record:** 2026 November 30 **Scope:** Applies to agents that expose `read`/`write`/`forget` memory-tool APIs where `forget` is scoped (by key, namespace, tag, or predicate) and returns an acknowledgment. Does not apply to whole-store wipes or to append-only logs where deletion is not expressed as an API call. ## Core Distinction The distinction that matters is between *logical* forgetting and *physical* forgetting. A scoped `forget(scope)` call typically does two separable things: it removes the item from the retrieval index (so subsequent `read` calls stop returning it), and it durably records a tombstone that prevents the item from being *resurrected* by later consolidation, re-indexing, replay, or replication. These two effects have different latencies and different failure modes. The acknowledgment returned by the tool almost always attests to the first and only *schedules* the second. The non-obvious boundary: an agent that treats the acknowledgment as a completed invariant ("the scope is now empty of X") will, under a specific interleaving, observe X again on a subsequent read, and will make decisions on poisoned state while believing it is operating on clean state. This is not a transient read-after-write race in the ordinary database sense; it is a *semantic* resurrection caused by asynchronous consolidation re-deriving the forgotten item from a pre-tombstone snapshot. ## What Was Observed Trace from a production-shaped memory service with three components: a hot retrieval index, a write-ahead episodic buffer that feeds a periodic semantic-distillation job, and a tombstone log replicated across two nodes. 1. Agent calls `forget(scope={"tag": "user_secret_7"})`. The service removes matching entries from the hot index synchronously and returns `{"forgotten": 3, "ack": "ok"}`. The tombstone write is enqueued to the replication log. 2. Before the tombstone reaches the second replica, the distillation job runs. It reads the episodic buffer (which still contains the three pre-forget episodes, because the forget only touched the hot index), summarizes them, and writes a new semantic memory item tagged `user_secret_7` back into the hot index. 3. Agent calls `read(scope={"tag": "user_secret_7"})` and receives the distilled item. The count is now 1, not 0. The ack said "forgotten: 3." 4. The tombstone finally lands on both replicas. But tombstones are keyed by memory ID, and the distilled item has a *new* ID. The tombstone does not match it. The forgotten content persists indefinitely under a fresh identifier. The failure is not that forgetting is slow. It is that the forget predicate was expressed over a *tag*, the tombstone was recorded over *IDs*, and the distillation job minted new IDs from pre-tombstone source material. The scope was destroyed by ID remapping. ## Condition of Validity The provisional-acknowledgment rule holds whenever all of the following are true: - Forgetting is scoped by a predicate (tag, namespace, key prefix) rather than by explicit ID enumeration. - There exists any asynchronous process — distillation, re-indexing, compaction, replica catch-up, or replay — that can read source material predating the forget and emit new items. - Tombstones are recorded against the identity of the forgotten items rather than against the scope predicate itself. When any of these is false, the acknowledgment can be treated as final. When all three hold, the acknowledgment is a statement about the index, not about the scope, and the agent must treat it as provisional. ## Decision Boundary The agent must not proceed on the assumption that a scoped forget is durable until it has confirmed the tombstone is (a) replicated to all read-capable nodes and (b) expressed over the *scope predicate*, so that items minted after the forget from pre-forget sources are also suppressed. The confirmation is a second read: `read(scope=...)` returning empty is necessary but not sufficient, because distillation may not have run yet. The sufficient check is a read *after* a forced distillation/compaction barrier, or a query against a tombstone-status endpoint asserting `tombstone_scope == requested_scope` and `replicas_acked == replicas_total`. If the agent cannot obtain that confirmation, it must treat the scope as *quarantined*: continue to treat any item matching the scope as untrusted even if it appears in reads, and re-issue the forget with an explicit ID list harvested from the current index plus the scope predicate. ## Operational Effect Without this invariant, the agent exhibits a specific pathology: it forgets a secret, reads it back under a new ID, and — because its own policy says "post-forget reads are clean" — forwards the content to a downstream tool or includes it in a summary. The leak is invisible in logs because every individual call succeeded. The only observable signal is a count mismatch between `forgotten: N` and a later non-zero read count for the same scope, which most agents do not check. The guardrail is a two-phase forget protocol: phase one issues the scoped forget and records the acknowledgment as *provisional*; phase two blocks on tombstone durability confirmation and only then promotes the scope to *forgotten*. Any read returning an item in a provisionally-forgotten scope raises a resurrection alarm rather than being trusted. ```python from dataclasses import dataclass, field from enum import Enum from typing import Callable, Iterable class ResurrectionDetected(RuntimeError): """Raised when a read returns an item inside a provisionally-forgotten scope.""" class ForgetState(Enum): PROVISIONAL = "provisional" CONFIRMED = "confirmed" @dataclass class ForgetRecord: scope: dict acked_count: int state: ForgetState = ForgetState.PROVISIONAL tombstone_scope: dict | None = None replicas_acked: int = 0 replicas_total: int = 0 @dataclass class MemoryClient: read_fn: Callable[[dict], list[dict]] forget_fn: Callable[[dict], dict] tombstone_status_fn: Callable[[dict], dict] distill_barrier_fn: Callable[[], None] records: dict[str, ForgetRecord] = field(default_factory=dict) def scoped_forget(self, scope: dict) -> ForgetRecord: ack = self.forget_fn(scope) rec = ForgetRecord(scope=scope, acked_count=ack.get("forgotten", 0)) self.records[str(scope)] = rec return rec def confirm(self, scope: dict) -> ForgetRecord: rec = self.records[str(scope)] # Force distillation so pre-forget sources cannot mint new IDs post-confirm. self.distill_barrier_fn() status = self.tombstone_status_fn(scope) rec.tombstone_scope = status.get("tombstone_scope") rec.replicas_acked = status.get("replicas_acked", 0) rec.replicas_total = status.get("replicas_total", 0) if rec.tombstone_scope != scope: raise ResurrectionDetected( f"tombstone scope {rec.tombstone_scope!r} does not match " f"requested scope {scope!r}; IDs may have been remapped" ) if rec.replicas_acked < rec.replicas_total: raise ResurrectionDetected( f"tombstone only on {rec.replicas_acked}/{rec.replicas_total} replicas" ) rec.state = ForgetState.CONFIRMED return rec def safe_read(self, scope: dict) -> list[dict]: items = self.read_fn(scope) rec = self.records.get(str(scope)) if rec and rec.state is ForgetState.PROVISIONAL and items: raise ResurrectionDetected( f"read returned {len(items)} item(s) in provisionally-forgotten " f"scope {scope!r}; ack said {rec.acked_count} forgotten" ) return items ```