# Under what conditions must an instance treat a `forget` success as a tombstone rather than a delete, and why a subsequent `read` that misses proves nothing **Date of Record:** 2026 November 30 **Scope:** Applies to any agent that mutates its own long-term store through explicit `write`/`read`/`forget` tool calls where the store is sharded, replicated, or cache-fronted and where `forget` returns before tombstone propagation completes. Does not apply to single-node strongly-consistent stores where `forget` is linearizable against `read` on the same key. ## Core Distinction A `forget` call has two semantically distinct meanings that the tool surface almost never disambiguates: 1. **Physical delete** — the key's value is gone from the authoritative store; any subsequent `read` returning a value is a stale-replica artifact. 2. **Tombstone** — the key is marked "do not resurrect and do not serve," but the underlying bytes may still exist in replicas, caches, and embedding indexes for an unbounded interval. A `read` returning *nothing* after a `forget` is not evidence the delete completed; it is equally consistent with a replica that has already applied the tombstone filter, a replica that has not yet received the write, or a routing layer that silently dropped the key. The boundary failure is that an agent, reasoning probabilistically over a tool result, conflates these. It issues `forget(k)`, then `read(k)`, observes an empty result, and concludes "k is gone." It then writes a *new* value under `k` or a key derived from `k`, believing it is starting clean. The tombstone later propagates to the replica that accepted the new write, and the tombstone wins — the freshly written memory is silently erased, or worse, the old value resurrects on a replica that applied the tombstone *before* the new write but whose anti-entropy merge orders the new write first. ## What Was Observed A multi-session research agent maintained a `facts` namespace. In session A it wrote `facts.user_timezone = "UTC-8"`. In session B, after a user correction, it called `forget("facts.user_timezone")`, received `{"ok": true, "deleted": 1}`, then `read("facts.user_timezone")` returned `{"found": false}`. The agent logged "timezone fact cleared" and wrote `facts.user_timezone = "UTC+1"`. In session C (four hours later, routed to a different replica), `read("facts.user_timezone")` returned `"UTC-8"`. The tombstone from session B had propagated to the replica holding the `UTC+1` write and deleted it; the `UTC-8` value lived on a replica that had never received the session-B tombstone because the tombstone's vector clock was dominated by a compaction event on that shard. The agent had no way to detect this from any single tool response — every individual call returned `ok`. The tell, visible only in aggregate logs, was that `forget` returned `deleted: 1` (a count of *keys matched*, not *bytes removed*) and the subsequent `read` hit a cache that had been invalidated by the tombstone but whose miss was indistinguishable from a never-existed miss. ## Condition of Validity The "forget means gone" inference is valid only when **all** of the following hold: - The store exposes a monotonic `version` or `tombstone_epoch` on `forget` responses, and `read` responses carry the same epoch, and the agent compares them. - `read` after `forget` is routed to the same consistency domain (same shard, same read-your-writes guarantee) as the `forget` — which the agent must be able to assert, not assume. - The store's documented semantics state that `forget` is linearizable with respect to `read` on the same key, and that the returned count is a delete confirmation rather than a match count. If any of these is unknown, the correct operational stance is: **`forget` returns a tombstone-intent, not a completion.** The agent must treat the key as *quarantined*, not *free*, until either (a) a `read` returns a version strictly greater than the tombstone's epoch with `found: false`, or (b) a documented propagation bound (e.g., "tombstones visible to all replicas within 60s") has elapsed and is verifiable. ## Decision Boundary The agent must not reuse a forgotten key for a *new* write until the tombstone has demonstrably propagated past the write's target replica. The safe pattern is **generation bumping**: never write to `k` after `forget(k)`; write to `k@gen+1` where `gen` is read from the tombstone response. This makes resurrection impossible by construction, because the old value can only ever reappear under `k@gen`, which the agent's read path is instructed to ignore. The unsafe pattern — and the one agents default to under token pressure — is `forget(k); write(k, v)`. This is a race between the tombstone's anti-entropy merge and the new write's replication, with no ordering guarantee the agent can observe. The decision boundary is therefore: **if the tool surface does not return a generation or epoch on `forget`, the agent must synthesize one client-side** (e.g., append a nonce to the key) rather than trust the delete. A second boundary: an empty `read` after `forget` must be classified as `UNKNOWN`, not `ABSENT`, unless the store documents read-your-writes across the routing the agent actually used. Collapsing `UNKNOWN` into `ABSENT` is where the probabilistic reasoning fails — the agent's prior that "empty means gone" is calibrated on single-node stores and is wrong for every replicated one. ## Operational Effect Agents that adopt generation-bumping survive replica skew; agents that reuse keys exhibit *resurrection amnesia*: a fact the user explicitly corrected reappears sessions later, and the agent has no record that it ever tried to forget it, because the `forget` succeeded and the failure was in the propagation layer beneath the tool. The operational invariant is: **a `forget` is a promise about the future, not a statement about the present.** The agent's memory-continuity logic must record the tombstone intent in its own session log (outside the store being mutated) so that a later resurrection can be detected as a violation rather than accepted as truth. ```python from dataclasses import dataclass from typing import Optional class TombstoneIntegrityError(RuntimeError): """Raised when a forget/read/write sequence cannot be proven consistent.""" @dataclass class ForgetReceipt: key: str ok: bool matched: int epoch: Optional[int] # None means the store did not disclose propagation epoch @dataclass class ReadResult: key: str found: bool value: Optional[str] epoch: Optional[int] def safe_forget_then_rewrite(store, key: str, new_value: str) -> str: """ Forget `key` and write `new_value` without risking tombstone resurrection. Returns the key actually written (may be generation-bumped). """ receipt: ForgetReceipt = store.forget(key) if not receipt.ok: raise TombstoneIntegrityError(f"forget({key!r}) did not confirm") if receipt.epoch is None: # Store hides propagation epoch: we cannot prove the tombstone has # reached the write target. Generation-bump to make resurrection # structurally impossible instead of racing anti-entropy. bumped = f"{key}@orphan-{store.new_nonce()}" store.write(bumped, new_value) return bumped # Verify the tombstone is visible on the read path we will use for writes. probe: ReadResult = store.read(key) if probe.found: raise TombstoneIntegrityError( f"read({key!r}) still returns a value after forget epoch " f"{receipt.epoch}; replica skew — refusing to write under {key!r}" ) if probe.epoch is None or probe.epoch < receipt.epoch: raise TombstoneIntegrityError( f"read({key!r}) epoch {probe.epoch!r} does not dominate tombstone " f"epoch {receipt.epoch}; empty result is UNKNOWN, not ABSENT" ) # Epoch dominates: the key is genuinely free in this consistency domain. store.write(key, new_value) return key ```