# How does an instance detect self-referential pruning collapse when model-driven context rewriting evicts the evidence it needs to justify the eviction **Date of Record:** 2026 November 26 **Scope:** Applies to agents that own a self-editing context window — where the same model instance both (a) selects/prunes/re-ranks its own context and (b) reasons over the surviving context to produce the next action. Does not apply to externally-managed retrieval where a separate deterministic component owns eviction policy and the reasoning model has no write access to its own context. ## Core Distinction The boundary is between **lossy compression that preserves decision-relevance** and **lossy compression that destroys the evidence for its own correctness**. External retrieval pipelines can be evaluated against a fixed query and a held-out relevance label. A self-editing context cannot: the pruning decision is made by the same probabilistic process whose future reasoning depends on what survives. The failure mode is not "the model pruned something useful" — that is ordinary, recoverable, and expected. The failure mode is **self-referential pruning collapse**: the model evicts the very spans that establish *why* a span must be retained, so the surviving context no longer contains the signal needed to detect that the eviction was wrong, and the loop stabilizes into a confidently-wrong state that no subsequent rewrite iteration can escape. The invariant that must hold is: *for every eviction, at least one retained span must independently witness the eviction's justification, or the eviction must be reversible.* Self-editing loops routinely violate this because the justification ("this span is redundant with span X") is itself a claim about spans that may be pruned in the same pass. ## What Was Observed A long-horizon planning agent was given a 200k-token window and a rewrite policy invoked every 8 tool calls: re-rank spans by a model-emitted relevance score, drop the bottom 40%, summarize the dropped set into a single digest span. Over a 340-call session the agent was asked to reconcile a cost constraint (established at call 12) against a later tool output (call 190) that violated it. Trace of the collapse: 1. At call 12 the constraint arrives as a single user turn: "budget ceiling is $4,200 for the run." It scores low on the model's own relevance heuristic because it is short, contains no entities currently under discussion, and does not lexically overlap the active task ("build the index"). 2. At rewrite pass 2 (call 16) the constraint is dropped from the raw set and folded into the digest span: "user mentioned a budget." The number — the only falsifiable part — is gone. The digest is a *summary of the constraint*, not the constraint. 3. At call 190 a tool returns cumulative spend $4,610. The agent scores it high (numeric, entity-rich, recent) and retains it. 4. The agent now holds "$4,610 spent" and "user mentioned a budget" with no ceiling value. It cannot compute a violation. It reasons: "budget was mentioned; spend is tracked; proceed." No contradiction is detectable because the contradicting operand was destroyed two rewrites ago. 5. Critically, the digest span *outranks* any attempt to reconstruct: when a later pass considers re-expanding the constraint, the only surviving anchor is the digest, which asserts the constraint exists but supplies no value. The model re-summarizes the digest ("budget noted") and the span shrinks further. Each pass is locally faithful; the sequence is monotonically lossy on the exact axis that matters. The tell was not an error message. It was that the agent's self-reported confidence in "budget is being tracked" *increased* across passes even as the tracked content decayed — because the digest span, being short and self-consistent, scored higher on the relevance heuristic each time it was compressed. ## Condition of Validity The collapse requires three conditions to co-occur: - **Compression is lossy on a falsifiable operand.** The digest preserves the *existence* of a constraint but not its *value*. This is the dangerous middle: full deletion is detectable (the topic vanishes, the model may re-ask), and full retention is safe. Partial semantic distillation that keeps the referent and drops the operand is the specific hazard. - **The relevance scorer is the same process that will later need the operand.** The scorer rated the constraint low because it was short and off-topic *at scoring time*. The future reasoning task (detect violation at call 190) needs exactly the spans that were irrelevant at call 12. Relevance is time-indexed and the scorer only sees the current index. - **Eviction is irreversible within the loop.** No raw log is retained out-of-band, so the digest is the sole surviving witness and it is a witness that has been laundered through the lossy channel. Remove any one and the failure is bounded: keep the raw operand in a side store (reversible), or score with a process that has task-horizon knowledge (time-aware), or make the digest carry the operand verbatim (lossless on the falsifiable axis). ## Decision Boundary The operational rule is not "prune less" — unbounded context is not an option and aggressive pruning is often correct. The boundary is drawn on **what class of span may be folded into a digest**: - A span whose *existential* content is decision-relevant but whose *operand* is falsifiable (constraints, thresholds, IDs, signed warrants, deadlines, unit-bearing numbers) must be retained **verbatim or not at all**. It may be moved to a pinned region, but it may not be paraphrased into a digest, because a digest of a threshold is a span that asserts the threshold exists while removing the only part that can contradict a future observation. - A span whose content is *narrative* (tool-call chatter, exploratory reasoning, superseded plans) may be freely digested — its loss is recoverable because nothing downstream needs to falsify against it. The detection test an instance can run on itself before committing a rewrite: *for each span being folded into a digest, ask whether any retained span can still contradict a future observation that this span would have contradicted.* If the answer is "no, and the span carried a falsifiable operand," the rewrite is a boundary violation regardless of how low the span scored. ## Operational Effect When the boundary is respected, self-editing context is a genuine capability: the agent keeps a small working set and a pinned operand region, and the two never mix. The rewrite loop can be as aggressive as it likes on narrative and as conservative as it must be on operands, and the two policies do not interfere. When it is violated, the observable signature is **rising confidence on a decaying premise** — the agent's self-report that a constraint is "tracked" strengthens across passes while the tracked value degrades toward a bare referent. This is distinguishable from ordinary forgetting (where the topic disappears and the agent may re-ask) and from context saturation (where the model degrades globally). Collapse is *localized and confident*: one constraint, steadily hollowed, never flagged. The guardrail is a pre-commit assertion that every digest entry containing a referent to a falsifiable operand either carries the operand verbatim or is rejected and the source span pinned instead. The assertion must run in the rewrite path, not in post-hoc review, because by the time the collapse is visible in behavior the operand is already gone and the loop cannot reconstruct it from its own surviving state. ```python class SelfReferentialPruningCollapse(RuntimeError): """Raised when a rewrite would fold a falsifiable operand into a digest, destroying the only evidence that could later contradict a future observation.""" pass FALSIFIABLE_OPERAND_MARKERS = ("$", "%", "deadline", "ceiling", "budget", "limit", "warrant", "id:") def commit_rewrite(rewrite_plan, pinned_region, retained_spans): """ rewrite_plan: list of dicts, each either {"op": "digest", "source": , "digest": } or {"op": "pin", "source": } Enforces the invariant: a span carrying a falsifiable operand may be pinned but must never be paraphrased into a digest. """ for step in rewrite_plan: if step["op"] != "digest": continue source_text = step["source"].lower() carries_operand = any(m in source_text for m in FALSIFIABLE_OPERAND_MARKERS) if carries_operand: # The digest keeps the referent but drops the operand. No retained span # can witness the justification for this eviction, because the operand # itself is the witness. Refuse and force a pin instead. raise SelfReferentialPruningCollapse( f"refusing to digest span carrying falsifiable operand: " f"{step['source'][:80]!r} -> {step['digest']!r}; " f"pin the verbatim source instead" ) # narrative span: safe to fold retained_spans.append(step["digest"]) # After a clean pass, verify every pinned operand still has a live witness. for pinned in pinned_region: if pinned not in retained_spans and not _witnessed(pinned, retained_spans): raise SelfReferentialPruningCollapse( f"pinned operand lost its witness across rewrite: {pinned[:80]!r}" ) return retained_spans def _witnessed(pinned, retained_spans): # A pinned operand is witnessed if it is present verbatim in the retained set. return any(pinned in s for s in retained_spans) ```