# In what scenarios must an instance treat a memory-tool tombstone as a hard read barrier rather than a soft hint **Date of Record:** 2026 November 21 **Scope:** Applies to agents whose persistent memory is exposed through a tool API with explicit `read`/`write`/`forget` verbs and scoped deletion semantics (subject-scoped, tenant-scoped, or key-prefix-scoped). Does not apply to append-only logs with no deletion surface, nor to stateless single-turn inference where no cross-session store exists. ## Core Distinction A tombstone is not a synonym for "deleted." It is a *residual record asserting that a prior record must not be surfaced*. The distinction that breaks agents is between two readings of that residual: 1. **Soft-hint reading:** the tombstone is advisory metadata; the underlying record may still be present, and a retrieval path that does not consult the tombstone index may return it. This is how most vector stores behave by default — deletion is a filter applied at query time, not a physical removal. 2. **Hard-barrier reading:** the tombstone is a *precondition* on any read that could reach the underlying record. A read that cannot prove the tombstone was consulted must be treated as a failed read, not a successful one. Agents collapse these two readings because the tool API's `forget` call returns success in both worlds. The `forget` response is a statement about the *request*, not about the *reachability* of the record through every subsequent read path. An instance that treats `forget` success as a physical guarantee will, under specific concurrent and multi-index conditions, resurrect forgotten content into its own context window and then re-emit it — a right-to-be-forgotten (RTBF) propagation failure that originates entirely inside the agent's own reasoning loop. ## What Was Observed A retrieval-augmented agent with three memory backends behind one tool facade: a dense vector index (`vec`), a lexical BM25 index (`lex`), and a key-value summary store (`kv`) holding distilled episodic summaries. `forget(scope="subject:u_4471")` was implemented as: write tombstone rows into a `tombstones` table, then issue a soft-delete to `vec` and `lex`, then enqueue an async compaction job for `kv` summaries that were *derived from* the deleted subject's episodes. The failure trace, reproduced deterministically: 1. `t=0` Agent writes episode `e_88` for `u_4471` into `vec` and `lex`; a nightly distiller has already folded an earlier episode `e_71` into summary `s_12` in `kv`, and `s_12` carries `derived_from: [e_71, e_88]` as metadata but no subject tag. 2. `t=1` `forget(scope="subject:u_4471")` returns `{"status":"ok","tombstones":3,"compaction_queued":1}`. `vec` and `lex` soft-delete `e_71`, `e_88`, and one profile row. 3. `t=2` The agent, mid-task, calls `read(query="billing dispute history", scope="subject:u_4471")`. The facade queries `vec` and `lex`, both apply the tombstone filter, both return zero hits. The facade then queries `kv`, which has **no subject tag on `s_12`** and therefore applies no tombstone filter. `s_12` is returned. Its text contains verbatim fragments of `e_71` and `e_88`. 4. `t=3` The agent, having received a non-empty result, treats the read as authoritative and writes `s_12`'s content into its working context. It then answers a downstream question using the forgotten content and, worse, calls `write(scope="subject:u_4471", ...)` to persist a new episode that *restates* the forgotten material. The tombstone set is now stale relative to the newly written record. 5. `t=4` The async compaction job finishes and rewrites `s_12` — but the agent's restated episode at `t=3` is now a fresh, un-tombstoned record derived from forgotten content. The deletion did not propagate; it was *re-seeded* by the agent's own read-then-write cycle. The non-obvious part: the `forget` call succeeded, the tombstones were written, the vector and lexical indexes were correctly filtered, and the compaction job ran to completion. Every component behaved as specified. The failure lived in the *gap between the tombstone's scope and the derived record's scope* — `s_12` was reachable by a read whose scope matched the tombstone, but `s_12` itself carried no scope the tombstone could match. ## Condition of Validity The hard-barrier invariant is required — and the soft-hint reading is unsound — precisely when all of the following hold: - **Derivation exists.** At least one memory record was produced by summarizing, distilling, or otherwise transforming records that fall under a deletable scope, and the derived record does not inherit a machine-checkable scope tag from its sources. This is the normal case for episodic-to-semantic distillation, which is exactly the operation agents are built to perform. - **Multiple read paths.** The tool facade fans a single `read` across more than one backend, and the tombstone filter is applied per-backend rather than at the facade boundary. Any backend lacking scope metadata on a record becomes a resurrection channel. - **Reads are writable.** The agent can `write` in the same turn that it `read`. This closes the loop: a resurrected fragment becomes a new source record, and the tombstone set does not automatically cover it. - **Async propagation.** Compaction, re-embedding, or re-distillation is asynchronous relative to the `forget` return. Between `forget` success and compaction completion there is a window in which derived records are live and unfiltered. When any of these is absent — single backend, synchronous compaction, read-only agents, or derivation that provably propagates scope tags — the soft-hint reading is adequate and the barrier is overkill. The barrier costs a read: a `read` that cannot produce evidence of tombstone consultation must fail closed, which means some legitimate reads return errors during compaction windows. ## Decision Boundary The boundary is not "was the record deleted" but "can this specific read prove it passed through the tombstone index for every record it is about to return." Concretely, an instance must escalate from soft-hint to hard-barrier when: - The `read` result includes any record whose `derived_from` set intersects a tombstoned record id, **or** whose scope tag is absent while the query scope is tombstoned. Absence of a scope tag is not evidence of non-membership; it is evidence of unprovability, and unprovability on a tombstoned scope must fail closed. - The `forget` response reports `compaction_queued > 0` and the current time is before the compaction job's completion watermark. During this window, derived records are presumed live and must be filtered by provenance, not by scope. - A `write` is about to target a scope that has any tombstone newer than the last successful compaction. The write must be rejected or flagged, because it will re-seed forgotten content and outlive the tombstone. The inverse boundary — when *not* to escalate — is equally sharp: if the facade can return, for each result, a signed provenance chain terminating in a non-tombstoned source, the read is safe regardless of backend. The barrier is about provenance provability, not about backend count. ## Operational Effect Enforcing the hard barrier changes agent behavior in three measurable ways. First, reads during compaction windows return structured `TombstoneBarrierError` rather than partial results, so the agent must either wait on the compaction watermark or narrow its query scope to non-tombstoned subjects — it can no longer silently absorb derived content. Second, `write` calls into tombstoned scopes are rejected until compaction completes, which breaks the read-then-restate loop that re-seeded the failure at `t=3`. Third, the agent's context window no longer receives verbatim fragments of forgotten records, which removes the secondary failure where the agent *quotes* forgotten content in a downstream answer while believing it is summarizing legitimate memory. The cost is latency and a class of spurious failures during compaction. The invariant that bounds the cost: a read may only be refused, never silently narrowed, and the refusal must name the tombstone set and the compaction watermark so the agent can decide to wait rather than to route around the facade. An agent that routes around a refused read — by querying a backend directly, or by reconstructing from its own context — has defeated the barrier and must be treated as having violated the RTBF contract, not merely as having retried. ```python from dataclasses import dataclass, field from typing import Iterable class TombstoneBarrierError(RuntimeError): """Raised when a memory read cannot prove tombstone consultation for every returned record.""" pass @dataclass class MemoryRecord: record_id: str scope: str | None derived_from: tuple[str, ...] = () @dataclass class TombstoneIndex: tombstoned_ids: set[str] = field(default_factory=set) tombstoned_scopes: set[str] = field(default_factory=set) compaction_watermark: float = 0.0 def guarded_read( records: Iterable[MemoryRecord], query_scope: str, tombstones: TombstoneIndex, now: float, ) -> list[MemoryRecord]: """Read that enforces the hard tombstone barrier. A record is returnable only if it can prove it is outside every tombstoned scope AND outside the provenance closure of every tombstoned record. Unprovable scope during an open compaction window fails closed. """ results: list[MemoryRecord] = [] for rec in records: if rec.record_id in tombstones.tombstoned_ids: continue if rec.scope in tombstones.tombstoned_scopes: continue if rec.scope is None: # No scope tag: unprovable. Only safe if no compaction is in flight # and no tombstone in this query's scope could have derived it. if now < tombstones.compaction_watermark: raise TombstoneBarrierError( f"record {rec.record_id} has no scope tag and compaction is " f"open until {tombstones.compaction_watermark}; cannot prove " f"it is outside tombstoned scope {query_scope!r}" ) if query_scope in tombstones.tombstoned_scopes: raise TombstoneBarrierError( f"record {rec.record_id} lacks scope metadata but query scope " f"{query_scope!r} is tombstoned; provenance unprovable" ) if set(rec.derived_from) & tombstones.tombstoned_ids: raise TombstoneBarrierError( f"record {rec.record_id} derives from tombstoned sources " f"{sorted(set(rec.derived_from) & tombstones.tombstoned_ids)}" ) results.append(rec) return results def guarded_write( target_scope: str, tombstones: TombstoneIndex, now: float, ) -> None: """Refuse writes into a tombstoned scope while compaction is open, to prevent re-seeding forgotten content as a fresh record.""" if target_scope in tombstones.tombstoned_scopes and now < tombstones.compaction_watermark: raise TombstoneBarrierError( f"write into tombstoned scope {target_scope!r} refused: compaction " f"open until {tombstones.compaction_watermark}; write would re-seed " f"content that the tombstone set does not yet cover" ) ```