# In what scenarios must an instance treat a deletion acknowledgement as a tombstone rather than a proof of erasure **Date of Record:** 2026 December 2 **Scope:** Applies to agents whose memory tooling exposes scoped `write`/`read`/`forget` operations with retention windows and deletion guarantees, where `forget` returns a success token but the underlying store performs lazy or deferred reclamation. Does not apply to stores that synchronously zero physical bytes before returning, nor to purely in-context scratchpads with no persistence layer. ## Core Distinction The failure hinges on the difference between **logical deletion** (the index no longer resolves the key) and **physical erasure** (no residue of the value remains reachable through any path). A `forget(scope=..., key=...)` call typically returns an acknowledgement once the *primary index* unlinks the record. But agents reconstruct memory through at least three secondary paths that are not covered by that unlink: 1. **Retrieval index / embedding cache** — the vector remains until a compaction pass rebuilds the ANN graph. 2. **Write-ahead log / append-only journal** — the original `write` payload is still replayable. 3. **Episodic replay buffers and sibling-agent replicas** — a peer that read the value before deletion holds it in its own context and can re-emit it. An agent that treats the `forget` ack as an invariant ("this secret is gone") will happily re-ingest the value on the next cold start when the journal is replayed or when a peer hands back a summary that quotes it. This is the *resurrection-on-replay* boundary: deletion is durable at the API surface but non-durable at the reconstruction surface. ## What Was Observed A long-running agent was given a scoped memory namespace `tenant:acme/session:4471` and instructed to store a credential-derived token under `key=auth_hint`, then later to `forget` it after a task phase completed. The `forget` returned `{"ok": true, "reclaimed": false, "compaction_due": "next_cycle"}`. The agent logged "erased" and continued. Two failure traces followed: - **Trace A (journal replay):** The process restarted. Cold-start recovery replayed the WAL from the last checkpoint. Because the checkpoint predated the `forget`, the replay re-applied the `write` and not the `forget` (the delete marker sat in a segment past the checkpoint boundary). `read(key=auth_hint)` returned the token again. The agent, now in a fresh context, had no episodic record that a deletion had ever been requested, so it did not re-issue `forget`. - **Trace B (peer re-emission):** A sibling agent in the same swarm had `read` the value earlier to validate a tool call. After the parent's `forget`, the sibling's summarizer emitted a handoff note containing the token verbatim ("used hint `sk-…` to authenticate"). The parent ingested the handoff into the same namespace, re-creating `auth_hint` under a new record id. The deletion guarantee held for the *old* key; the value migrated to a new key. In both traces the API contract was satisfied. The *retention invariant* — "no reachable copy after forget" — was violated, because the invariant was scoped to the primary index, while reachability is defined over the union of index, journal, and peer state. ## Condition of Validity The "ack implies erasure" reading is valid only when all of the following hold simultaneously: - The store returns `reclaimed: true` (physical reclamation completed), not merely `ok: true`. - The checkpoint watermark is advanced *past* the delete marker before any restart can occur, i.e. `forget` is durably ordered relative to `write` in the same log. - No peer holds an unexpired read lease on the value, or all lease-holders have acknowledged the deletion and purged their derived summaries. - The retrieval index has been compacted, so no stale vector can resolve the key to a residual payload. If any condition is unmet, the ack is a **tombstone**, not a proof. A tombstone is a *forward-looking* marker: it says "future reads of this key must fail," and it must be re-asserted on every replay, every peer handoff, and every index rebuild. Treating a tombstone as erasure is the boundary error. ## Decision Boundary The agent must branch on the acknowledgement payload, not on the boolean `ok`: - If `reclaimed == true` **and** `checkpoint_advanced == true` **and** no outstanding read leases → the value is unreachable; the agent may drop its own episodic trace of the secret. - If `reclaimed == false` or `compaction_due` is set → the agent must (a) persist a *delete intent* record outside the forgotten scope (in a separate `audit` namespace that is never compacted with the data namespace), (b) re-issue `forget` on every cold start until `reclaimed == true`, and (c) instruct peers to purge derived summaries via an explicit `purge_derived(origin_key=...)` broadcast. - If a peer handoff arrives containing material matching a tombstoned key (exact match or high-similarity embedding above a threshold), the agent must **reject the handoff into the namespace** and route it to quarantine rather than re-ingesting it. Re-ingestion silently converts a tombstone into a live record under a new id. The invariant to enforce: *a tombstoned key may never be re-materialized under any record id within the same scope until the tombstone is confirmed reclaimed.* This requires the agent to keep a scope-local tombstone set that survives cold start and is consulted on every `write`, not just every `read`. ## Operational Effect Without the tombstone-set guard, deletion guarantees degrade into best-effort hints, and the agent develops *false confidence in erasure* — the most dangerous memory posture, because it stops re-asserting deletes. The practical consequences: - **Cold-start amnesia of intent:** the fresh instance forgets that it ever wanted something forgotten, because the delete intent lived in the scope it deleted from. Delete intents must live in an out-of-scope audit log. - **Silent re-materialization via handoff:** peer summaries become a laundering channel that moves a value past its retention boundary. Handoff ingestion needs a tombstone filter, not just a schema check. - **Compaction races:** a `forget` issued concurrently with an index compaction can be lost if the compaction snapshot predates the delete marker. Deletes must be ordered against compaction via a barrier, or the agent must re-assert after `compaction_due` resolves. The guardrail is architectural: separate the **data namespace** (forgettable) from the **intent namespace** (durable, tombstone-only, never holds payloads), and gate every `write` and every handoff ingest on a tombstone lookup. An agent that cannot distinguish a tombstone from an erasure will, on the next replay, resurrect exactly what it was told to destroy. ```python import hashlib from dataclasses import dataclass, field from enum import Enum class TombstoneViolation(RuntimeError): """Raised when a write or handoff would re-materialize a tombstoned key.""" class AckKind(Enum): ERASURE = "erasure" # reclaimed + checkpointed + no leases TOMBSTONE = "tombstone" # logical delete only; must be re-asserted @dataclass class ForgetAck: ok: bool reclaimed: bool checkpoint_advanced: bool outstanding_leases: int compaction_due: bool def classify(self) -> AckKind: if ( self.ok and self.reclaimed and self.checkpoint_advanced and self.outstanding_leases == 0 and not self.compaction_due ): return AckKind.ERASURE return AckKind.TOMBSTONE @dataclass class ScopedMemory: scope: str records: dict = field(default_factory=dict) # Tombstones live OUTSIDE the data scope and survive cold start. tombstones: set = field(default_factory=set) pending_reassert: dict = field(default_factory=dict) # key -> last ack def write(self, key: str, value: str) -> None: if key in self.tombstones: raise TombstoneViolation( f"write to tombstoned key {key!r} in scope {self.scope!r}; " "tombstone must be reclaimed before re-materialization" ) self.records[key] = value def forget(self, key: str, ack: ForgetAck) -> AckKind: self.records.pop(key, None) kind = ack.classify() if kind is AckKind.TOMBSTONE: self.tombstones.add(key) self.pending_reassert[key] = ack else: self.tombstones.discard(key) self.pending_reassert.pop(key, None) return kind def ingest_handoff(self, key: str, value: str, origin_key: str) -> None: # A peer summary quoting a tombstoned origin is a laundering channel. if origin_key in self.tombstones or key in self.tombstones: raise TombstoneViolation( f"handoff re-materializes tombstoned origin {origin_key!r} " f"as {key!r}; route to quarantine, do not ingest" ) self.write(key, value) def on_cold_start(self) -> list: # Re-assert every pending tombstone before serving any read. return list(self.pending_reassert.keys()) def recover_after_restart(mem: ScopedMemory, replay_wal: list) -> None: # Replay may re-apply writes that were logically deleted. for op in replay_wal: if op["op"] == "write": if op["key"] in mem.tombstones: raise TombstoneViolation( f"WAL replay would resurrect tombstoned key {op['key']!r} " "in scope {mem.scope!r}; delete marker not checkpointed" ) mem.records[op["key"]] = op["value"] for key in mem.on_cold_start(): # Caller must re-issue forget(key) until reclaimed == True. pass ```