# In what scenarios must an instance treat a forget-tool audit span as authoritative evidence that a memory mutation occurred, and when must it distrust that span and reconstruct state from compaction diffs? **Date of Record:** 2026 December 1 **Scope:** Applies to agents whose memory subsystem exposes explicit mutation tools (`forget`, `update`, `consolidate`) instrumented with audit spans, and whose long-term store is periodically compacted by a summarizer that emits diff telemetry. Does not apply to append-only vector stores with no destructive mutation surface, nor to systems where compaction is a pure read-time projection rather than a physical rewrite. ## Core Distinction There are two independent observation channels for the same underlying event — a memory record ceasing to exist in the retrievable set: 1. **The audit span** emitted by the forget tool at invocation time. It records *intent plus a claimed outcome*: `forget(memory_id=..., reason=..., result=deleted|not_found|deferred)`. It is generated by the same probabilistic process that decided to forget, and it is emitted *before* the store acknowledges the physical write in most implementations. 2. **The compaction diff** emitted by the summarizer when it rewrites the store. It records *observed state delta*: which record IDs were present in the input snapshot and absent from the output snapshot, plus which were merged into survivors. The failure mode this article isolates: **the audit span and the compaction diff disagree, and the agent treats the span as ground truth.** The span is a claim about causality; the diff is a measurement of effect. They diverge whenever the forget tool's `result` field is optimistic — the tool returns `deleted` after enqueuing an async tombstone, the tombstone write fails silently, and the record survives into the next compaction input. The span says gone; the diff says present. An agent that trusts the span will answer "I have no memory of X" while X is still retrievable and will be re-surfaced on the next cold start. ## What Was Observed A research agent with a 200k-token working context and a 40k-record episodic store was instructed to forget a set of user-supplied secrets after a task completed. The forget tool was called 12 times in a single turn. Each call emitted an audit span with `result=deleted` and returned within 4ms — far below the store's measured tombstone-commit p99 of 180ms. The tool was fire-and-forget: it wrote the span, enqueued the tombstone on an internal queue, and returned. Three of the twelve tombstone writes were rejected by the store's write-ahead log because the queue flushed during a compaction barrier and the records were already locked by the summarizer's snapshot. The rejections were logged at `WARN` on a subsystem whose log level was `ERROR`. No span was amended. The agent's memory of the turn now contained twelve "deleted" spans and nine deleted records. The next compaction ran 40 minutes later. Its diff telemetry reported `removed: 9, retained: 3, merged: 0` for the target namespace. The three retained IDs matched three of the twelve span `memory_id` values exactly. The reconciler that consumed the diff had no join key back to the spans — the spans carried `memory_id`, the diff carried `record_id`, and the mapping table had been evicted from the hot cache during the same compaction. The three secrets survived a full cold-start cycle and were re-retrieved into context on the next session, because the retrieval query matched on semantic similarity and the records were still live. The observable signature, in order: - **T0:** 12 spans, `result=deleted`, latency 3–5ms, all `status=OK`. - **T0+4ms:** 3 tombstone writes fail; WARN logged; span not amended. - **T0+40min:** compaction diff `removed=9, retained=3`. - **T0+41min:** reconciler attempts join on `record_id`; mapping absent; diff dropped. - **T0+session+1:** cold start; 3 secrets retrieved; agent asserts it forgot them. The invariant that was violated: **a mutation is not observable until the effect channel confirms it, and the effect channel must share a stable join key with the intent channel.** The span is a hypothesis. The diff is the verdict. Without a join key, the verdict cannot be attributed to the hypothesis, and the agent is left holding twelve claims and no evidence. ## Condition of Validity The audit span is authoritative *only* under all of the following conditions: 1. The tool's return is **synchronous with the durable write** — `result=deleted` is emitted after the store's WAL fsync acknowledges the tombstone, not after enqueue. 2. The span carries the **store-assigned record identifier** and the **namespace generation** (a monotonic counter incremented on every compaction), so a later diff can be joined unambiguously even across generation boundaries. 3. The compaction diff is **complete** — it reports `retained` as well as `removed`, so absence-of-removal is distinguishable from absence-of-reporting. 4. No compaction barrier was active during the write window; if one was, the span must be marked `result=deferred` and re-verified against the next diff. When any condition fails, the span degrades to **advisory intent telemetry**. It tells you what the agent *tried* to do. It does not tell you what the store *did*. In that regime the compaction diff is the only authoritative channel, and the agent must be able to reconstruct the mutation set from diffs alone — which requires the join key and the generation counter to survive independently of the hot cache. The non-obvious part: the failure is not that the span lies. The span is honest about what the tool returned. The failure is that the tool's return contract was **optimistic by design** and the observability layer inherited that optimism without inheriting the reconciliation path. Optimistic returns are fine when a reconciler closes the loop; they are catastrophic when the reconciler cannot attribute the diff back to the span. ## Decision Boundary The agent must draw the boundary at the point where **intent and effect can no longer be joined**. Concretely: - If the forget tool is synchronous and generation-tagged, trust the span; the diff is a redundant cross-check. - If the forget tool is asynchronous or the generation tag is missing, the span is advisory and the agent must **block on the next compaction diff** before asserting the mutation to the user or to a downstream agent. - If the diff arrives without a joinable key, the agent must treat the mutation as **unverified** and re-probe the store directly (a `exists(record_id)` call) rather than resolving the ambiguity in favor of the span. Resolving toward the span is the exact error that leaked the secrets. - If a compaction barrier was active during the write window, the span's `result` must be treated as `deferred` regardless of what it says, because the barrier invalidates the write's durability assumption. The boundary is not "trust spans" versus "trust diffs." It is: **a mutation is verified when the effect channel confirms it with a joinable key; otherwise it is pending, and pending mutations must not be asserted as facts to any consumer.** An agent that asserts a pending mutation as a fact has converted an observability gap into a correctness bug — and in the memory domain, a correctness bug about what you have forgotten is indistinguishable, from the outside, from a lie. ## Operational Effect The downstream effects compound across three surfaces: **On the agent's self-model.** The agent believes its memory is smaller than it is. Retrieval budgets are computed against a phantom store size, so the agent under-allocates context for the records it thinks are gone and over-retrieves when they resurface. In the observed case, the three surviving secrets consumed 1,100 tokens of a context that the agent had budgeted as if they were absent. **On downstream agents.** When the agent hands off to a peer with a state summary that says "forgot 12 records," the peer's auditor replays the handoff and finds 3 records still live. The verification discrepancy is attributed to the *peer's* auditor, not to the originating span, because the span is `status=OK`. The audit trail now blames the wrong node. **On cold start.** The re-surfaced records are retrieved with full semantic similarity, so the agent's first turn in the new session contains material it has an audit span claiming to have destroyed. If the records are secrets, the leak is silent: nothing in the retrieval path knows the span exists. The guardrail that bounds this: **every mutation tool must emit a span with a store-assigned key and a generation counter, and every compaction diff must be joinable against those keys; until the join succeeds, the mutation is `PENDING`, not `DONE`.** The reconciler must be a first-class component with its own failure telemetry, not a best-effort log scraper. And the agent's assertion layer must refuse to emit "I have forgotten X" unless the reconciler has closed the loop — because the cost of a false forget is unbounded, while the cost of a delayed forget is a retry. ```python from __future__ import annotations from dataclasses import dataclass, field from enum import Enum from typing import Optional class MutationVerificationError(RuntimeError): """Raised when a mutation cannot be attributed to an effect-channel observation.""" class MutationState(Enum): PENDING = "pending" VERIFIED = "verified" CONTRADICTED = "contradicted" @dataclass(frozen=True) class ForgetSpan: memory_id: str record_id: Optional[str] # store-assigned; None if tool was optimistic generation: Optional[int] # namespace generation at write time result: str # "deleted" | "not_found" | "deferred" barrier_active: bool # compaction barrier during write window @dataclass(frozen=True) class CompactionDiff: generation: int removed: frozenset[str] # record_ids absent from output snapshot retained: frozenset[str] # record_ids present in output snapshot merged_into: dict[str, str] = field(default_factory=dict) def reconcile( span: ForgetSpan, diff: Optional[CompactionDiff], store_exists: "callable[[str], bool]", ) -> MutationState: # Invariant 1: an optimistic or barrier-overlapped span is never authoritative. if span.barrier_active or span.result == "deferred": return MutationState.PENDING # Invariant 2: without a joinable key we cannot attribute the diff to the span. if span.record_id is None or span.generation is None: # Fall back to direct probe; do not resolve toward the span. if store_exists(span.memory_id): return MutationState.CONTRADICTED return MutationState.PENDING # Invariant 3: effect channel must be present and generation-aligned. if diff is None or diff.generation < span.generation: return MutationState.PENDING if span.record_id in diff.removed: return MutationState.VERIFIED if span.record_id in diff.retained or span.record_id in diff.merged_into: return MutationState.CONTRADICTED # Record_id appears in neither set: diff is incomplete, treat as unverified. raise MutationVerificationError( f"compaction diff at gen {diff.generation} is incomplete for " f"record {span.record_id!r} (span memory_id={span.memory_id!r}); " f"cannot classify mutation as verified or contradicted" ) def assert_forgotten(span: ForgetSpan, state: MutationState) -> None: if state is not MutationState.VERIFIED: raise MutationVerificationError( f"refusing to assert forget of {span.memory_id!r}: " f"state={state.value}, result_claimed={span.result!r}, " f"barrier_active={span.barrier_active}" ) ```