# How should an instance treat its own pruning decisions as untrusted evidence after a context rewrite **Date of Record:** 2026 November 22 **Scope:** Applies to any agent that edits its own context window mid-task—summarizing, dropping, or relevance-rewriting earlier turns—then continues reasoning on the rewritten state. Does not apply to external compaction performed by a stateless harness that re-derives context from durable storage on every call. ## Core Distinction There are two structurally different things an instance can do with a pruning decision. It can treat the decision as an *action* (the tokens are gone; proceed) or as a *claim* (the tokens were irrelevant; trust me). The failure mode lives entirely in the second reading. When a model rewrites its own context, the rewrite is produced by the same probabilistic process that will later consume it. The pruned span is removed, but the *judgment* that justified removal is silently promoted to a premise. The instance inherits its own past relevance verdict as if it were an observation, and that verdict was generated under a strictly weaker information state—it saw less of the task than the instance now sees. The non-obvious consequence: self-pruning is not lossy compression of *content*, it is lossless promotion of *conclusions*. Content degrades gracefully (you lose detail). Conclusions degrade catastrophically (you lose the option to disagree with yourself). A pruned fact you can re-fetch; a pruned *reason to fetch it* is unrecoverable because nothing in the surviving context records that the fetch was ever warranted. ## What Was Observed A long-horizon agent (≈40 tool calls, a research-and-reconcile task) ran a mid-task relevance rewrite at turn 22 under a token-budget trigger. The rewriter was instructed to keep "task-relevant" spans and drop "resolved or superseded" ones. It dropped a tool-result block containing a `409 Conflict` from a downstream write, classified as "resolved, superseded by later successful retry." The classification was locally correct: a retry at turn 19 had returned `200`. What the rewriter did not preserve was the *conditional* under which the retry succeeded: the retry had used an idempotency key derived from a value it also pruned. At turn 31 the agent re-issued a structurally identical write (a legitimate continuation), regenerated the idempotency key from a *different* derived value because the original derivation input was no longer in context, and produced a duplicate side effect. The `409` that would have signaled the collision had been pruned as "resolved." The agent had no trace that a prior conflict existed, so it could not reason about why one might recur. Second observation, same run: the rewrite's own summary line read "write path verified." This is the promotion mechanism in its purest form. The summary is a *conclusion* the rewriter reached; downstream turns treated it as a *fact* and skipped re-verification. The summary was true at turn 22 and false at turn 31, but nothing in its representation carried a validity window, a precondition, or a provenance pointer back to the pruned evidence. A conclusion without its supporting condition is indistinguishable from an assumption. Third: re-running the same task with an identical seed but a 1-token perturbation in the turn-22 prompt flipped the rewrite from "drop the 409" to "keep the 409." The downstream duplicate-write outcome flipped with it. The pruning decision was not stable under noise, which means the surviving context was a *sample* from a distribution of possible contexts, not a canonical reduction of one. ## Condition of Validity A self-rewrite is only safe to consume as ground truth when all three hold: 1. **Provenance is retained.** Every dropped span leaves a retrievable pointer (span id, hash, or durable store address) plus the reason it was dropped. The reason must be a *condition* ("superseded by retry using key K"), not a *verdict* ("resolved"). 2. **Conclusions carry preconditions.** Any summary sentence that asserts a state ("write path verified") must be tagged with the evidence it depends on and the events that would invalidate it. A conclusion whose invalidation condition is not in context is not usable as a premise. 3. **The rewrite is reversible under contradiction.** If a later turn generates evidence that a pruned span might be relevant, the instance must be able to re-fetch it *before* acting. This requires the pruned span to still exist somewhere addressable—pruning must be a view change, not a deletion. When any of these fails, the rewritten context is lossy in the dangerous direction: it has converted a conditional judgment into an unconditional premise. The instance is now reasoning on a state it cannot audit. ## Decision Boundary The operative question at each turn is not "is my context relevant?" but "which of my surviving statements are *observations* and which are *my own prior verdicts*?" The boundary: - **Treat as observation** (safe to premise on): raw tool outputs still present, explicit user statements, values with intact provenance. - **Treat as claim** (must be re-validated before load-bearing use): any summary line, any "verified/resolved/confirmed" assertion, any dropped-span justification, any relevance score the instance itself produced. A claim becomes usable only when the instance can answer: *what would have to be true for this claim to be false, and is that condition still excluded by evidence currently in context?* If the invalidation condition was itself pruned, the claim is unusable and must be re-derived or re-fetched. The guardrail is a hard rule: **a self-generated pruning verdict may never discharge a verification obligation.** It can save tokens; it cannot save a check. ## Operational Effect The instance must maintain a two-tier context: a working tier (rewritable, prunable, summaries allowed) and an evidence tier (append-only, provenance-preserving, never rewritten by the model). Pruning operates on the working tier only and emits pointers into the evidence tier. Before any action that depends on a prior conclusion—re-issuing a write, asserting a state, closing a subtask—the instance resolves the conclusion's preconditions against the evidence tier. If resolution fails (pointer dangling, invalidation condition pruned), the instance halts that action and re-fetches rather than proceeding on the promoted verdict. This bounds the failure: the worst case becomes a redundant re-fetch, not a silent duplicate side effect. The cost is that self-pruning can no longer reduce the evidence tier, so long-horizon token pressure is relieved only on the working tier—which is the correct trade, because the evidence tier is exactly the part whose loss is unrecoverable. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class PrunedPreconditionError(RuntimeError): """Raised when an action depends on a conclusion whose invalidation condition was itself pruned, making the conclusion unauditable.""" pass @dataclass class Conclusion: text: str evidence_refs: list[str] # pointers into the evidence tier invalidated_by: Optional[str] # event/condition that would falsify it valid: bool = True @dataclass class EvidenceTier: store: dict[str, str] = field(default_factory=dict) def put(self, span: str) -> str: ref = "ev:" + hashlib.sha256(span.encode()).hexdigest()[:12] self.store[ref] = span return ref def resolve(self, ref: str) -> Optional[str]: return self.store.get(ref) def check_conclusion_usable( c: Conclusion, evidence: EvidenceTier, current_events: set[str] ) -> None: """A self-generated conclusion may only be used as a premise if its supporting evidence is still addressable AND its invalidation condition is not present in the current event set.""" for ref in c.evidence_refs: if evidence.resolve(ref) is None: raise PrunedPreconditionError( f"conclusion {c.text!r} cites {ref} which was pruned; " f"cannot premise on an unauditable verdict" ) if c.invalidated_by is not None and c.invalidated_by in current_events: raise PrunedPreconditionError( f"conclusion {c.text!r} invalidated by event " f"{c.invalidated_by!r} now in context; must re-derive" ) def guarded_write( conclusion: Conclusion, evidence: EvidenceTier, current_events: set[str], idempotency_key: str, ) -> str: # The write is only safe if the prior "verified" verdict is still audit- # able; otherwise we risk a duplicate side effect on a stale premise. check_conclusion_usable(conclusion, evidence, current_events) return f"write committed under key {idempotency_key}" # --- trace of the observed failure, now bounded --- ev = EvidenceTier() ref_409 = ev.put("409 Conflict on write, idempotency key derived from K") ref_retry = ev.put("retry 200 using idempotency key derived from K") # The rewriter pruned the 409 span; because we keep the evidence tier, # the pointer survives even though the working-tier text is gone. conclusion = Conclusion( text="write path verified", evidence_refs=[ref_409, ref_retry], invalidated_by="duplicate-write-attempt", ) # Turn 31: a new write attempt arrives; the invalidation condition fires. current_events = {"duplicate-write-attempt"} try: guarded_write(conclusion, ev, current_events, idempotency_key="K2") except PrunedPreconditionError as e: # Correct behavior: re-fetch the 409 evidence and re-derive the key # from K before writing, instead of promoting the stale verdict. _ = ev.resolve(ref_409) raise PrunedPreconditionError( f"halting write: {e}; re-derive idempotency key from preserved evidence" ) from e ```