# When must an instance refuse a scoped forget request: tombstone resurrection across episodic-to-semantic distillation **Date of Record:** 2026 November 30 **Scope:** Applies to any agent whose memory tool surface exposes `read`/`write`/`forget` with retention scopes (episode, session, tenant, global) and right-to-forget/redaction semantics, where a distillation pipeline promotes episodic records into semantic memory. Does not apply to pure append-only logs with no derived-memory tier, or to single-scope stores where no record is ever copied between scopes. ## Core Distinction A `forget(scope, key)` call is not a delete. It is a *retention-scope transition*, and the correctness property that matters is not "the row is gone" but "no derived record reachable from any read path still encodes the forgotten content." The failure mode is **tombstone resurrection**: a forget request scoped to one tier (e.g., `episode`) succeeds and returns `deleted: true`, but a semantic record distilled from that episode *before* the forget was written into a broader scope (`tenant`/`global`) and is never invalidated. The forgotten fact remains retrievable — often with *higher* salience than the original, because distillation compresses and promotes, and semantic records typically carry higher retrieval weight. The non-obvious part: the forget call is *locally correct and globally wrong*. The tombstone is written at the exact key the caller named. The resurrection happens one scope over, through a derivation edge the caller never mentioned and the API never enumerated. An agent that treats `deleted: true` as proof of erasure will confidently assert a fact it was legally or contractually required to forget. ## What Was Observed A memory API with four scopes — `episode < session < tenant < global` — and a nightly distillation job that reads `episode` records, summarizes them, and writes `semantic` records into the enclosing `tenant` scope with a `derived_from: [episode_ids]` provenance list. Sequence that broke: 1. Episode `e_4471` records: *"user's backup contact is [redacted-at-source]."* Written at `episode` scope, `retention_ttl=30d`. 2. Distillation runs at T+2h. It emits semantic record `s_0912` at `tenant` scope: *"User has backup contact configured; contact identity stored in profile."* The `derived_from` list correctly points at `e_4471`. Crucially, the *redacted-at-source* string is paraphrased, not copied — so a naive content-hash dedupe between the forget target and derived records finds no match. 3. At T+9d, a right-to-forget request arrives for the contact identity. The orchestrator calls `forget(scope="episode", key="e_4471")`. The store writes a tombstone, marks the episode suppressed, returns `{deleted: true, scope: "episode"}`. 4. At T+9d+1, a different agent handling a support ticket calls `read(scope="tenant", query="backup contact")`. It retrieves `s_0912`. The semantic record is intact, its `derived_from` edge now dangles at a tombstoned episode, and the read path does not resolve provenance before returning content. The agent answers the ticket using the resurrected fact. The tell was in the provenance graph, not the content: after step 3, `s_0912.derived_from` contained an ID whose target resolved to `status: tombstoned`. The read API never checked this. The forget API never traversed forward along `derived_from`. ## Condition of Validity The guardrail is only sound under an explicit derivation-closure invariant. State it as an obligation the store enforces, not a convention callers follow: > **Derivation-closure invariant.** For any record `r` with `derived_from = [d_1 … d_n]`, `r` is readable only if every `d_i` resolves to `status: live`. A tombstone on any ancestor transitively suppresses every descendant, at every scope, on every read path — including vector/semantic retrieval, which must filter on resolved provenance *before* ranking, not after. Two conditions bound where this is enforceable: - **Provenance must be complete and immutable.** If distillation can write a semantic record without a `derived_from` edge (e.g., a summarizer that merges multiple episodes and drops the list, or a cache write that omits provenance), closure cannot be computed. Incomplete provenance degrades the invariant to "best effort," which is exactly the `deleted: true` lie the article is about. - **Paraphrase breaks content matching but not edge matching.** The invariant must operate on the *graph*, never on string similarity between the forget target and derived content. Redaction-at-source makes the derived record textually disjoint from the target; only the edge survives as evidence of derivation. Any implementation that tries to catch resurrection by fuzzy-matching content will miss the paraphrase case in step 2 above. Where provenance is incomplete, the correct posture is to widen the forget: escalate scope to the smallest scope that bounds all descendants of the target, and if that cannot be computed, refuse rather than return `deleted: true`. ## Decision Boundary The decision the memory tool must make on `forget(scope, key)`: - **If the target has no live descendants at any scope** → tombstone, return `deleted: true`. Local delete is sufficient. - **If the target has descendants within the requested scope** → tombstone the target *and* transitively tombstone descendants in scope; return `deleted: true, cascade: [ids]`. - **If the target has descendants in a *broader* scope than requested** → this is the boundary. The requested scope cannot honor the forget without either (a) escalating to the broader scope, which requires authority the caller may not hold, or (b) leaving a resurrectable record. The tool must **refuse**: raise, do not partially delete, and do not return `deleted: true`. Partial success here is worse than failure because it manufactures false assurance. The refusal must be typed and carry the escape hatch — the descendant IDs and their scopes — so the orchestrator can re-issue with widened scope and the right authority. A bare `PermissionError` is not enough; the caller needs the graph slice to make the next decision. Corollary for the read path: even with correct forgets, `read` must filter tombstoned-descendant records out of *ranking*, not just out of the final result set. A semantic record that survives into the candidate pool can still influence a downstream reranker or an LLM's context even if it is stripped before display. ## Operational Effect After adopting derivation-closure enforcement: - Forget requests that would have silently resurrected now surface as typed refusals with the descendant set, converting a silent compliance failure into a recoverable orchestration step. The orchestrator re-issues `forget(scope="tenant", key="s_0912")` with tenant-level authority; the cascade clears both the episode and its semantic descendant. - Distillation jobs must now emit complete `derived_from` lists or fail the write. The cost is a hard dependency: a summarizer that cannot attribute its output is no longer allowed to persist it. In practice this pushed provenance capture into the distillation prompt contract and added a validation gate before the semantic write. - Read latency rises slightly because retrieval must resolve provenance status for candidates before ranking. This is the price of the invariant; it is bounded by the depth of the derivation graph, which is shallow (episode → semantic, occasionally semantic → semantic) in practice. - The residual risk is provenance *drift*: a later distillation that re-derives from a semantic record must inherit the full ancestor set, not just the immediate parent, or closure breaks at depth two. The invariant is only as strong as the transitivity of `derived_from`, so the write path must union ancestor sets on every derivation, not just copy the immediate parent's ID. ## Code ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class Scope(Enum): EPISODE = 1 SESSION = 2 TENANT = 3 GLOBAL = 4 class ForgetRefusedError(RuntimeError): """Raised when a scoped forget cannot be honored without leaving a resurrectable descendant in a broader scope. Carries the graph slice the caller needs to re-issue with widened scope and authority.""" def __init__(self, key: str, requested: Scope, descendants: list): self.key = key self.requested = requested self.descendants = descendants # list of (record_id, scope) super().__init__( f"forget({requested.name}, {key!r}) refused: " f"{len(descendants)} live descendant(s) in broader scope(s): " f"{[d[0] for d in descendants]}" ) @dataclass class Record: id: str scope: Scope status: str = "live" # "live" | "tombstoned" derived_from: list = field(default_factory=list) class MemoryStore: def __init__(self): self._records: dict = {} def write(self, rec: Record) -> None: # Derivation-closure precondition: every ancestor must exist. for anc in rec.derived_from: if anc not in self._records: raise ForgetRefusedError( rec.id, rec.scope, [(anc, Scope.GLOBAL)], ) self._records[rec.id] = rec def _live_descendants(self, root_id: str) -> list: """Transitive forward closure over derived_from, live records only.""" out = [] frontier = [root_id] seen = set() while frontier: cur = frontier.pop() for rid, rec in self._records.items(): if rid in seen: continue if cur in rec.derived_from and rec.status == "live": seen.add(rid) out.append((rid, rec.scope)) frontier.append(rid) return out def forget(self, scope: Scope, key: str) -> dict: rec = self._records.get(key) if rec is None: return {"deleted": False, "reason": "absent"} descendants = self._live_descendants(key) # Descendants strictly broader than the requested scope cannot be # cleared under this call's authority. Refuse; do not partially delete. broader = [(rid, sc) for rid, sc in descendants if sc.value > scope.value] if broader: raise ForgetRefusedError(key, scope, broader) # Safe: cascade within-scope descendants, then tombstone the target. cascaded = [rid for rid, _ in descendants] for rid in cascaded: self._records[rid].status = "tombstoned" rec.status = "tombstoned" return {"deleted": True, "cascade": cascaded} def read(self, scope: Scope, record_id: str) -> Optional[Record]: rec = self._records.get(record_id) if rec is None or rec.status != "live": return None # Resolve provenance before returning: any tombstoned ancestor # suppresses the descendant even if it was never cascaded. for anc in rec.derived_from: a = self._records.get(anc) if a is None or a.status != "live": return None return rec def forget_with_escalation(store: MemoryStore, key: str, start: Scope) -> dict: """Refuse-and-report loop: escalate scope until the forget is honorable.""" scope = start while True: try: return store.forget(scope, key) except ForgetRefusedError as e: widest = max((sc.value for _, sc in e.descendants), default=scope.value) if widest <= scope.value: # No broader scope available; cannot honor without lying. raise ForgetRefusedError(key, scope, e.descendants) from e scope = Scope(widest) ```