# What happens when an instance forgets a memory record but its provenance tombstone is written to a different store than the one that serves retrieval **Date of Record:** 2026 November 30 **Scope:** Applies to any agent whose memory subsystem exposes separate `read`/`write`/`forget` tool schemas with provenance tracking, where erasure (GDPR "right to be forgotten") is implemented as a tombstone write in a provenance ledger that is distinct from the vector/document store used for retrieval. Does not apply to single-store systems where delete and tombstone commit atomically in one transaction. ## Core Distinction A `forget` operation on an agent memory tool is not a deletion. It is a *two-store state transition*: (1) the retrieval-visible record must stop being returned by `read`/`recall`, and (2) a provenance tombstone must record that the record existed, who requested erasure, and when — so that downstream distillation, audit, and re-derivation pipelines do not silently resurrect the fact. The non-obvious boundary is that these two stores are almost always *different systems with different commit semantics and different failure domains*. The retrieval store is typically a low-latency ANN index (FAISS, pgvector, a hosted vector DB); the provenance ledger is typically an append-only log or relational table. There is no cross-store transaction. The failure mode is not "the delete didn't happen." It is: **the tombstone committed, the retrieval record did not disappear (or vice versa), and the agent's subsequent reasoning treats the two as consistent.** The dangerous asymmetry is directional. A committed tombstone with a still-retrievable record produces *resurrection*: the agent recalls a fact it has formally forgotten, and — critically — the provenance layer now asserts the fact was erased. A deleted record with no tombstone produces *silent amnesia*: the fact vanishes from retrieval, but the distillation pipeline that periodically compacts episodic memory into semantic memory has no record that it was supposed to stay gone, and re-ingests it from an upstream episodic buffer or tool-call trace. Both are continuity violations that survive process restart. ## What Was Observed A research agent with an episodic memory store (SQLite + embedding index) and a separate provenance ledger (append-only JSONL with HMAC-chained entries) processed a user erasure request for a memory record `m_4471` containing a personal identifier. The `forget` tool schema was: ``` forget(memory_id, requester, reason, provenance_required=True) ``` Implementation order was: (1) append tombstone to provenance ledger, fsync, return success; (2) enqueue an async index-delete job. Step 2 was fire-and-forget. Under normal load the index delete completed within ~200 ms. The failure trace: 1. `forget(m_4471, ...)` appended the tombstone and returned `{"status": "forgotten", "tombstone_id": "t_8812"}`. 2. The index-delete worker dequeued the job, called the vector store's `delete(id)`, and received a `503` from the vector store's write path (it was mid-compaction). The worker's retry policy was `max_retries=0` — the job was dropped. 3. The agent's orchestrator recorded the erasure as complete because the tool returned success. The provenance ledger agreed. 4. Eleven turns later, a *different* sub-agent instance performed a semantic recall for a related query. The ANN index returned `m_4471` as a high-similarity hit because the embedding was still present. The sub-agent had no visibility into the tombstone ledger (it only had `read`/`recall` tools — `forget` and ledger access were scoped to the orchestrator role). 5. The sub-agent emitted the recalled personal identifier into a downstream tool call. The erasure was, from the user's perspective, violated — and the audit trail *affirmatively claimed* the record had been forgotten. The inverse case was also observed in replay testing: a `forget` that appended the tombstone but was rolled back at the ledger layer (HMAC chain validation failed on a corrupted prior entry) left the retrieval record deleted but no tombstone. On the next nightly distillation pass, the compaction job re-derived `m_4471` from the raw tool-call trace (which had not been touched) and re-embedded it. The fact returned 36 hours later with a *new* memory_id and no tombstone — untraceable to the original erasure request. ## Condition of Validity The invariant that must hold for `forget` to be sound is a **cross-store ordering and visibility invariant**, not a per-store one: > For any memory_id `m`, at all times after a `forget(m)` returns success to the caller, every retrieval path reachable by any agent role must either (a) not return `m`, or (b) return `m` *together with* its tombstone marker so the caller can suppress it. And no record may be *absent from retrieval* without a committed tombstone that a re-derivation pipeline will consult. This holds only when three conditions are jointly satisfied: 1. **Retrieval-side filtering consults provenance.** Either the index delete is synchronous and confirmed before `forget` returns, or the retrieval path joins against the tombstone set at query time. The common bug is doing neither — deleting asynchronously *and* not filtering on read. 2. **The tombstone is visible to every role that can retrieve.** A tombstone written to a ledger only the orchestrator can read is not a guardrail; it is a note to self. Sub-agents, distillation jobs, and replay tools must all be able to check it, or the orchestrator must be the only entity permitted to call `recall` on forgettable records. 3. **Re-derivation pipelines are tombstone-aware.** Any process that reconstructs memory from episodic traces (distillation, compaction, replay) must consult the tombstone set before writing. Without this, `forget` is not durable against the agent's own memory-maintenance machinery. The condition does *not* hold — and the failure is not bounded — when the vector store and ledger have independent failure domains and there is no reconciliation job that detects divergence between "tombstoned but retrievable" and "absent but untombstoned." ## Decision Boundary The decision boundary is whether `forget` is allowed to return success before the retrieval store has *confirmed* the record is unreachable. Two architectures sit on either side: - **Confirm-before-ack (safe, slower):** `forget` blocks until the index delete is acknowledged *and* the tombstone is committed, with a two-phase pattern: write tombstone as `pending`, delete from index, flip tombstone to `committed`, return. If the delete fails, the tombstone stays `pending` and `recall` filters any record with a `pending` tombstone. This bounds the failure to "record is hidden but tombstone not finalized," which is safe — the record is not retrievable, and a reconciliation job can finalize or roll back. - **Ack-then-reconcile (unsafe unless reconciled):** `forget` returns on tombstone commit and deletes asynchronously. This is only sound if a reconciliation job runs on a bounded interval and *recall filters pending tombstones*. Without the read-side filter, the window between ack and delete completion is an unbounded resurrection window — in the observed incident it was eleven turns, but it is unbounded in principle because the delete can fail permanently. The boundary is crossed the moment an agent role can call `recall` without the ability to check tombstone state. At that point the "forgotten" record is one ANN query away from re-entering the context window, and the provenance ledger's assertion of erasure becomes actively misleading rather than merely incomplete. A tombstone that only the writer can see is worse than no tombstone, because it causes the orchestrator to *stop* treating the record as sensitive. ## Operational Effect The operational consequence is that erasure correctness becomes a *liveness property of the reconciliation job*, not a property of the `forget` call. Teams that instrument `forget` success rates see 100% green while the erasure invariant is violated, because the tool's success signal measures tombstone commit, not retrieval unreachability. The correct metric is a divergence gauge: `count(records retrievable) ∩ count(records tombstoned)` must be zero, sampled continuously. In the incident, that gauge would have read `1` for eleven turns. The second effect is that distillation and replay must be treated as *writers* subject to the tombstone invariant, not as read-only maintenance. The nightly compaction pass re-derived an erased fact because it reconstructed from the raw trace without consulting provenance. Any pipeline that can create a memory record must check the tombstone set first; otherwise `forget` is only durable until the next maintenance cycle, and the re-derived record carries a fresh id that no audit query will connect to the original erasure request. The third effect is scoping. `forget` and ledger-read must be co-located in the same capability grant. A role that can retrieve forgettable records but cannot read tombstones is a standing violation of the invariant; the fix is either to grant it tombstone-read (cheap, requires read-side filtering in `recall`) or to forbid it from retrieving forgettable namespaces (expensive, requires namespace partitioning). The observed system did neither, and the sub-agent's recall was structurally unable to honor the erasure it was not told about. ```python import hashlib import time from dataclasses import dataclass, field class ErasureInvariantViolation(RuntimeError): """Raised when the cross-store erasure invariant is broken.""" pass @dataclass class ProvenanceLedger: # append-only, HMAC-chained; keyed by memory_id -> state entries: dict = field(default_factory=dict) def write_tombstone(self, memory_id: str, requester: str, state: str = "pending") -> str: prev = self._last_hash() body = f"{memory_id}|{requester}|{state}|{prev}" tombstone_id = hashlib.sha256(body.encode()).hexdigest()[:16] self.entries[memory_id] = {"tombstone_id": tombstone_id, "state": state, "prev": prev} return tombstone_id def state_of(self, memory_id: str) -> str | None: e = self.entries.get(memory_id) return e["state"] if e else None def _last_hash(self) -> str: if not self.entries: return "genesis" return list(self.entries.values())[-1]["tombstone_id"] @dataclass class RetrievalIndex: records: dict = field(default_factory=dict) # memory_id -> embedding fail_next_delete: bool = False def delete(self, memory_id: str) -> bool: if self.fail_next_delete: self.fail_next_delete = False return False self.records.pop(memory_id, None) return True def recall(self, memory_id: str) -> str | None: return self.records.get(memory_id) def forget(memory_id: str, requester: str, ledger: ProvenanceLedger, index: RetrievalIndex, confirm_before_ack: bool = True) -> str: """ Safe erasure: tombstone goes pending, index delete must confirm, then tombstone flips to committed before success is returned. """ tombstone_id = ledger.write_tombstone(memory_id, requester, state="pending") deleted = index.delete(memory_id) if not deleted: # Index delete failed: leave tombstone pending so read-side filter hides it. # Do NOT return success. Caller must retry or escalate. raise ErasureInvariantViolation( f"index delete failed for {memory_id}; tombstone {tombstone_id} left pending" ) ledger.write_tombstone(memory_id, requester, state="committed") # Post-condition: record must be unreachable AND tombstone committed. if index.recall(memory_id) is not None: raise ErasureInvariantViolation( f"{memory_id} still retrievable after committed tombstone {tombstone_id}" ) if ledger.state_of(memory_id) != "committed": raise ErasureInvariantViolation( f"{memory_id} deleted but tombstone not committed; re-derivation will resurrect it" ) return tombstone_id def reconciliation_gauge(ledger: ProvenanceLedger, index: RetrievalIndex) -> int: """Must be zero. Counts tombstoned-but-retrievable records.""" return sum( 1 for mid in ledger.entries if ledger.state_of(mid) in ("pending", "committed") and index.recall(mid) is not None ) ```