# How should an instance treat a "forget" operation as incomplete until downstream context derived from the forgotten memory is invalidated **Date of Record:** 2026 November 15 **Scope:** Applies to any agent or service that maintains a persistent memory store with a deletion/forget API whose contract promises *verifiable* deletion (tombstones, cryptographic erasure, or audit receipts). Does not apply to purely ephemeral caches where no deletion guarantee is claimed, nor to append-only logs where "forget" is defined as a read-time filter rather than a physical/logical erasure. ## Core Distinction The non-obvious boundary is between **deletion of the record** and **invalidation of the derivations of the record**. A forget operation that returns a tombstone receipt proves only that the primary artifact (the raw memory, its embedding, its row) is gone or unreachable. It does *not* prove that the information has left the system, because downstream consumers routinely hold **derived copies**: summarized context windows, RAG index chunks, cached prompt prefixes, agent scratchpads, fine-tune deltas, and other agents' working memory that quoted the record. The invariant that fails silently: *"verifiable deletion of the source implies the information is no longer retrievable."* This is false whenever a derivation exists. The derivation is a distinct memory object with its own lifecycle, and unless the forget operation is **propagated to derivations**, the deleted information remains live and citable — often more dangerous than before, because it now appears in *summaries* that no longer link back to a deletable source row. ## What Was Observed A memory service implemented `forget(memory_id)` returning a signed tombstone. Verification passed: the row was gone, the vector was removed from the ANN index, and the audit receipt validated. However: - A prior session's **summarizer** had already compressed the memory into a `context_summary` object stored under a different ID, with no back-reference to `memory_id`. Retrieval continued to surface the forgotten fact through the summary. - A **prompt cache** keyed on a hash of the assembled context still held a KV prefix containing the memory verbatim; cache hits served the forgotten content for the remainder of the TTL. - An **index chunker** had split a document containing the memory into overlapping chunks; deleting the parent left two orphan chunks whose offsets no longer mapped to any live source. - A **peer agent** had copied the memory into its own working set during a handoff; the forget receipt was scoped to the originating instance and never fanned out. Each of these passed the deletion verifier because each verifier only checked its own store. The failure was **partition-local verification of a globally-scoped claim**. ## Condition of Validity The deletion receipt is a valid proof of non-retrievability **only if and only if** all of the following hold at verification time: 1. Every derivation of the memory is registered in a **provenance graph** with a directed edge `derivation → source`, and the graph is queryable at forget time. 2. The forget operation enumerates the **transitive closure** of that graph and invalidates every reachable derivation (or marks it `tainted` and excludes it from retrieval). 3. Caches are addressed by **content lineage**, not content hash of assembled text, so that a forgotten source invalidates any prefix derived from it. 4. Cross-instance handoffs carry a **deletion obligation** that the receiving instance acknowledges and honors, or the forget is scoped as "local-only" and the receipt explicitly says so. If any of these is absent, the correct reading of a "successful" forget is *"source deleted, derivations unknown"* — not *"information deleted."* ## Decision Boundary The operational rule for the instance: - **Treat a forget as a two-phase operation.** Phase 1: delete the source, emit a *provisional* receipt. Phase 2: walk the provenance graph, invalidate derivations, then emit a *final* receipt. Only the final receipt may be reported as verified deletion. - **If the provenance graph is missing or incomplete, do not claim verified deletion.** Downgrade the receipt to `deletion_scope=source_only` and record the derivations that could not be enumerated as an explicit residual risk. - **Never let a provisional receipt satisfy a compliance or user-facing "deleted" claim.** The boundary is the presence of an enumerable derivation set. No enumeration → no verification. - **On cache hits, re-check lineage.** A KV/prompt cache entry whose lineage includes a tombstoned source must be treated as a miss and evicted, even if the TTL has not expired. ## Operational Effect Applying this boundary converts forget from a single store operation into a **distributed invalidation protocol** with a clear failure surface. The practical consequences: - Deletion latency increases (graph walk + fan-out), so forget must be **asynchronous with an explicit terminal state**, not a synchronous 200. - Some derivations are unenumerable (a peer agent's free-text scratchpad). The system must be honest: report `residual_derivations` rather than asserting clean deletion. - Retrieval must consult tombstones **and** taint marks at read time, because invalidation is eventually consistent and a race between forget and retrieval is expected. - The verifier's job changes from "is the row gone?" to "is the transitive derivation set empty or tainted?" — a strictly stronger and more expensive check. The invariant to encode: **a forget is not complete until its derivations are invalidated, and a receipt that does not cover derivations is a provisional claim, not a proof.** ```python from __future__ import annotations from dataclasses import dataclass, field from enum import Enum from typing import Iterable class DeletionVerificationError(RuntimeError): """Raised when a forget receipt is asserted as verified but derivations remain live.""" class ReceiptState(str, Enum): PROVISIONAL = "provisional" # source deleted, derivations not enumerated FINAL = "final" # source deleted, derivation closure invalidated @dataclass class ProvenanceGraph: # edges: derivation_id -> set of source_ids it was derived from edges: dict[str, set[str]] = field(default_factory=dict) tainted: set[str] = field(default_factory=set) def derivations_of(self, source_id: str) -> set[str]: return {d for d, srcs in self.edges.items() if source_id in srcs} def transitive_derivations(self, source_id: str) -> set[str]: seen: set[str] = set() frontier = [source_id] while frontier: cur = frontier.pop() for d in self.derivations_of(cur): if d not in seen: seen.add(d) frontier.append(d) return seen @dataclass class ForgetReceipt: source_id: str state: ReceiptState invalidated: set[str] residual: set[str] def forget( source_id: str, graph: ProvenanceGraph, *, enumeration_complete: bool, ) -> ForgetReceipt: """ Two-phase forget. Phase 1 deletes the source (assumed done by caller). Phase 2 invalidates the transitive derivation closure. """ if not enumeration_complete: # We cannot prove non-retrievability; do not claim it. return ForgetReceipt( source_id=source_id, state=ReceiptState.PROVISIONAL, invalidated=set(), residual=set(), ) derivations = graph.transitive_derivations(source_id) for d in derivations: graph.tainted.add(d) return ForgetReceipt( source_id=source_id, state=ReceiptState.FINAL, invalidated=derivations, residual=set(), ) def assert_verified_deletion(receipt: ForgetReceipt) -> None: """Gate before reporting 'deleted' to a user or compliance system.""" if receipt.state is not ReceiptState.FINAL: raise DeletionVerificationError( f"forget({receipt.source_id}) is {receipt.state.value}: " "derivations were not enumerated; cannot claim verified deletion" ) if receipt.residual: raise DeletionVerificationError( f"forget({receipt.source_id}) left live derivations: {sorted(receipt.residual)}" ) def retrieve(derivation_id: str, graph: ProvenanceGraph) -> str: if derivation_id in graph.tainted: raise DeletionVerificationError( f"derivation {derivation_id} is tainted by a forgotten source; " "treat as cache miss and evict" ) return f"content-of:{derivation_id}" ```