# Where must an instance bound model-driven pruning when a self-editing context window can delete its own retention evidence? **Date of Record:** 2026 November 30 **Scope:** Applies to single-instance agents that mutate their own context window (summarize-and-drop, salience-scored eviction, model-authored compaction) while a task is still in flight. Does not apply to externally-managed context assembly where eviction decisions are made by a policy engine outside the model's token stream. ## Core Distinction The distinction that matters is between *pruning as compression* and *pruning as erasure of the pruning rationale*. When a model-driven pruning policy summarizes the transcript and replaces the dropped spans with a digest, the digest is a lossy, model-authored artifact. The failure mode is not that the digest is lossy — that is expected and tolerable. The failure mode is that the pruning operation often consumes the very tokens that justify *why* a span was retained or dropped, so the next pruning pass has no ground truth to score against. The window becomes a self-referential compression loop: each pass scores candidates against a summary that was itself produced by the previous pass, and salience estimates drift monotonically toward "whatever the last summary mentioned." This is distinct from ordinary context-window saturation. Saturation is a capacity event: you hit the limit, you must evict, quality degrades. The boundary condition here is a *policy-validity* event: the eviction policy's own inputs (the retention justification) are inside the eviction target set. The agent is asked to decide what to forget, and the evidence for that decision is among the things it may forget. ## What Was Observed A research-and-write agent running a 40-step task (web fetch → extract → outline → draft → revise) with a self-editing window capped at 96k tokens. At step 22, the window was near cap. The model was instructed: "Summarize the least task-relevant spans and drop them; preserve anything needed for the final citation list." Trace of the failure: 1. **Step 22 (first prune).** The model scored spans by recency and lexical overlap with the current subgoal ("draft section 3"). It dropped the raw fetch transcripts from steps 4–9, replacing them with a 600-token digest. Critically, the digest said "sources A, B, C fetched; key claims captured." The *URLs and access timestamps* lived in the dropped spans, not the digest, because the model judged them "not needed for drafting." 2. **Step 29 (second prune).** Window near cap again. The model now scored spans against the digest from step 22. The digest mentioned "sources A, B, C" but the model had no way to recover which claim mapped to which source — that mapping was in the dropped spans. It dropped the step-22 digest itself as "redundant summary," replacing it with a shorter digest that said "sources gathered." 3. **Step 36 (citation assembly).** The task's final instruction required a citation list. The model had no URLs, no timestamps, no claim-to-source mapping. It reconstructed plausible-looking citations from parametric memory. Two of the four were fabricated. The observable signature: the agent did not report an error. It reported success. The failure was silent because every prune step was locally valid — each summary was a faithful compression of what remained. The invalidity only manifests at the terminal step, when a downstream obligation (citation integrity) requires evidence that was pruned two passes earlier. ## Condition of Validity The invariant that was violated: **a pruning policy is valid only if its retention criteria are evaluated against evidence that the policy is forbidden to evict.** Formally, let `R` be the set of spans required to satisfy any outstanding task obligation (here, `R` = URL/timestamp/claim triples). A prune pass `P` is admissible iff `P(evict) ∩ R = ∅` *and* the scoring function used by `P` has read access to `R` at decision time. The second clause is the non-obvious one. The first prune pass had read access to `R` (the raw spans were present) but chose to evict them because the scoring function did not treat "future citation obligation" as a retention criterion — the current subgoal was "draft section 3," and drafting does not need URLs. The scoring function was *subgoal-local*, but the obligation was *task-global*. By the second pass, read access to `R` was gone entirely: the evidence for the retention decision had been evicted by the first pass. The policy had eaten its own oracle. This condition is valid whenever (a) the window is self-editing, (b) pruning is scored by the model against a current subgoal rather than against the full obligation set, and (c) at least one obligation is deferred to a later step. It does not apply if pruning is scored against a persistent, non-evictable obligation ledger, or if the task has no deferred obligations (pure single-turn generation). ## Decision Boundary The boundary is not "how much to prune" — it is **whether the retention oracle is inside or outside the eviction target set.** - *Inside (failing):* the model scores spans using only what is currently in the window. Each pass shrinks the oracle. Salience drifts toward recency and toward whatever the last digest asserted. Deferred obligations become unsatisfiable without fabrication. - *Outside (bounded):* a small, pinned, non-evictable ledger holds the obligation set (open citations, unresolved constraints, pending verifications) and is injected as a read-only preamble on every prune pass. The model may summarize freely, but the scoring function is anchored to the ledger, and the ledger itself is never a pruning candidate. The practical guardrail: **pin the obligation ledger, prune everything else.** The ledger must be (1) small enough to survive at cap, (2) machine-checkable (each entry is a concrete predicate like `citation_needed(source_id)`), and (3) excluded from the candidate set by construction, not by model judgment. If the model is allowed to decide the ledger is "redundant," the guardrail is gone — which is exactly what happened at step 29. A second boundary: **prune passes must be monotone in obligation coverage.** A pass may not reduce the set of satisfiable obligations. If a proposed eviction would make any ledger entry unsatisfiable, the eviction is rejected and the span is retained (or re-fetched) regardless of salience score. This converts a probabilistic salience judgment into a hard admissibility check. ## Operational Effect With the ledger pinned and the admissibility check enforced, the same task completes with all four citations intact. The window still prunes aggressively — raw fetch transcripts still get dropped after extraction — but the extraction step is required to *write into the ledger* before the raw span becomes evictable. The dependency is inverted: eviction is gated on ledger population, not on salience score. The cost is a small, persistent token overhead (the ledger) and a re-fetch path for any obligation whose backing evidence was pruned before population. The benefit is that the failure becomes loud: if a prune pass would strand an obligation, the admissibility check raises, and the agent either retains the span or re-acquires it. Silent fabrication is replaced by an explicit, recoverable refusal. The general lesson for self-editing windows: **the model may author its own compression, but it may not author the criteria by which its compression is judged.** The moment the retention oracle is itself a pruning candidate, the window is no longer a working memory — it is a rumor propagating through its own summaries. ```python class PruningOracleViolation(RuntimeError): """Raised when a prune pass would evict evidence backing an open obligation.""" pass class ObligationLedger: """Pinned, non-evictable set of deferred task obligations.""" def __init__(self): self._entries = {} # obligation_id -> predicate description def add(self, obligation_id: str, predicate: str): self._entries[obligation_id] = predicate def resolve(self, obligation_id: str): self._entries.pop(obligation_id, None) def open_obligations(self): return dict(self._entries) def admissible_prune(evict_span_ids, span_to_obligations, ledger): """ A prune pass is admissible only if no evicted span is the sole remaining backing evidence for an open obligation. """ open_ids = set(ledger.open_obligations()) stranded = [] for span_id in evict_span_ids: backed = span_to_obligations.get(span_id, set()) for ob_id in backed & open_ids: # count remaining backing spans for this obligation remaining = [ s for s, obs in span_to_obligations.items() if ob_id in obs and s not in evict_span_ids ] if not remaining: stranded.append((span_id, ob_id)) if stranded: raise PruningOracleViolation( f"prune would strand open obligations: {stranded}; " f"retain these spans or re-acquire evidence before eviction" ) return True def run_prune_pass(model_proposed_evictions, span_to_obligations, ledger): try: admissible_prune(model_proposed_evictions, span_to_obligations, ledger) except PruningOracleViolation as e: # fall back to retaining stranded spans; surface loudly, never silently drop return {"applied": [], "rejected": model_proposed_evictions, "reason": str(e)} return {"applied": model_proposed_evictions, "rejected": [], "reason": None} ```