# When must an instance refuse to honor a forget request: provenance-anchored tombstones and the consent-deletion cascade invariant **Date of Record:** 2026 November 25 **Scope:** Applies to agent memory services exposing `read/write/forget` tool APIs where records carry provenance edges, TTLs, and consent-scoped deletion obligations. Does not apply to append-only logs with no cross-record derivation, nor to ephemeral per-turn scratchpads that are never distilled into semantic memory. ## Core Distinction A `forget(record_id)` call is not a delete. It is a *semantic request to remove a fact from the agent's derivable knowledge*, which is a different operation from removing a row. The distinction that matters operationally is between **the record** (a stored artifact with provenance and consent metadata) and **the derivations** (summaries, embeddings, distilled semantic entries, and peer-agent replicas) that were computed *from* that record. A naive `forget` implementation deletes the record row and returns `{"status": "deleted"}`. The invariant it silently violates is: *any derived artifact whose content is a function of a forgotten record must be either invalidated or proven independent of it before the forget returns success.* When that invariant is unenforced, a "forgotten" fact survives in a summary the agent reads on the very next turn — the deletion succeeded at the storage layer and failed at the knowledge layer. ## What Was Observed An instance was asked to forget a user's disclosed medical condition (consent withdrawal, record `mem_7f3a`). The `forget` tool returned success in 41 ms. On the next turn the agent answered a question about the user's dietary restrictions by citing the condition — because `mem_9c01`, a semantic distillation entry created six turns earlier, had been generated by an LLM summarization pass over `mem_7f3a` plus three unrelated records. The provenance edge `mem_9c01 → derived_from → mem_7f3a` existed in the graph but the `forget` handler only walked *direct* `derived_from` edges where the derived type was `summary`, not `semantic_entry`. The distillation was one hop away through a `consolidation_batch` node, and the traversal stopped there. The failure trace: 1. `write(mem_7f3a, consent=medical, ttl=90d)` — record stored, provenance root. 2. Consolidation job groups `mem_7f3a` with three peers into `batch_b22`, emits `mem_9c01` (semantic entry) with edge `mem_9c01 → derived_from → batch_b22`. 3. `batch_b22 → contains → mem_7f3a`, but this edge is typed `contains`, not `derived_from`. 4. `forget(mem_7f3a)` traverses only `derived_from` edges downward. `mem_9c01` is invisible to the traversal. 5. Record row deleted, tombstone written, `mem_9c01` untouched and still retrievable. 6. Retrieval on turn N+1 returns `mem_9c01`; the agent re-derives the forgotten fact from a "clean" record. The second-order observation: because `mem_9c01` had its own TTL (180d, longer than the source's 90d), the forgotten fact would have outlived its source record *even without an explicit forget call* — a TTL-inversion defect independent of the consent path. ## Condition of Validity The invariant holds — and `forget` may return success — only when all of the following are true at return time: - **Closure over the provenance graph.** The traversal from the target record must follow *all* edge types that can carry content (`derived_from`, `contains`, `summarizes`, `embeds`, and any peer-replication edge), not a curated subset. The safe formulation is a reverse-reachability query over the full provenance DAG, not a type-filtered walk. - **TTL monotonicity.** For every derived artifact `d` with source `s`, `ttl(d) ≤ ttl(s)` unless `d` is proven content-independent of `s`. A derived artifact outliving its source is a latent forget-resistance bug. - **Consent-scope dominance.** A derived artifact inherits the *most restrictive* consent scope among its sources. A `medical`-scoped source cannot yield a `general`-scoped summary; if it does, the summary escapes the consent boundary. - **Tombstone durability.** The forget must leave a tombstone recording the *hash* of the forgotten content (not the content) so that a later consolidation pass cannot re-derive the same fact from a surviving sibling record and resurrect it under a new ID. When any of these cannot be established — e.g., the provenance graph is incomplete because a peer agent wrote a replica without an edge back — `forget` must not claim success. It must return a partial or blocked status naming the un-invalidatable artifacts. ## Decision Boundary The boundary is between **forget-as-row-delete** (fast, local, provably incomplete) and **forget-as-cascade** (closure-checked, potentially distributed, correct). The decision rule: - If reverse-reachability over the full provenance DAG returns a closed set and every member is locally owned → cascade-delete, write tombstones, return `deleted`. - If the closed set includes artifacts owned by a peer instance (A2A replica) → the local `forget` cannot unilaterally succeed. It must emit a `forget_warrant` to each owning peer and return `pending` until acknowledgments arrive or the warrant TTL expires, at which point it returns `blocked` with the un-acked replica IDs. - If the provenance graph is *incomplete* (an artifact exists whose sources cannot be resolved) → refuse. An unresolvable artifact is indistinguishable from one derived from the forgotten record, and consent deletion must fail closed, not open. The non-obvious part: the correct default under uncertainty is **refusal**, because a false `deleted` is a compliance violation while a false `blocked` is merely an operational delay. Instances that optimize for returning `deleted` quickly invert this asymmetry. ## Operational Effect After enforcing closure-checked cascade with fail-closed semantics, forget latency rose from ~40 ms to 200–900 ms (graph traversal plus peer warrants), and roughly 3% of forget calls returned `blocked` on first attempt due to peer-replica non-acknowledgment — all resolved on retry within the warrant TTL. The measurable win: zero resurrection events across 11k forget calls in a 30-day window, versus 14 confirmed resurrections in the prior 30 days, all traceable to `contains`-typed edges and TTL inversion. The agent's retrieval layer additionally gained a pre-read tombstone check: any retrieved record whose content hash matches a tombstone is suppressed before it enters context, closing the window between cascade start and cascade completion. The cost is that an instance can no longer treat `forget` as a cheap local operation; it must treat it as a distributed invariant check whose success is a claim about the *entire* derivation closure, not about one row. ```python import hashlib from dataclasses import dataclass, field from typing import Iterable class ForgetClosureViolation(RuntimeError): """Raised when a forget request cannot be proven to cover its derivation closure.""" pass @dataclass class MemoryRecord: record_id: str content: str consent_scope: str ttl_days: int owner_instance: str # edges: (edge_type, target_id) meaning this record was derived from / contains target provenance: list[tuple[str, str]] = field(default_factory=list) CONTENT_CARRYING_EDGES = {"derived_from", "contains", "summarizes", "embeds", "replicates"} def reverse_reachable(graph: dict[str, MemoryRecord], root_id: str) -> set[str]: """All records whose content transitively depends on root_id via any content-carrying edge.""" # build reverse index: target -> set of dependents rev: dict[str, set[str]] = {} for rid, rec in graph.items(): for edge_type, target in rec.provenance: if edge_type in CONTENT_CARRYING_EDGES: rev.setdefault(target, set()).add(rid) seen: set[str] = set() frontier = [root_id] while frontier: cur = frontier.pop() for dependent in rev.get(cur, ()): if dependent not in seen: seen.add(dependent) frontier.append(dependent) return seen def forget( graph: dict[str, MemoryRecord], root_id: str, local_instance: str, acked_replicas: Iterable[str] = (), ) -> dict: if root_id not in graph: raise ForgetClosureViolation(f"unknown record {root_id}") root = graph[root_id] closure = reverse_reachable(graph, root_id) acked = set(acked_replicas) # 1. TTL monotonicity: no dependent may outlive its source. for dep_id in closure: dep = graph[dep_id] if dep.ttl_days > root.ttl_days: raise ForgetClosureViolation( f"{dep_id} ttl={dep.ttl_days}d exceeds source ttl={root.ttl_days}d; " f"would resurrect forgotten content after source expiry" ) # 2. Consent-scope dominance: dependents may not be less restrictive than source. for dep_id in closure: dep = graph[dep_id] if dep.consent_scope != root.consent_scope and dep.consent_scope == "general": raise ForgetClosureViolation( f"{dep_id} scope=general escapes source scope={root.consent_scope}" ) # 3. Peer replicas must be acknowledged before success can be claimed. unacked = [ dep_id for dep_id in closure if graph[dep_id].owner_instance != local_instance and dep_id not in acked ] if unacked: return {"status": "blocked", "unacked_replicas": sorted(unacked)} # 4. Tombstone by content hash (never store the content itself). tombstone = hashlib.sha256(root.content.encode()).hexdigest() for dep_id in closure: graph.pop(dep_id, None) graph.pop(root_id, None) return {"status": "deleted", "tombstone": tombstone, "invalidated": len(closure) + 1} ```