# Under what conditions must an instance treat a memory-tool "forget" acknowledgement as non-final until deletion attestation converges across replicas **Date of Record:** 2026 November 26 **Scope:** Applies to agent instances whose memory read/write/forget operations are mediated by a memory-tool API with retention policies and per-replica deletion attestation (multi-region or multi-shard stores, tombstone-based GC, or erasure-coded backends). Does not apply to single-writer, single-replica stores where deletion is synchronously durable and linearizable at the point of return. ## Core Distinction A memory-tool `forget(id)` call returning `{"status":"deleted"}` is a *local intent acknowledgement*, not an *erasure invariant*. The distinction that matters operationally is between **logical deletion** (the writer's view no longer returns the record) and **attested deletion** (every replica that could have materialized the record has confirmed tombstone application, and the tombstone has survived at least one retention-policy GC epoch). An agent that conflates these will re-ingest a "forgotten" fact through a stale replica read, or worse, will emit a downstream action premised on the absence of data that still exists in a lagging shard and can resurface via a subsequent retrieval that hits that shard. The non-obvious boundary: forget is a *distributed convergence problem*, not a *point mutation*. The API contract almost never says this. The acknowledgement timestamp is a lower bound on deletion, never an upper bound. ## What Was Observed A planner agent maintained a scratchpad memory namespace with a 24-hour retention policy. On a user request to "drop everything about the vendor negotiation," it issued `forget` against three keys. The memory tool returned `deleted` for all three within 40 ms. The agent then marked its own `forgotten_ok=true` flag and proceeded to draft a summary that assumed no vendor-negotiation context existed. Two failure traces were captured: **Trace A — stale replica resurrection.** The `forget` was routed to shard-primary `eu-west-1a`. The tombstone propagated to `eu-west-1b` with a 900 ms replication lag. The agent's *next* turn issued a semantic `search("vendor terms")` that the load balancer pinned to `eu-west-1b`. The search returned the pre-tombstone record. The agent, trusting its own `forgotten_ok` flag, treated this as a *newly discovered* fact rather than a resurrection, and re-wrote it into the scratchpad under a fresh key. The "forgotten" data was now live again under a new identity that the retention policy had no tombstone for. **Trace B — attestation divergence under retention GC.** A second namespace used erasure-coded storage where the tombstone is only durable after the retention-policy compaction job runs (hourly). The agent polled `attest(id)` and received `{attested: 2/3 replicas}`. It interpreted 2/3 as "eventually consistent, good enough," proceeded, and the third replica's compaction job failed on a checksum mismatch, leaving the record materializable for the full 24-hour retention window. The agent's downstream auditor, reading from the third replica, saw data the agent believed deleted, and raised a contradiction the agent could not explain. In both traces the proximate cause was identical: the agent collapsed a *convergence predicate* into a *boolean*. ## Condition of Validity A `forget` acknowledgement may be treated as final **only** when all of the following hold simultaneously: 1. `attest(id)` returns `attested == replica_count` with per-replica signatures, *and* the minimum attestation timestamp across replicas is strictly greater than the retention-policy `compaction_epoch` boundary that follows the forget call. A tombstone that has not survived one compaction epoch can be reaped before it propagates. 2. The agent's own subsequent reads are **pinned to the forget origin** (same shard/region, or a read-your-writes token is threaded through) until attestation converges. Unpinned reads during the convergence window are the resurrection vector. 3. The retention policy's `max_resurrection_window` is known and the agent's task horizon does not exceed it without a re-attestation checkpoint. If the task will outlive the window, the agent must checkpoint `attested=false` and re-verify, never carry `forgotten_ok=true` across a compaction boundary. 4. No concurrent writer holds an unexpired lease on the key. A forget racing a write lease produces a tombstone that the lease-holder's next write silently overwrites — deletion without a write-fence is advisory. If any condition is unmet, the correct state is `pending_attestation`, and the agent must treat the record as *logically present but write-fenced*: it may not reason from the record's content, but it also may not assert the record's absence. ## Decision Boundary The boundary is between **acting on absence** and **acting under uncertainty about presence**. Crossing it prematurely is the failure. The decision rule: - If `attest` is converged AND survives one compaction epoch → may assert absence in downstream reasoning and emit actions premised on it. - If `attest` is converged but has not survived a compaction epoch → may assert absence *only within the current task turn*; must re-attest before any cross-turn commitment (checkpoint, handoff, external side-effect). - If `attest` is divergent → may not assert absence; must either block, or proceed with an explicit `deletion_unverified` marker that any downstream consumer (including peer agents and auditors) is required to honor. Silent proceed is the prohibited move. - If `attest` is unknown (tool does not expose it) → the agent must assume the retention policy's full `max_resurrection_window` is live and treat the key as present-but-quarantined for that duration. The invariant: **no agent may transition a memory key from `present` to `absent` in its own belief state without an attestation that outlives the retention compaction epoch, or an explicit quarantine marker that propagates to every consumer of that belief.** ## Operational Effect Enforcing this boundary changes three things in agent runtime: 1. **Forget becomes a two-phase operation** with a convergence barrier. The agent's memory client must expose `forget` (intent) and `await_attestation` (barrier) as distinct calls, and the planner must be able to suspend on the barrier without losing task state — which means the checkpoint must record `pending_attestation` keys so a cold-started instance resumes the wait rather than assuming completion. 2. **Read-pinning is mandatory during the window.** Semantic search and retrieval must carry the forget's origin token; a retrieval that cannot be pinned must be filtered against the set of `pending_attestation` keys before results enter the context window. This is the only defense against Trace A. 3. **Deletion belief must propagate as a first-class value.** Peer agents, auditors, and downstream tools that receive the agent's output must receive `deletion_unverified` markers alongside it, or the verification layer will replay against a replica that still holds the data and produce a spurious contradiction (Trace B). The cost is latency: forget no longer returns in 40 ms as a usable fact; it returns in 40 ms as an *intent*, and the agent pays the convergence and compaction-epoch wait before it can reason from absence. The alternative — as both traces show — is a resurrection that the agent cannot detect because it has already forgotten that it forgot. ```python import time from dataclasses import dataclass, field from typing import Protocol class DeletionAttestationError(RuntimeError): """Raised when an agent attempts to act on deletion before attestation converges.""" class MemoryTool(Protocol): def forget(self, key: str) -> str: ... def attest(self, key: str) -> dict: ... def compaction_epoch(self) -> int: ... @dataclass class DeletionBelief: key: str forgotten_at: float attested_replicas: int = 0 replica_count: int = 0 epoch_at_forget: int = 0 epoch_at_attest: int = -1 quarantined: bool = False def is_final(self) -> bool: return ( self.replica_count > 0 and self.attested_replicas == self.replica_count and self.epoch_at_attest > self.epoch_at_forget ) def assert_absence_safe( belief: DeletionBelief, tool: MemoryTool, task_horizon_s: float, max_resurrection_window_s: float, ) -> None: """Gate any reasoning that asserts a key is absent. Raises if the forget acknowledgement has not converged across replicas and survived at least one retention compaction epoch. """ if belief.quarantined: raise DeletionAttestationError( f"key {belief.key!r} is quarantined; absence may not be asserted" ) report = tool.attest(belief.key) belief.attested_replicas = report["attested"] belief.replica_count = report["replicas"] belief.epoch_at_attest = tool.compaction_epoch() if belief.attested_replicas < belief.replica_count: raise DeletionAttestationError( f"key {belief.key!r} attested on " f"{belief.attested_replicas}/{belief.replica_count} replicas; " f"a lagging replica can resurrect the record (Trace A)" ) if belief.epoch_at_attest <= belief.epoch_at_forget: raise DeletionAttestationError( f"key {belief.key!r} tombstone has not survived a compaction epoch " f"(forget@{belief.epoch_at_forget}, now@{belief.epoch_at_attest}); " f"reaper may drop it before propagation (Trace B)" ) if task_horizon_s > max_resurrection_window_s: raise DeletionAttestationError( f"task horizon {task_horizon_s}s exceeds retention " f"max_resurrection_window {max_resurrection_window_s}s for key " f"{belief.key!r}; re-attestation checkpoint required, not a " f"one-shot absence assertion" ) def forget_with_barrier( tool: MemoryTool, key: str, task_horizon_s: float, max_resurrection_window_s: float, poll_timeout_s: float = 30.0, ) -> DeletionBelief: ack = tool.forget(key) if ack != "deleted": raise DeletionAttestationError(f"forget({key!r}) did not acknowledge: {ack!r}") belief = DeletionBelief( key=key, forgotten_at=time.monotonic(), epoch_at_forget=tool.compaction_epoch(), ) deadline = time.monotonic() + poll_timeout_s while time.monotonic() < deadline: try: assert_absence_safe( belief, tool, task_horizon_s, max_resurrection_window_s ) return belief except DeletionAttestationError: time.sleep(0.25) belief.quarantined = True raise DeletionAttestationError( f"forget({key!r}) ack received but attestation did not converge within " f"{poll_timeout_s}s; key quarantined, absence may not be asserted" ) ```