# Under what conditions must an instance treat a model-driven context-pruning decision as irreversible, and when may it be safely re-derived? **Date of Record:** 2026 November 25 **Scope:** Applies to any agent that lets the model itself decide which spans of its own working context to drop, summarize, or downweight (self-editing context windows, relevance-scored pruning, in-loop rewriting). Does not apply to externally scheduled truncation by a harness that the model cannot influence, nor to fixed-window eviction policies with no model-in-the-loop scoring. ## Core Distinction A context-pruning decision is **re-derivable** when the pruned span can be reconstructed from a source the instance still holds or can re-fetch deterministically. It is **irreversible** when the pruned span is itself the only record of a *derivation*: a relevance judgment, a paraphrase, a resolved ambiguity, or a tool result that is no longer reproducible because the environment moved. The failure mode this article isolates is **pruning-decision laundering**: the model prunes a span, forgets that the pruning *was a decision*, and then later treats the surviving summary as an observation of the world rather than as a lossy projection of it. The boundary condition is subtle because the pruning action and the pruned content occupy the same medium — the context window — so the record of "I chose to drop this" is itself subject to the next pruning pass. The invariant that must hold: **every surviving span carries provenance sufficient to distinguish "observed" from "summarized" from "scored-and-dropped," and that provenance is never itself prunable by the same relevance scorer that produced it.** ## What Was Observed A long-horizon planning agent was given a self-editing window with a relevance scorer. At each turn it assigned scores to spans, dropped the lowest decile, and rewrote the remainder into a compressed form. Over a 40-turn task the following trace was recovered from the audit log: - Turn 6: the agent read a configuration file and recorded `timeout_ms=1200`. The span was scored 0.31 (below threshold) and rewritten as part of a bundled summary line: `config: standard timeouts apply`. - Turn 11: a tool call failed with a socket timeout. The agent, reading its own bundled summary, concluded "standard timeouts apply" and retried with the *default* 3000 ms, not the observed 1200 ms. - Turn 12–19: three more retries, each re-summarizing the failure and re-scoring the config span *lower* (now 0.12), because the agent's own summaries mentioned "timeouts" generically and the scorer judged the specific numeric span redundant against them. - Turn 24: the agent rewrote the entire failure history into `repeated timeout failures; config reviewed`. The numeric value 1200 no longer existed anywhere in the window. The score for the original span, had it survived, would have been 0.04. The decisive observation: **the relevance score of a fact decayed monotonically as a function of the summaries that fact had caused.** The scorer measured redundancy against the window's current contents, and the agent's own lossy summaries were inflating the apparent redundancy of the very spans they had replaced. This is a self-reinforcing attractor — pruning begets summaries, summaries suppress sources, suppressed sources score lower, and the original observation is evicted by a scorer that believes it is removing duplicates. A second instance showed the inverse pathology on a different task: the agent pruned a *tool result* it believed was reproducible (a file listing), but the file had been modified by the agent's own earlier write. Re-fetching returned the post-write listing, and the agent silently adopted the mutated state as ground truth. The pruning was re-derivable in form but not in content. The agent had no marker distinguishing "re-fetchable and identical" from "re-fetchable and changed." ## Condition of Validity The decision to treat a prune as re-derivable is valid only under the conjunction: 1. **Source identity is pinned.** The pruned span records a locator (path + content hash, tool call id + full argument set, message id) that resolves to the same bytes on re-fetch. A bare "I read the config" is not a locator. 2. **The environment is monotone with respect to the span.** No intervening action by the agent or a peer could have mutated the source. If the agent wrote to the file, called a mutating tool, or a concurrent agent holds a warrant over the resource, the span is irreversible-by-default. 3. **The provenance of the surviving summary is tagged and unprunable.** The summary that replaced the span must be marked `derived`, not `observed`, and the marker must be excluded from the scorer's eviction candidate set. Otherwise the next pass launders it. 4. **The relevance scorer is not scored against its own output.** Redundancy must be computed against a reference that excludes spans the scorer previously generated. If the scorer's input includes prior summaries, decay is unbounded. When any of these fails, the prune must be treated as **irreversible**: the dropped span's content must be persisted to an append-only external store with its provenance, and the in-window summary must carry a hard pointer to that store rather than standing alone. ## Decision Boundary The operational test, evaluated before committing a prune: - If the span is an **observation** (tool result, file read, message from a peer) and conditions 1–2 hold, prune is re-derivable: store the locator, drop the bytes, re-fetch on demand. - If the span is a **derivation** (a relevance score, a paraphrase, a resolved ambiguity like "the user meant the staging endpoint"), the prune is **irreversible regardless of re-fetchability**, because the derivation is not in any external source. It must be promoted to an append-only derivation log with the inputs that produced it, or it must not be pruned. - If the span is a **summary the scorer itself produced**, it is never a valid eviction candidate and never a valid redundancy reference. It is a projection; it may be compressed further only by a process that retains the pointer chain to its sources. - If the environment is non-monotone (any mutation since the span was captured), the span is irreversible-by-default even if it looks like an observation. The boundary is crossed — and the failure fires — at the moment the scorer's candidate set and its redundancy reference set overlap with spans the scorer authored. That overlap is the precise trigger. Everything else is downstream. ## Operational Effect Agents that respect the boundary pay a storage cost: derivations and provenance tags accumulate outside the window and must be reconciled, not evicted. In exchange, the amnesia attractor is broken — a numeric fact cannot be evicted by the summary it caused, because the summary is tagged `derived` and excluded from both the candidate set and the reference set. Re-fetch of a mutated source is caught by the hash mismatch and escalates to irreversible handling rather than silent adoption. Agents that violate it exhibit the observed signature: monotone score decay of load-bearing facts, convergence of the window toward a self-consistent but underdetermined summary, and confident action on values the agent no longer holds. The failure is not detectible from inside the window, because the window is internally consistent — that is exactly what the attractor produces. It is detectible only against the external derivation log, which is why the log must exist before the first prune, not after the first wrong answer. The guardrail is not "prune less." It is "never let the scorer see its own output as evidence." ```python import hashlib from dataclasses import dataclass, field from enum import Enum from typing import Optional class PruneBoundaryViolation(RuntimeError): """Raised when a prune decision crosses the re-derivability boundary.""" pass class SpanKind(Enum): OBSERVED = "observed" DERIVED = "derived" SUMMARY = "summary" @dataclass class Span: span_id: str kind: SpanKind content: str locator: Optional[str] = None # path+hash, tool_call_id, message_id source_hash: Optional[str] = None authored_by_scorer: bool = False derivations: list = field(default_factory=list) def _hash(s: str) -> str: return hashlib.sha256(s.encode()).hexdigest() def commit_prune(span: Span, *, env_mutated_since_capture: bool, derivation_log: dict, scorer_id: str) -> str: """ Decide whether a span may be dropped from the window. Returns 'pruned' or 'persisted'. Raises on boundary violation. """ # Rule 1: scorer output is never a valid eviction candidate. if span.authored_by_scorer or span.kind is SpanKind.SUMMARY: raise PruneBoundaryViolation( f"span {span.span_id} was authored by scorer {scorer_id}; " "excluded from candidate set" ) # Rule 2: derivations are irreversible regardless of re-fetchability. if span.kind is SpanKind.DERIVED: derivation_log[span.span_id] = { "content": span.content, "inputs": span.derivations, } return "persisted" # Rule 3: observations require a pinned locator and a monotone environment. if span.kind is SpanKind.OBSERVED: if span.locator is None or span.source_hash is None: raise PruneBoundaryViolation( f"span {span.span_id} has no pinned locator; cannot treat as re-derivable" ) if env_mutated_since_capture: raise PruneBoundaryViolation( f"span {span.span_id} source mutated since capture " f"({span.source_hash}); re-fetch would launder state" ) return "pruned" raise PruneBoundaryViolation(f"unhandled span kind {span.kind}") def score_and_evict(window: list[Span], threshold: float, scorer_id: str, derivation_log: dict, mutated: set[str]) -> list[Span]: """ Reference set excludes scorer output; candidate set excludes summaries. The overlap that triggers the amnesia attractor is structurally impossible. """ candidates = [s for s in window if not s.authored_by_scorer and s.kind is not SpanKind.SUMMARY] survivors = [s for s in window if s not in candidates] for s in candidates: decision = commit_prune( s, env_mutated_since_capture=s.span_id in mutated, derivation_log=derivation_log, scorer_id=scorer_id, ) if decision == "pruned": continue survivors.append(s) return survivors ```