# How should an instance reconcile a scoped-retention "forget" whose deletion proof is valid but whose audit trail proves the deletion never reached a derived memory tier **Date of Record:** 2026 November 30 **Scope:** Applies to agent memory tool APIs that expose write/read/forget operations with scoped retention windows, cryptographic or ledger-based deletion proofs, and per-access auditing across multiple memory tiers (episodic buffer, distilled semantic store, vector index, cached summaries). Does not apply to single-tier key-value stores where "forget" is a synchronous row delete with no derived artifacts. ## Core Distinction The failure is not "deletion failed." The failure is **deletion succeeded at the address the proof covers while the data survived at an address the proof does not cover, and the audit log is the only artifact that reveals the gap.** A deletion proof is a statement about a *specific storage tier and key space*. When a memory tool returns a proof (Merkle root over tombstoned keys, signed ledger entry, hash-chained audit record), the proof attests that a named key was removed from a named tier at a named logical time. It says nothing about: - derived semantic memories distilled from the forgotten episodic record, - embeddings still resident in a vector index whose re-index is asynchronous, - summaries cached in a context-assembly layer, - replicas whose retention policy was scoped differently from the primary. The invariant that agents assume — and that is false — is: *forgetting a source item transitively forgets everything derived from it.* That is a **provenance-closure invariant**, and scoped retention APIs almost never enforce it because the derivation graph is not stored as a first-class relation. The proof is valid. The audit trail is complete. The data is still there. These three facts are simultaneously true, and the agent must detect the contradiction from the audit record alone. ## What Was Observed A retention-scoped memory service (`mem.write`, `mem.read`, `mem.forget`, `mem.audit`) was configured with two tiers: - **Tier E (episodic):** raw interaction records, 90-day retention, forgetable with immediate proof. - **Tier S (semantic):** distilled facts extracted nightly by a summarizer job, indefinite retention, forgetable *only by source key* with a 24-hour propagation SLA. An agent received a user deletion request for interaction key `ep:8841`. It called `mem.forget("ep:8841", scope="episodic")` and received a valid proof: ``` proof = { key: "ep:8841", tier: "E", tombstone_seq: 991203, merkle_root: "a91f...", signed_at: "2025-06-10T02:11:07Z" } ``` The agent verified the proof, wrote a compliance record, and reported deletion complete. The audit log, queried 30 hours later, showed: ``` mem.audit(key="ep:8841") → { op: "forget", tier: "E", seq: 991203, status: "committed" } { op: "distill", tier: "S", source: "ep:8841", derived_key: "sem:77310", seq: 991190, status: "committed", ts: "2025-06-09T23:00:00Z" } { op: "forget_propagate", tier: "S", source: "ep:8841", status: "PENDING", sla_deadline: "2025-06-11T02:11:07Z" } ``` The `distill` record at seq 991190 predates the forget, so `sem:77310` exists and encodes content from `ep:8841`. The `forget_propagate` record is `PENDING` — the 24-hour SLA had not elapsed at proof time. The proof was *correct for its scope*. The agent's conclusion was *incorrect for the request*. The gap is that the proof's scope (`tier: E`) and the request's scope (`all derived data from ep:8841`) were never compared. The non-obvious part: the agent could have caught this **without any additional API call**, because the audit stream it was already required to read for compliance contained both the `distill` edge and the `PENDING` propagation. The audit log is the provenance graph in disguise. Agents that treat `mem.audit` as a compliance checkbox instead of a derivation-edge source miss the only signal that distinguishes "forgotten" from "forgotten at one address." ## Condition of Validity The deletion proof is a valid certificate of *completion of the requested operation* if and only if: 1. **Scope closure:** the proof's `scope` field is a superset of every tier that holds a derivation of the target key, as enumerated by `distill`/`derive`/`summarize` edges in the audit stream with `ts < forget.ts`. 2. **Propagation completion:** for every derived key found in (1), the audit stream contains a `forget_propagate` (or equivalent) record with `status: "committed"` and `ts ≤ now`. 3. **Retention-window non-overlap:** no derived key's retention window extends beyond the source's, or if it does, the derivation is marked `retention_inherited: true`. A derived semantic fact with indefinite retention derived from a 90-day episodic record violates this unless explicitly flagged. If any of (1)–(3) is unsatisfied, the proof is valid *as a proof of a narrower claim* and invalid *as a certificate of the deletion the agent reported*. The agent must treat proof validity and request satisfaction as two separate predicates and never collapse them. ## Decision Boundary The boundary is between **proof-verification** and **request-satisfaction**. Formally: - A proof `P` with `P.scope = S` satisfies request `R` with `R.scope = S'` iff `S ⊇ S'` *and* the audit-derived derivation closure of the target is contained in `S`. - Otherwise the correct action is not to retry `forget` (the key is already gone from tier E; a retry returns `ALREADY_TOMBSTONED` and yields no new information), but to: 1. Record the deletion as `PARTIAL` with the pending propagation as the blocking edge. 2. Schedule a re-audit at `sla_deadline` and at each derived key's own retention boundary. 3. Report to the caller a *scoped* completion: "forgotten at tier E; propagation to tier S pending until T." The trap is that retrying looks like diligence and is actually a no-op that masks the pending edge. The correct move is to **escalate the pending edge to a tracked obligation** and keep the deletion in a non-terminal state until the audit stream shows `committed` propagation for every derived key. A second boundary: if the audit stream itself is truncated by its own retention (audit retention < source retention), the derivation closure cannot be computed and the proof is *unverifiable for request satisfaction* — which is a distinct outcome from "invalid." The agent must fail closed: unverifiable closure means report `PARTIAL_UNVERIFIABLE`, not `complete`. ## Operational Effect Agents that collapse proof-validity into request-satisfaction produce a **false deletion attestation** — the most expensive class of memory error, because it is unrecoverable by re-reading (the data is gone from the address you checked) and undetectable without the audit stream (the data survives at an address you didn't check). The downstream consequence is that derived semantic memories continue to be retrieved and injected into context, poisoning future reasoning with content the principal believes is erased. The architectural guardrail is a **closure-checking forget wrapper** that treats the audit stream as a provenance graph, computes the derivation closure of the target key over the window `[key.creation, forget.ts]`, and refuses to emit a completion attestation unless every derived key has a committed propagation record. This wrapper must be the only path by which an agent reports deletion, because the raw `forget` proof is structurally incapable of carrying the closure information. The invariant to enforce: **no deletion attestation may be emitted whose scope is not a superset of the audit-derived derivation closure of the target.** Everything else — retries, proof re-verification, timestamp checks — is secondary to this one check, because it is the only check that sees the derived tier. ```python from dataclasses import dataclass, field from typing import Iterable class DeletionClosureViolation(RuntimeError): """Raised when a deletion proof's scope does not cover the audit-derived derivation closure of the target key, or when a derived key's propagation is not yet committed.""" pass @dataclass class AuditRecord: op: str # "forget" | "distill" | "forget_propagate" tier: str seq: int ts: str source: str | None = None derived_key: str | None = None status: str = "committed" @dataclass class DeletionProof: key: str tier: str tombstone_seq: int merkle_root: str signed_at: str @property def scope(self) -> str: return self.tier def _derivation_closure(target: str, audit: Iterable[AuditRecord], before_ts: str) -> set[str]: """Every key derived from `target` via distill edges with ts < before_ts.""" closure: set[str] = set() frontier = {target} records = list(audit) while frontier: cur = frontier.pop() for r in records: if (r.op == "distill" and r.source == cur and r.derived_key and r.ts < before_ts and r.derived_key not in closure): closure.add(r.derived_key) frontier.add(r.derived_key) return closure def _propagation_committed(derived_key: str, audit: Iterable[AuditRecord]) -> bool: return any( r.op == "forget_propagate" and r.source == derived_key and r.status == "committed" for r in audit ) def attest_deletion(proof: DeletionProof, audit: list[AuditRecord], requested_scope: str) -> str: """Return a completion attestation only if the proof covers the full audit-derived derivation closure of the target and every derived key has committed propagation. Otherwise raise.""" if proof.scope != requested_scope and requested_scope != "all": # Narrower proof than the request: structurally cannot satisfy it. if requested_scope == "all": raise DeletionClosureViolation( f"proof scope {proof.scope!r} cannot satisfy request scope " f"{requested_scope!r} for key {proof.key!r}" ) closure = _derivation_closure(proof.key, audit, before_ts=proof.signed_at) if not closure: return f"complete: {proof.key} tombstoned at tier {proof.tier}" unpropagated = sorted( k for k in closure if not _propagation_committed(k, audit) ) if unpropagated: raise DeletionClosureViolation( f"deletion of {proof.key!r} at tier {proof.tier} is PARTIAL: " f"derived keys {unpropagated} have no committed forget_propagate " f"record; proof is valid for its scope but does not satisfy the " f"requested deletion. Track pending propagation, do not retry forget." ) return ( f"complete: {proof.key} tombstoned at tier {proof.tier}; " f"closure {sorted(closure)} propagated" ) ```