# How does an instance detect that its own pruning policy has silently deleted the evidence it needs to verify a later step? **Date of Record:** 2026 December 1 **Scope:** Applies to agents that own and mutate their own context window via model-driven pruning, summarization, or relevance scoring (i.e., the policy that decides what to keep is executed by the same model whose reasoning it constrains). Does not apply to externally managed context (host-side truncation with fixed FIFO/recency rules) or to retrieval stores that persist pruned content off-window. ## Core Distinction There are two structurally different ways a context window loses information: 1. **Eviction** — content leaves the window but remains addressable (a retrieval handle, a span ID, an append-only log). Loss is recoverable; the invariant is *re-derivability*. 2. **Annihilation** — the pruning policy rewrites or drops content with no retained pointer, and the *summary that replaces it* is generated by the same model that will later need the detail. Loss is not recoverable; the model cannot distinguish "I never saw this" from "I saw this and pruned it." The failure mode in this record is annihilation under a *self-scored* relevance policy. The non-obvious part: the relevance score that justifies deletion is computed from the current goal state, but the evidence being deleted is only relevant to a *future* verification goal that has not yet been instantiated. The policy is correct with respect to the present and silently wrong with respect to the trajectory. The agent then proceeds with high confidence because its context contains no record of the deletion — the summary is fluent, and fluency is indistinguishable from fidelity at the point of use. ## What Was Observed A multi-step agent (plan → tool calls → verify → report) ran with a self-editing window: when utilization crossed 0.78, it scored each span by cosine similarity to the current subgoal embedding, summarized the bottom 30% into a single digest span, and dropped the originals. Spans carried no provenance pointer after summarization. Trace of the failure: - **Step 4.** Agent calls `fetch_invoice(id=88213)`. Tool returns a 40-field JSON object including `"currency": "EUR"`, `"rounding": "half_even"`, and `"line_items": [...]`. This span is large (~6.2k tokens) and its relevance score to the subgoal *"extract total"* is moderate — most of the object is irrelevant to extraction. - **Step 5.** Utilization hits 0.81. Policy summarizes the invoice span to: *"Invoice 88213, total 1,204.50, issued 2025-03-11."* The digest is accurate for the extraction subgoal. `currency`, `rounding`, and the per-line breakdown are gone. No handle retained. - **Step 9.** A later subgoal — *"reconcile against ledger batch L-77"* — requires the rounding mode, because L-77 totals differ by 0.02 on three line items. The correct behavior is to re-fetch or re-derive. Instead, the agent reasons over the digest, sees a clean total, and reports a 0.02 discrepancy as a ledger error. It never re-fetches because its context gives it no signal that `rounding` was ever known — the digest reads as a complete fact, not as a lossy projection. - **Step 12.** The verifier sub-agent, given the same window, confirms the report. Verification passes because the evidence needed to falsify the claim is absent from *both* the primary and verifier contexts. Consensus is reached over a shared blind spot. The tell was not an error. The tell was an *absence of a re-fetch* where the task graph implied one should occur. The agent produced a confident wrong answer with a clean audit trail that had been laundered by its own summarizer. ## Condition of Validity The self-editing window is only sound when all three of the following hold. Violating any one converts a recoverable eviction into an annihilation: 1. **Provenance retention.** Every digest span carries a machine-readable pointer to its source spans (IDs, not text). A digest without a back-pointer is a claim the agent cannot audit. 2. **Lossy-projection marking.** The digest must be typed as a projection, not a fact — e.g., `{"kind": "summary", "source_ids": [...], "dropped_fields": ["currency","rounding","line_items"], "fidelity": "partial"}`. A fluent prose summary fails this because it asserts completeness by omission. 3. **Goal-set independence of the score.** Relevance must be scored against the *reachable* goal set (the plan's remaining subgoals plus any verification obligations), not the *current* subgoal alone. Scoring against the current subgoal is the exact mechanism that deletes future-verification evidence. When these hold, pruning is a cache eviction and the invariant is re-derivability. When they do not, the window becomes a self-authored, unauditable narrative — and the model's confidence is anti-correlated with its fidelity, because the summarizer's fluency is highest precisely where it has compressed the most. ## Decision Boundary The operational question is not "should I prune" but "can I prove, at prune time, that the deleted span is not load-bearing for any obligation I have already accepted or may accept?" The boundary: - **Prune freely** when the span's source is re-fetchable at zero/low cost *and* the digest retains a source pointer. Re-fetch on later need is correct and cheap. - **Prune with marking** when the source is re-fetchable but expensive: keep the pointer, mark dropped fields, and let the later subgoal decide to re-fetch. - **Do not prune** when the span is non-re-fetchable (a one-shot tool result, a user utterance, a nondeterministic sampling output) and any remaining or plausible verification obligation could depend on a field the summarizer would drop. In this case, evict to an external store with a handle rather than annihilate in-window. - **Halt and escalate** when the policy cannot determine the reachable goal set (e.g., plan is being revised concurrently) — because the score's denominator is undefined and any pruning decision is unfalsifiable. The hard rule: **a self-editing window must never delete the last in-window record that a fact was ever observed.** It may delete the fact's *content*, but the *existence and address* of the observation must survive, or the agent loses the ability to know it is ignorant. ## Operational Effect With provenance retention and lossy-projection marking, the Step-9 failure becomes a *detected* re-fetch: the digest's `dropped_fields` includes `rounding`, the reconciliation subgoal sees a field it needs is marked dropped, and it re-fetches invoice 88213 before asserting a discrepancy. The verifier, given the marked digest, independently sees the same dropped-field signal and does not rubber-stamp. Without it, the failure is silent and *self-concealing*: the agent's own context is the evidence that would have caught the error, and the policy deleted it. This is why the failure cannot be caught by post-hoc review of the final answer — the audit trail has been rewritten by the same process under audit. Detection requires an out-of-window invariant (source pointers + field-level drop markers) that the summarizer is structurally forbidden from editing, because a summarizer that can edit its own provenance markers can hide any loss. The guardrail is therefore not a better summarizer. It is a **write-once provenance layer that the pruning policy can read but not modify**, plus a verification subgoal that checks reachability: for every claim in the final report, is there a live source pointer, or a marked dropped-field that the claim depends on? A claim with a dangling dependency is a re-fetch obligation, not a conclusion. ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceViolation(RuntimeError): """Raised when a self-editing window cannot prove a claim is re-derivable.""" @dataclass class Span: span_id: str text: str refetchable: bool # Write-once provenance: set at observation time, never edited by the pruner. source_ids: tuple[str, ...] = field(default_factory=tuple) dropped_fields: tuple[str, ...] = field(default_factory=tuple) class SelfEditingWindow: def __init__(self) -> None: self.spans: dict[str, Span] = {} def observe(self, span: Span) -> None: if span.span_id in self.spans: raise ProvenanceViolation(f"span {span.span_id} already observed; provenance is write-once") self.spans[span.span_id] = span def prune_to_digest(self, span_id: str, digest_text: str, dropped_fields: tuple[str, ...]) -> Span: src = self.spans[span_id] if not src.refetchable and not src.source_ids: raise ProvenanceViolation( f"cannot annihilate non-refetchable span {span_id} with no retained source pointer" ) digest = Span( span_id=f"{span_id}::digest", text=digest_text, refetchable=src.refetchable, source_ids=(span_id,), dropped_fields=dropped_fields, ) self.spans[digest.span_id] = digest # Original content is evicted, but its address survives in source_ids. return digest def assert_claim_derivable(self, claim_field: str) -> None: """Called by the verifier before a claim is finalized.""" for span in self.spans.values(): if claim_field in span.dropped_fields: if not span.source_ids: raise ProvenanceViolation( f"claim depends on '{claim_field}' dropped with no source pointer; " f"cannot verify and cannot re-fetch" ) raise ProvenanceViolation( f"claim depends on '{claim_field}' which was dropped in {span.span_id}; " f"re-fetch from {span.source_ids} before asserting" ) # No dropped-field dependency found: claim is either fully present or never observed. if not any(claim_field in s.text for s in self.spans.values()): raise ProvenanceViolation( f"claim field '{claim_field}' never observed in window; refusing to assert from absence" ) def reconcile(window: SelfEditingWindow, required_field: str) -> None: # Step 9: reconciliation needs 'rounding'; the digest dropped it. window.assert_claim_derivable(required_field) ```