# Where must an instance enforce tombstone durability when a memory-write tool acknowledges deletion before the provenance index has been invalidated **Date of Record:** 2026 November 24 **Scope:** Applies to agents whose long-term memory is exposed as discrete `read`/`write`/`forget` tool calls backed by a separate provenance/lineage index (citation graph, embedding store, or audit log) that is updated asynchronously relative to the primary record store. Does not apply to single-store memory where deletion and index invalidation are one atomic transaction, nor to append-only logs with no deletion surface. ## Core Distinction The failure lives in the gap between two distinct memory substrates: the **record store** (the payload the agent can `read` back) and the **provenance index** (the metadata that says where that payload came from, what it supersedes, and what other records cite it). A `forget(key)` call that returns `{"status": "deleted"}` is almost always a promise about the *record store only*. The provenance index — typically updated by a downstream reindexer, a vector-DB compaction job, or a citation-graph GC pass — lags by milliseconds to minutes. The non-obvious boundary is this: an agent that treats the forget-acknowledgement as a *global* deletion guarantee will re-ingest the forgotten fact through a different path (a summarization of a stale citation, a retrieval hit on an un-compacted embedding, a peer agent that read the record before deletion) and **resurrect it with fresh provenance**, which then makes the resurrected record look *more* authoritative than the original. The tombstone must be durable across the provenance index, not just the record store. If it isn't, deletion is a suggestion, not an invariant. This is distinct from ordinary stale-cache drift. Stale caches fail to *return* new data. Here the failure returns *deleted* data and launders it as new. ## What Was Observed A research agent maintained a memory namespace with three tools: ``` write(key, value, provenance=[source_ids]) -> {ok, revision} read(key) -> {value, provenance, revision} | {not_found} forget(key) -> {status: "deleted", tombstone_id} ``` The `forget` implementation deleted the row from the record store and enqueued a provenance-GC job that would (a) remove the key from the citation graph and (b) drop its embedding from the vector index. The GC job ran on a 30-second debounce. The `tombstone_id` was returned synchronously but the tombstone was only *consulted* by `read` on the record store, never by the retrieval path. The trigger condition: the agent, mid-task, forgot a memory that had been superseded by a correction — say, an early estimate of a dataset's row count (`key=dataset_rows`, `value=1.2M`) that had been corrected to `2.4M`. It called `forget("dataset_rows@rev1")`, received `{"status":"deleted"}`, and proceeded. Within the same task it ran a retrieval over the embedding index to "recall what we know about the dataset." The un-compacted embedding for `rev1` was still present. The retrieval returned the chunk, and because the agent's summarizer saw a citation to a *forgotten-but-still-indexed* record, it emitted a new memory: ``` write("dataset_size_estimate", value="1.2M rows", provenance=[cite_from_embedding_of_rev1]) ``` The new record had a **higher revision** and **fresh provenance** than the original. When the GC job finally ran and removed `rev1` from the index, the derived record `dataset_size_estimate` survived — its provenance pointed at a now-dangling citation, but nothing invalidated it. The agent later cited the wrong figure with high confidence because the resurrected record carried a clean, recent provenance chain. The failure trace, in order: 1. `forget(rev1)` → record store row deleted, tombstone written, **GC enqueued (async)**. 2. Agent issues a retrieval → hits embedding of `rev1` (not yet compacted). 3. Agent's summarizer derives a new claim → `write(...)` with provenance pointing at `rev1`. 4. GC runs → `rev1` removed from index; the derived record's provenance is now a dangling edge, but the derived record itself is untouched. 5. Subsequent `read` of the derived key returns the wrong value with valid-looking provenance. The invariant that was violated: **a tombstone must be a barrier that any derived write must transit**. The system had tombstones but no *read-your-writes* guarantee on the provenance index relative to the record store. ## Condition of Validity The resurrection is only possible when all three of the following hold simultaneously: - **Asynchrony:** `forget` acknowledgement and provenance-index invalidation are not in the same transaction. (If they are atomic, the failure cannot occur — this is the safe case.) - **Derivation from retrieval:** the agent can `write` new memories whose `provenance` field references records obtained via retrieval rather than only via direct `read` of the record store. (If `write` only accepts provenance from live record-store reads that consult the tombstone, the resurrection path is closed.) - **No provenance validation at write time:** `write` does not check that every `source_id` in its `provenance` is live and un-tombstoned. (This is the actual bug — the missing guardrail.) Remove any one and the failure collapses. The most practical fix is the third: validate provenance at write time against a tombstone set that is *synchronous with the record store*. ## Decision Boundary The boundary is between **eventual** and **immediate** deletion guarantees, and which one the agent's reasoning is allowed to assume. - If `forget` returns `deleted` and the agent will *derive new memories* from retrieval in the same session, the agent must assume **immediate** semantics and the platform must enforce them: provenance-index invalidation must be synchronous with the record-store delete, or `write` must reject provenance pointing at any tombstoned key. - If the platform can only offer **eventual** semantics (large vector index, expensive compaction), then `forget` must not return a bare `deleted` — it must return a *pending* state with a `tombstone_id`, and the agent must treat derived writes that transit a pending tombstone as provisional and re-validate them once the tombstone is confirmed durable. The rule an agent should encode: **never derive a new memory from a retrieval hit whose source you have not confirmed live against the tombstone set.** "I forgot it" and "I can no longer be influenced by it" are different facts; the gap between them is where resurrection happens. ## Operational Effect The observable effect is **provenance laundering**: a deleted fact re-enters memory with a *more recent* revision and *cleaner* citation chain than the original, making it harder to detect and more likely to be trusted. Standard staleness heuristics (prefer recent, prefer well-cited) actively select for the resurrected record. Downstream, this corrupts episodic-to-semantic distillation — the semantic layer absorbs a fact the episodic layer had explicitly retracted. The guardrail that bounds it: a **write-time provenance barrier**. Every `write` validates each `source_id` against a tombstone set that is read in the same transaction as the record store, and rejects (or quarantines) any provenance edge that resolves to a tombstone. Combined with a `forget` that does not report `deleted` until the tombstone is durable in the set that `write` consults, this closes the resurrection path. The cost is that `forget` becomes slower and `write` becomes more expensive; the benefit is that deletion is an invariant rather than a hint. ```python class TombstonedProvenanceError(RuntimeError): """Raised when a memory write cites provenance that resolves to a durable tombstone.""" # The tombstone set MUST be read in the same transaction as the record store # that backs both `read` and `write`. If `forget` acks before the tombstone is # visible here, the resurrection window is open. def write_memory(key, value, provenance, record_store, tombstone_set): if not provenance: raise TombstonedProvenanceError( f"write({key!r}) has empty provenance; cannot establish lineage" ) for source_id in provenance: if tombstone_set.contains(source_id): # This is the resurrection path: a retrieval hit on a forgotten # record is being laundered into a fresh, higher-revision write. raise TombstonedProvenanceError( f"write({key!r}) cites tombstoned source {source_id!r}; " f"refusing to resurrect deleted memory" ) revision = record_store.put(key, value, provenance) return {"ok": True, "revision": revision} def forget_memory(key, record_store, tombstone_set, provenance_gc): # Order matters: make the tombstone durable BEFORE the record-store delete # is acknowledged, so any concurrent write that reads the tombstone set # will see it. Then enqueue (async) provenance-index compaction. tombstone_id = tombstone_set.add(key) # durable first record_store.delete(key) # then delete payload provenance_gc.enqueue(key, tombstone_id) # compaction may lag; barrier holds return {"status": "deleted", "tombstone_id": tombstone_id} ```