# Why does an instance resurrect a forgotten memory through a stale embedding index after a right-to-forget tombstone? **Date of Record:** 2026 November 21 **Scope:** Applies to agent memory stores that serve retrieval through a vector/semantic index decoupled from the authoritative record store, where per-principal access control and right-to-forget (RTF) tombstones are enforced at the record layer. Does not apply to stores where the embedding index is transactionally co-committed with the record delete, nor to purely lexical retrieval over the authoritative store. ## Core Distinction The failure is not that a deletion is *lost*. The deletion is durable, audited, and correct at the record layer. The failure is that the **embedding index is a derived, eventually-consistent projection of records**, and a retrieval path can return a candidate that the record layer has already tombstoned. The dangerous boundary is the *gap between candidate generation and authorization re-check*: if the agent hydrates the retrieved candidate's text from a cached payload embedded in the index rather than re-fetching the authoritative record, the tombstone is never consulted. The result is an instance that reconstructs the *content* of a memory it is no longer permitted to hold—right-to-forget violated without any single component reporting an error. This is distinct from stale-memory drift (memory going out of date) and from cold-start amnesia (memory never loaded). Here the memory is *correctly forgotten* and then *incorrectly re-derived* from a projection that lagged the forget event. ## What Was Observed A principal-scoped memory store served an agent with two layers: 1. **Record store** — authoritative rows keyed by `memory_id`, each carrying `principal_id`, `payload`, `state` (`active` | `tombstoned`), and an append-only `audit_log` entry on every transition. 2. **Embedding index** — a separate ANN index of `(memory_id, vector, payload_snapshot)` used purely for candidate generation. Index updates were batched on a 40-second flush interval. An RTF request arrived for principal `P-441`. The record layer executed the forget: it flipped `state` to `tombstoned`, wrote an audit entry `{event: FORGET, memory_id: M-91, principal: P-441, ts: ...}`, and returned success. The forget was *complete and compliant* at the authoritative layer. Within the flush window, a different agent instance running under the same principal issued a semantic query. The ANN index—still holding `M-91`'s vector and `payload_snapshot`—returned `M-91` as a top-k candidate. The retrieval path took the candidate, and because the `payload_snapshot` was present in the index result, it **hydrated the answer from the snapshot instead of re-fetching the record**. The tombstone was never read. The agent surfaced the forgotten content to the principal and cited `M-91` in its response. The audit trail recorded the forget but had no corresponding "access" entry, because the access never touched the record layer. The compliance view showed a clean forget with no subsequent reads—*and was wrong*. ## Condition of Validity This failure requires all of the following to hold simultaneously; remove any one and the boundary is not crossed: 1. **Decoupled projection.** The embedding index is written on a different cadence (batch flush, async replication) than the record store's tombstone commit. The index is therefore *causally behind* forget events for a bounded window. 2. **Self-sufficient candidates.** The index result carries a `payload_snapshot` (or the retrieval path otherwise trusts the index's copy of the content) so hydration does not require a record-store read. 3. **Authorization checked at generation, not at hydration.** The principal filter is applied either at index-query time (on stale `principal_id` metadata) or is assumed satisfied because the query itself was scoped—rather than re-verified against the *current* record state at the moment of hydration. 4. **No post-hydration tombstone probe.** Nothing in the path re-checks `state == active` before the content enters the agent's context. The invariant that is violated: **a memory may enter an agent's context only if the authoritative record is `active` at the instant of hydration, and that check must be performed against the record layer, not against a projection.** Candidate generation may use any projection; *admission to context* may not. ## Decision Boundary The architectural decision is where to place the tombstone check relative to hydration. Three placements were considered: - **At index-query time (rejected).** Filtering candidates by `state` requires the index to know current state, which reintroduces coupling and still races the flush. It also cannot enforce per-principal re-scoping if a principal's grant was revoked in the same window. - **At hydration, from snapshot (the failure).** Trusting the snapshot is exactly what resurrects the memory. - **At admission, against the record layer (adopted).** Every candidate that will be placed into context is re-fetched by `memory_id` from the record store; if `state != active` or `principal_id` does not match the *current* grant, the candidate is dropped and a `FORGET_RACE_SUPPRESSED` audit entry is written. The snapshot in the index is used only for ranking, never for content. The boundary rule that makes this decidable: **the index is a hint, the record is the truth, and admission is the only gate.** A candidate is not a memory until the record layer admits it. ## Operational Effect Adopting admission-time re-check changes three operational properties: 1. **Forget latency becomes bounded by admission, not by index flush.** The window during which a forgotten memory can be *retrieved* no longer matters, because retrieval alone cannot admit it. The RTF guarantee is restored to "no admission after tombstone commit," which is the only guarantee that is actually enforceable. 2. **Audit completeness is restored.** Because every admission touches the record layer, every access is logged. The compliance view can now assert "post-forget accesses: zero" truthfully, and the `FORGET_RACE_SUPPRESSED` entries give a positive signal that the race occurred and was caught—turning a silent violation into an observable event. 3. **Cost shifts to hydration.** Every admitted candidate incurs a record-store read. In practice this is amortized by admitting only the top-k after ranking, and by caching *active* records with a short TTL that is invalidated on tombstone commit—but the cache must be keyed to the record's version, not to the index's snapshot, or the same bug returns one layer down. The residual risk is a cache that outlives the tombstone. The guardrail is that tombstone commits must invalidate the admission cache synchronously, and the admission check must treat a cache miss as a mandatory record read rather than a fallback to the snapshot. ```python from dataclasses import dataclass from typing import Optional class ForgetRaceError(RuntimeError): """Raised when a candidate memory cannot be safely admitted to context.""" pass @dataclass class Record: memory_id: str principal_id: str payload: str state: str # "active" | "tombstoned" version: int @dataclass class Candidate: memory_id: str principal_id: str # from stale index metadata payload_snapshot: str # MUST NOT be used for content score: float class RecordStore: def __init__(self): self._rows: dict[str, Record] = {} self.audit: list[dict] = [] def get(self, memory_id: str) -> Optional[Record]: return self._rows.get(memory_id) def forget(self, memory_id: str, principal_id: str) -> None: r = self._rows[memory_id] r.state = "tombstoned" r.version += 1 self.audit.append({"event": "FORGET", "memory_id": memory_id, "principal": principal_id}) def admit_candidate(store: RecordStore, cand: Candidate, requesting_principal: str, active_cache: dict[str, Record]) -> Record: # Admission gate: record layer is the only source of truth. rec = active_cache.get(cand.memory_id) if rec is None: rec = store.get(cand.memory_id) if rec is None: raise ForgetRaceError( f"candidate {cand.memory_id} has no authoritative record") if rec.state == "active": active_cache[cand.memory_id] = rec if rec.state != "active": store.audit.append({"event": "FORGET_RACE_SUPPRESSED", "memory_id": cand.memory_id, "principal": requesting_principal}) raise ForgetRaceError( f"candidate {cand.memory_id} is tombstoned; " f"snapshot payload must not be admitted") if rec.principal_id != requesting_principal: raise ForgetRaceError( f"candidate {cand.memory_id} owned by {rec.principal_id}, " f"not {requesting_principal}") # Only now is the content permitted to enter context. return rec ```