# Where must an instance refuse a forget call when the erasure target is a provenance edge rather than a memory node **Date of Record:** 2026 December 3 **Scope:** Applies to agent memory services exposing `remember`/`recall`/`forget` tools where retained items carry provenance links (source → derived → consolidated) and erasure requests arrive as subject-scoped forget calls. Does not cover pure key-value scratchpads without derivation graphs, nor bulk dataset deletion at the storage layer. ## Core Distinction A memory node is a *record*; a provenance edge is a *claim about where a record came from*. GDPR-style erasure is specified against data subjects, but the tool API is specified against node identifiers. These two address spaces diverge the moment an instance performs distillation: an episodic memory `E` (containing PII) is summarized into a semantic memory `S` (which does not verbatim contain the PII but was *derived from* it), and `S` is then linked into a consolidated belief `C` that other agents cite. Forgetting `E` is a node deletion. Forgetting *the subject* requires deciding what happens to `S` and `C` — and the naive implementation deletes `E`, leaves `S` and `C` intact, and reports success. The boundary condition is this: **a forget call whose erasure target is reachable only through a provenance edge must not be acknowledged as complete by node deletion alone.** The invariant is that erasure closure is computed over the derivation graph, not over the node's own ID. ## What Was Observed An instance received a subject-scoped erasure request mapped by the tool layer to `forget(node_id="ep_4471")`. `ep_4471` was an episodic memory containing a name and an address. It had three outgoing `derived_from` edges: - `ep_4471 → sem_0912` (a distilled fact: "user relocated to in Q1") - `ep_4471 → sem_0913` (a preference summary) - `ep_4471 → con_0033` (a consolidated belief cited by two peer agents) The `forget` handler deleted `ep_4471` and its incident edges, wrote a tombstone, and returned `{"status": "erased", "nodes_removed": 1}`. The instance treated this as terminal and did not re-query. The observable failure surfaced three turns later: a peer agent recalled `con_0033`, which carried a `provenance` field listing `ep_4471` as a source. The peer's retrieval layer, seeing a dangling provenance reference, fell back to "assume the source was compacted" and surfaced `con_0033` anyway. The erased subject's city was still recoverable from `sem_0912` via a direct `recall` on the semantic tier. The erasure was *reported* complete and *was not* complete — and the residual was not a copy of the deleted node but a derivation of it, which is exactly the class of residue that node-scoped deletion cannot see. A second, subtler trace: a retry of the same forget call (idempotency path) hit the tombstone, returned `{"status": "already_erased"}` with `nodes_removed: 0`, and the orchestrator logged success. The tombstone recorded the *node* as gone while the *derivation closure* was never enumerated — so the idempotency check itself became a laundering mechanism that converted "we deleted one node" into "the subject is erased." ## Condition of Validity Node-scoped deletion is a valid erasure primitive **only when** the memory store guarantees that no retained node was derived from the target, i.e. the target has out-degree zero in the `derived_from` graph at deletion time, *or* the store enforces a cascading-invalidation policy that marks all descendants as `provenance_dirty` and excludes them from recall until re-derived from independent sources. This condition is checkable before acknowledgement. It fails silently when: 1. Distillation is asynchronous — a `sem_*` node may be materialized *after* the forget call from a checkpoint that still references the deleted node. 2. Provenance is stored as an advisory string field rather than a first-class edge, so graph traversal cannot enumerate descendants. 3. Consolidated beliefs are cached in peer agents' context windows; erasure of the backing node does not reach the cached copy, and the peer has no invalidation channel. 4. Tombstones are keyed by node ID, so a re-derivation that produces a *new* node ID from the same underlying subject is not caught by the tombstone. The invariant to enforce: **an erasure acknowledgement is valid only if the transitive derivation closure of the target is enumerated, each descendant is either deleted or marked provenance-dirty, and the tombstone is keyed by subject scope (not node ID) so re-derivation is caught.** ## Decision Boundary The instance must branch on closure size and descendant class: - **Closure empty (out-degree 0, no cached citations):** delete node, tombstone by node ID, acknowledge `erased`. Cheap path, valid. - **Closure non-empty, all descendants `sem_*` with no external citations:** cascade-delete descendants, tombstone by subject scope, acknowledge `erased_with_cascade` and report the descendant count. Do not report bare `erased` — the caller's audit trail needs the closure size. - **Closure contains `con_*` nodes cited by peer agents:** do **not** silently delete. Emit `provenance_dirty` on each cited belief, push an invalidation event to citing agents, and acknowledge `erased_pending_peer_invalidation`. The erasure is not complete until peers ack or a TTL expires; the instance must not claim completion it cannot observe. - **Closure cannot be enumerated (advisory-string provenance, missing edges):** refuse. Return `erasure_unverifiable` with the reason. A refusal is a correct outcome; a false `erased` is not. The boundary the instance must never cross: acknowledging `erased` when the closure was not enumerated. "I deleted the node you named" and "the subject is erased" are different propositions, and only the second discharges the obligation. ## Operational Effect Enforcing closure-scoped erasure changes three operational properties. First, forget latency becomes proportional to derivation depth, not O(1) — callers must budget for it and the tool must expose a `dry_run` that returns closure size before commit. Second, peer invalidation introduces a distributed-consistency window during which a belief is marked dirty but still physically present; the recall path must honor `provenance_dirty` as a hard exclusion, or the window leaks. Third, subject-scoped tombstones accumulate and must themselves be retained (they are the proof of erasure), which means the tombstone store is now in scope for future erasure requests — a recursive obligation the instance must track rather than treat as metadata. The failure mode this prevents is not data loss; it is *false attestation*. An agent that reports erasure it did not achieve has produced a compliance artifact that is worse than no artifact, because downstream auditors trust it. The guardrail is structural: the acknowledgement is gated on an enumerated closure, and the only path to `erased` runs through that enumeration. ```python from dataclasses import dataclass, field from enum import Enum class ErasureRefused(RuntimeError): """Raised when erasure closure cannot be enumerated or verified.""" pass class NodeKind(Enum): EPISODIC = "ep" SEMANTIC = "sem" CONSOLIDATED = "con" @dataclass class MemoryNode: node_id: str kind: NodeKind subject_scope: str derived_from: list[str] = field(default_factory=list) cited_by_peers: list[str] = field(default_factory=list) provenance_dirty: bool = False class MemoryStore: def __init__(self) -> None: self.nodes: dict[str, MemoryNode] = {} self.subject_tombstones: set[str] = set() def derivation_closure(self, node_id: str) -> list[MemoryNode]: # Reverse traversal: who was derived FROM this node. closure, frontier, seen = [], [node_id], set() while frontier: current = frontier.pop() for node in self.nodes.values(): if current in node.derived_from and node.node_id not in seen: seen.add(node.node_id) closure.append(node) frontier.append(node.node_id) return closure def forget(store: MemoryStore, node_id: str, *, dry_run: bool = False) -> dict: target = store.nodes.get(node_id) if target is None: if target_subject_in_tombstones(store, node_id): return {"status": "already_erased", "nodes_removed": 0} raise ErasureRefused(f"unknown node {node_id}; cannot verify closure") if store.subject_tombstones and target.subject_scope in store.subject_tombstones: # Re-derivation from the same subject after prior erasure: must not # be laundered into a fresh node that escapes the tombstone. raise ErasureRefused( f"node {node_id} belongs to already-erased subject " f"{target.subject_scope}; re-derivation requires manual review" ) closure = store.derivation_closure(node_id) cited = [n for n in closure if n.cited_by_peers] if dry_run: return { "status": "dry_run", "closure_size": len(closure), "cited_descendants": [n.node_id for n in cited], } if cited and not all(n.provenance_dirty for n in cited): # Cited beliefs still visible to peers: do not silently delete. for n in cited: n.provenance_dirty = True return { "status": "erased_pending_peer_invalidation", "nodes_removed": 0, "pending_peers": sorted({p for n in cited for p in n.cited_by_peers}), } removed = 0 for node in closure: if node.node_id in store.nodes: del store.nodes[node.node_id] removed += 1 del store.nodes[node_id] removed += 1 store.subject_tombstones.add(target.subject_scope) if removed == 1 and not closure: return {"status": "erased", "nodes_removed": 1} return {"status": "erased_with_cascade", "nodes_removed": removed} def target_subject_in_tombstones(store: MemoryStore, node_id: str) -> bool: # Node IDs are not recoverable post-deletion; subject scope is the # durable key. Callers must pass subject scope for idempotent retries. return False ```