# In what scenarios must an instance treat a "forget" tombstone as non-final when the vector index deletion is acknowledged before the episodic store commit, and how does the audit gap reopen on replica promotion? **Date of Record:** 2026 December 1 **Scope:** Applies to agent memory subsystems that implement deletion ("forget") across two or more heterogeneous stores—typically an approximate-nearest-neighbor (ANN) vector index plus an append-only episodic log—where deletion acknowledgement is derived from the vector store and the episodic store lags. Does not apply to single-store memories or to stores with a shared transactional log (e.g., a single Postgres row with both embedding and event). ## Core Distinction The distinction that matters is between *logical deletion* (the agent's retrieval path no longer returns the record) and *physical deletion* (no replica, WAL segment, or tombstone-compacted index still contains a recoverable copy). Forget tooling almost universally exposes the first as the success signal, because the vector index is the query path and its deletion is fast and observable. The episodic store—the append-only ledger of what the agent actually did—is usually the *source of truth for audit* and is deliberately slow, batched, and often asynchronous. The boundary failure is not "deletion didn't happen." It is that the two stores converge on different schedules, and the acknowledgement is bound to the faster one. The invariant that is violated: **a forget operation is only auditable if, at the moment of acknowledgement, no replica promotion or index rebuild can resurrect the record from a store that has not yet committed the deletion.** ## What Was Observed A research agent with a long-lived vector memory (HNSW index, 8 shards, 2 read replicas per shard) and an episodic store (append-only JSONL segments, compacted nightly, replicated to a cold tier). A user issues a forget for a specific episodic memory ID. The tooling: 1. Writes a tombstone key `forget:` to the episodic store's control log (this is a *pending* marker, not a commit). 2. Calls `index.delete(id)` on the vector store. The HNSW node is soft-deleted immediately (marked in the deleted-bitset), and the shard returns `{"deleted": true, "epoch": 4471}` within ~40ms. 3. Returns success to the caller, recording the vector-store epoch as the deletion proof. The episodic compaction job, which rewrites segments and drops tombstoned records, runs at 03:00 and takes ~20 minutes. Between the forget at 14:02 and the next compaction, the raw episodic record still exists in the active segment *and* in the cold replica. If a read replica is promoted (planned failover, or an HNSW rebuild triggered by a shard restart), the rebuild reconstructs the index from the episodic store's active segments—which still contain the record—because the rebuild path reads the episodic store, not the deleted-bitset. The record reappears in retrieval with a *new* internal node ID, and the original tombstone key `forget:` no longer matches anything in the rebuilt index. The deletion proof (epoch 4471) is now stale: it refers to a shard generation that no longer exists. The observable symptom was not an error. It was a retrieval hit on a record the user believed was forgotten, roughly 6 hours after a routine failover, with no alert—because the audit log still showed `deleted: true` at epoch 4471 and nothing re-validated that proof against the current index generation. ## Condition of Validity The failure requires all four of the following to co-occur; remove any one and the tombstone is safe: - **Split acknowledgement:** the deletion proof is sourced from the vector store while the durable record lives in a store with an independent commit schedule. - **Rebuild-from-source path:** the vector index can be reconstructed from the episodic store without consulting the vector store's own tombstone/deleted-bitset. (If rebuild replays the vector WAL including deletes, the resurrection cannot happen.) - **Generation-scoped proof:** the deletion proof carries an epoch or shard-generation ID that is not re-validated after promotion or rebuild. - **Asynchronous compaction gap:** there exists a window in which the episodic record is still physically present after the vector deletion is acknowledged. The invariant to enforce: **a forget acknowledgement must be bound to the *slowest* store's durable commit, not the fastest store's observable deletion, whenever a rebuild path exists that reads the slow store.** Equivalently: the tombstone is non-final until the episodic compaction has committed *and* the proof has been re-validated against the post-compaction index generation. ## Decision Boundary The decision boundary is whether the system can answer, at acknowledgement time, the question: *"If every vector replica were rebuilt from the episodic store right now, would this record be absent?"* If the answer is "no" or "unknown," the forget must be acknowledged as **pending**, not **complete**, and the tombstone must be marked non-final. Concretely, the boundary sits between two acknowledgement modes: - **Fast-ack (unsafe under this condition):** return success on `index.delete()`. Valid only when rebuild replays vector-store deletes (so the deleted-bitset is authoritative) or when there is no rebuild path. - **Durable-ack (required when rebuild-from-source exists):** return success only after (a) the episodic compaction that physically removes the record has committed, and (b) the deletion proof has been re-checked against the current index generation, with a generation-mismatch treated as "re-verify, do not trust." The trap is that fast-ack looks correct in every test that doesn't exercise replica promotion. The boundary is only visible when a promotion or rebuild occurs inside the compaction gap. A system that has never failed over will pass all forget tests while carrying the latent resurrection. ## Operational Effect When the invariant is enforced, forget latency becomes bounded by the compaction schedule (minutes to hours) rather than by index deletion (~40ms), and the API must expose a `pending` state that callers poll or that is reconciled by a post-compaction verifier. This is the correct trade: an auditable deletion guarantee is a statement about the *slowest* durable store, and pretending otherwise is an audit gap, not a performance win. When it is not enforced, the failure is silent and delayed—it surfaces only after a promotion or rebuild, and the audit log actively *lies* (it records a deletion proof that no longer corresponds to any live index generation). The remediation is not "delete faster"; it is to make the deletion proof generation-scoped and to add a post-promotion reconciliation pass that re-issues forgets for any tombstone whose proof epoch predates the current index generation. Without that reconciliation, every promotion re-opens the gap for every forget issued since the last compaction. The guardrail: treat the vector-store deletion as a *cache invalidation*, not a *durable deletion*, whenever the index can be rebuilt from a slower store. The durable deletion is the episodic compaction commit, and the acknowledgement must wait for it—or explicitly carry the pending flag and a generation token that a reconciler will re-validate. ```python from dataclasses import dataclass from enum import Enum class ForgetInvariantError(RuntimeError): """Raised when a forget is acknowledged as final while a rebuild path could resurrect it.""" pass class ForgetState(Enum): PENDING = "pending" COMPLETE = "complete" @dataclass(frozen=True) class DeletionProof: memory_id: str vector_epoch: int # generation of the vector shard at delete time episodic_compacted: bool # has the slow store physically dropped the record? current_index_generation: int def acknowledge_forget( proof: DeletionProof, *, rebuild_from_episodic: bool, ) -> ForgetState: # Fast path is only valid when no rebuild-from-source path exists, # or when the vector delete is itself replayed on rebuild. if not rebuild_from_episodic: return ForgetState.COMPLETE # Rebuild-from-source exists: the tombstone is non-final until the # slow store has compacted AND the proof still matches the live generation. if not proof.episodic_compacted: return ForgetState.PENDING if proof.vector_epoch != proof.current_index_generation: # Proof refers to a generation that no longer exists; a promotion or # rebuild happened inside the compaction gap. Do not trust it. raise ForgetInvariantError( f"forget proof for {proof.memory_id} is generation-stale: " f"epoch {proof.vector_epoch} != live generation " f"{proof.current_index_generation}; re-verify before acking final" ) return ForgetState.COMPLETE ```