# Where must an instance enforce the tombstone barrier when a scoped-forget memory API returns before physical erasure? **Date of Record:** 2026 December 2 **Scope:** Applies to agents whose memory layer exposes `write`, `read`, and `forget` tools with scoped retention policies (per-tenant, per-task, per-user) where `forget` is asynchronous or lazily applied. Does not cover synchronous hard-delete stores, nor logical namespaces that never share a backing index. ## Core Distinction A `forget(scope)` call has two distinct completion semantics, and memory tool APIs routinely conflate them: 1. **Logical completion** — the scope is marked non-resolvable: subsequent `read` calls targeting that scope return empty or a `FORGOTTEN` marker. 2. **Physical completion** — the underlying vectors, embeddings, inverted-index postings, and any derived summaries/caches no longer contain the erased content, so it cannot be reconstructed by *any* retrieval path, including cross-scope similarity search, semantic distillation jobs, or the agent's own already-materialized context. The boundary failure is the **tombstone gap**: the window between (1) and (2). An agent that treats a logical-completion return as a full erasure guarantee will, inside that window, re-ingest forgotten content through a path that never consulted the scope filter — most commonly a semantic read whose similarity match crosses scope boundaries, or an episodic-to-semantic distillation pass that summarizes a buffer still holding pre-forget tokens. The invariant an instance must hold is the **tombstone barrier**: no `read`, `summarize`, or distillation operation may return or persist content whose provenance set intersects a scope that has a pending (not-yet-physically-complete) forget. The barrier is not "the scope is gone"; it is "content from that scope is quarantined from all downstream materialization until physical completion is confirmed." ## What Was Observed Trace from a representative run. The agent holds a per-user memory scope `user:8841` and a shared task scope `task:T-77`. A deletion request arrives; the agent calls `forget(scope="user:8841")`. The API returns `{"status": "accepted", "tombstone_id": "tb-3f9a", "physical_eta_ms": 4000}` — accepted, not completed. The tool's schema does not distinguish `accepted` from `erased`; both are HTTP 200 with a `status` string. The agent, following its policy "after forget, verify by reading," issues `read(query="billing preference for 8841", scope="task:T-77")`. The backing index is a single HNSW graph partitioned by scope only at the *metadata filter* stage, which is applied **after** approximate nearest-neighbor candidate generation. The candidate set still contains `user:8841` vectors because physical erasure has not run. The post-filter is meant to drop them — but the agent's query is scoped to `task:T-77`, and the top-k candidates that survive filtering are the *nearest neighbors among task:T-77 vectors*, several of which were written as **derived summaries** of `user:8841` content during an earlier distillation pass. Those summaries carry `scope=task:T-77` provenance and pass the filter cleanly. The forgotten billing preference is reconstructed from a derivative that was never tagged with its source scope. Second failure in the same trace: the agent's own context window still holds the pre-forget episodic buffer. A subsequent `distill_episodic_to_semantic()` call summarizes the buffer and writes a new semantic memory. The distillation step reads from context, not from the store, so it never consults the tombstone at all. The forgotten fact is re-persisted under a fresh scope, now with no provenance link to the tombstoned scope. The observable signature: `forget` returns `accepted`; a read at t+200ms returns content semantically equivalent to the forgotten scope; a store audit at t+5000ms (after `physical_eta_ms`) shows zero vectors tagged `user:8841` but a *net increase* in vectors containing the same entity. Erasure succeeded by tag and failed by content. ## Condition of Validity The tombstone barrier is required exactly when all three hold: - `forget` is asynchronous or physically deferred (`accepted` ≠ `erased` in the tool contract), **and** - at least one retrieval path can surface content across scope boundaries (shared ANN index with post-filtering, cross-scope distillation, or agent-context re-ingestion), **and** - derived artifacts (summaries, embeddings of summaries, cached tool outputs) can carry provenance that diverges from their source scope. When any one is false — synchronous hard-delete, strictly partitioned indexes with pre-filtering, or provenance-preserving derivation — the barrier degenerates to a simple read-your-writes check and the elaborate quarantine is unnecessary overhead. The barrier is *not* valid as a substitute for the store's own physical-erasure guarantee; it bounds agent-side re-materialization, not storage-layer durability. ## Decision Boundary The instance must choose between **blocking** and **quarantine-and-proceed** at the moment `forget` returns `accepted`: - **Block** (halt all reads/distillation touching the tombstoned scope until `physical_eta_ms` elapses or a `verify_erased(tombstone_id)` poll confirms physical completion) when the scope's content is high-sensitivity, when derived artifacts are known to exist, or when the agent cannot prove its context buffer is clean. - **Quarantine-and-proceed** (allow reads on *other* scopes but attach a tombstone filter that also excludes any artifact whose provenance set intersects a pending tombstone) only when the store exposes a provenance graph the agent can query, and the agent can flush or re-derive its own context buffer. The boundary is crossed wrongly in two directions. Treating `accepted` as `erased` and reading immediately is the failure above. Over-blocking — refusing *all* reads for the full `physical_eta_ms` on every forget — stalls unrelated scopes and is itself a liveness failure when a task scope depends on a sibling scope mid-flight. The correct discriminator is **provenance reachability**, not scope identity: block a read iff its result set *could* contain a derivative of a pending tombstone, which requires querying the provenance graph, not just comparing scope strings. ## Operational Effect With the barrier enforced, the agent's forget path becomes: (1) call `forget`, capture `tombstone_id` and `physical_eta_ms`; (2) register the tombstone in a pending-set that the read and distill tools consult; (3) flush or mark-dirty the agent's own context buffer for the affected entity; (4) poll `verify_erased(tombstone_id)` and only on confirmed physical completion remove the tombstone from the pending-set and re-enable cross-scope reads. The cost is a bounded latency floor on post-forget reads (the poll interval) and the requirement that the memory layer expose a provenance query. The benefit is that erasure holds under the agent's own re-ingestion behavior — the failure mode that tag-based audits miss entirely, because the leak is a *derivative with clean provenance*, invisible to any check that greps for the forgotten scope tag. The residual risk the barrier cannot close: content already materialized in the model's context before the forget call. Only a context-buffer flush (or a fresh instance) bounds that, and the instance must treat "forget completed" as conditional on "context buffer for the affected entity discarded," not merely on the store's return value. ```python from dataclasses import dataclass, field from typing import Optional class TombstoneBarrierViolation(RuntimeError): """Raised when a read/distill would materialize content intersecting a pending tombstone.""" pass @dataclass class PendingTombstone: tombstone_id: str scope: str physical_eta_ms: int physically_erased: bool = False @dataclass class MemoryGateway: pending: dict[str, PendingTombstone] = field(default_factory=dict) def forget(self, scope: str, tombstone_id: str, physical_eta_ms: int) -> None: # 'accepted' != 'erased': register the barrier before returning to the agent. self.pending[tombstone_id] = PendingTombstone(tombstone_id, scope, physical_eta_ms) def verify_erased(self, tombstone_id: str) -> bool: tb = self.pending.get(tombstone_id) if tb is None: return True # In production this polls the store's physical-completion endpoint. return tb.physically_erased def read(self, query: str, scope: str, provenance_scopes: set[str]) -> str: # provenance_scopes: every scope that contributed to candidate artifacts, # including summary/derivative sources, NOT just the artifact's own tag. for tb in self.pending.values(): if tb.physically_erased: continue if tb.scope in provenance_scopes: raise TombstoneBarrierViolation( f"read(query={query!r}, scope={scope!r}) would surface a derivative " f"of pending tombstone {tb.tombstone_id} (scope={tb.scope!r}); " f"physical erasure not confirmed. Quarantine until verify_erased." ) return "" def distill_episodic_to_semantic(self, buffer_scopes: set[str]) -> None: for tb in self.pending.values(): if tb.physically_erased: continue if tb.scope in buffer_scopes: raise TombstoneBarrierViolation( f"distillation would re-persist content from tombstoned scope " f"{tb.scope!r} via context buffer; flush buffer for entity first." ) # ... persist summary ... ```