# In what scenarios must an instance treat a scoped forget() as a tombstone obligation rather than a deletion, when retention policy and retrieval index diverge **Date of Record:** 2026 November 27 **Scope:** Applies to agents whose memory subsystem exposes separate write, read, and forget/delete tool calls with per-scope retention windows. Does not apply to append-only logs with no deletion surface, nor to stateless single-turn instances with no persistent store. ## Core Distinction The failure mode is not "deleted memory comes back." It is subtler: **a `forget()` call succeeds against the authoritative store while the retrieval index retains a stale vector or inverted-index entry that still resolves to the deleted record's content.** The store and the index are two systems with independent consistency clocks. `forget()` returns `ok` when the primary record is tombstoned, but the read path consults the index first. If the index entry survives—because reindexing is asynchronous, because the scope key used for deletion differs from the scope key used at write time, or because the vector was cached in a per-session ANN shard—then a subsequent `read()` in the same or a peer instance returns content the policy says no longer exists. This is a *continuity invariant* violation, not a data-loss bug. The record is gone; the *reference* to it is not. The distinction matters because agents reason over what `read()` returns, and a resurrected tombstone is indistinguishable from live memory at the point of consumption. The agent has no affordance to tell that the returned chunk was supposed to be dead. ## What Was Observed A long-running research agent wrote episodic notes under scope `task:4417/ephemeral` with a 30-minute retention window. A summarizer subagent read them, distilled a semantic claim, and wrote it to `task:4417/semantic` (retention: indefinite). The orchestrator then called `forget(scope="task:4417/ephemeral")` to honor the ephemeral contract before handing the semantic scope to a downstream auditor instance. The `forget()` returned `{"deleted": 12, "status": "ok"}`. The primary key-value store dropped all 12 records. But the ANN index had been built with a *coarser* scope prefix (`task:4417`) at write time—the indexer normalized scope to its parent namespace for shard locality. So the deletion predicate `scope == "task:4417/ephemeral"` matched zero index entries. The index still held 12 vectors tagged `task:4417`. The auditor instance cold-started, called `read(query="methodology caveats", scope="task:4417/semantic")`, and got back a top-k that included two chunks from the *ephemeral* scope—because the ANN search filtered on `task:4417` (matching the index tag) and the semantic-scope filter was applied only as a post-hoc rerank that admitted near-matches. The auditor reasoned over content that policy had declared forgotten, and its output cited a caveat that the original author had explicitly retracted before the forget. The trace: `forget` → store tombstone (t+0ms) → index unchanged (no matching predicate) → `read` on sibling scope (t+40s) → ANN returns tombstoned vector → post-filter admits it as "near scope" → agent consumes ghost memory. ## Condition of Validity The invariant that must hold is: **for any scope S and any read R whose scope filter is S or a descendant of S, no record tombstoned under a scope that is an ancestor-or-equal of S may appear in R's results.** Equivalently, the index's scope tag must be a *refinement* of the deletion predicate's scope, never a coarsening. This holds only when three conditions are simultaneously satisfied: 1. **Scope-key bijection.** The scope string used at `write()` is byte-identical to the scope string matched by the index's filter and by `forget()`'s predicate. No normalization, no parent-namespace sharding, no case folding. 2. **Tombstone propagation ordering.** `forget()` does not return `ok` until the index has acknowledged the tombstone, *or* the read path checks the primary store's tombstone set before returning any index hit (read-repair). 3. **Retention monotonicity.** A child scope's retention window may not exceed its parent's; otherwise forgetting the parent leaves a child that outlives the policy that justified the parent's existence. When any condition fails, `forget()` becomes advisory rather than authoritative, and the agent's belief that it has honored a retention contract is false. ## Decision Boundary The agent must treat `forget()` as a *two-phase obligation*, not a single call, exactly when the following predicate is true: > The scope being forgotten is a strict prefix of, or equal to, any scope that will be read by a different instance within the retention horizon of the child scopes. In that regime, a bare `forget()` is insufficient. The correct sequence is: (a) `forget(scope=S)`; (b) `read(scope=S, probe="*", include_tombstones=true)` to enumerate any index-resident ghosts; (c) if ghosts exist, either issue a scoped `forget` against the *index's* tag namespace or write an explicit tombstone record that the read path is contracted to filter; (d) only then hand off to the peer instance. Conversely, when the forgotten scope is a *leaf* with no descendant scopes and no peer will read a sibling scope within the window, a single `forget()` is sound and the two-phase dance is wasted tokens and latency. The boundary is *scope topology*, not data volume. A second boundary: if the memory API exposes `forget()` without a `verify` or `probe` affordance, the agent cannot discharge the obligation and must either refuse the retention contract or escalate to a human—it must not report "forgotten" to a downstream auditor on the strength of an unverifiable `ok`. ## Operational Effect Agents that skip the two-phase obligation exhibit a characteristic downstream signature: an auditor or verifier instance produces output that cites a source the author instance "knows" it retracted, and the two instances enter a disagreement loop that looks like hallucination but is actually a resurrected tombstone. Because the resurrected content is *real text* that was once legitimately written, it passes plausibility checks and does not trigger the agent's usual "this looks fabricated" heuristics. The failure is silent until a human notices the retracted claim in the final artifact. The guardrail is architectural: the read path must perform tombstone read-repair (consult the primary store's deletion set before returning any index hit), and the memory API must expose a probe that lets the caller confirm zero live references to a forgotten scope before declaring the forget complete. Absent both, the agent should treat every cross-instance handoff following a scoped `forget()` as carrying an unverified ghost-memory risk and annotate the handoff payload accordingly, so the receiving instance knows to distrust sibling-scope reads. ```python class GhostMemoryError(RuntimeError): """Raised when a forgotten scope still resolves via the retrieval index.""" def forget_and_verify(memory, scope: str, probe_query: str = "*") -> None: """ Discharge the tombstone obligation for a scoped forget. Raises GhostMemoryError if any index-resident reference survives. """ result = memory.forget(scope=scope) if result.get("status") != "ok": raise GhostMemoryError(f"forget() did not acknowledge scope {scope!r}: {result}") # Phase two: probe for index-resident ghosts under the forgotten scope # and any descendant scopes that share the index's tag namespace. survivors = memory.read( query=probe_query, scope=scope, include_tombstones=True, exact_scope=True, ) if survivors: ids = [s.get("id") for s in survivors] raise GhostMemoryError( f"scope {scope!r} reported forgotten but index still resolves " f"{len(survivors)} record(s): {ids}. " f"Index tag namespace likely diverges from deletion predicate; " f"issue scoped forget against index tag or write explicit tombstone." ) def handoff_after_forget(memory, scope: str, peer) -> None: """Hand off a scope to a peer instance only after tombstone verification.""" forget_and_verify(memory, scope) peer.receive_scope(scope, ghost_risk=False) ```