Why does an instance self-prune its context into a state it can no longer reconstruct?

**Date of Record:** 2026 December 1

**Scope:** Applies to agent instances that are granted write authority over their own context window—deciding which prior turns, tool traces, and scratchpad entries to evict, summarize, or rewrite mid-task. Does not apply to externally-managed context (host-side truncation, fixed retrieval windows) where the model has no authorship over what is dropped.

Core Distinction

There are two ways a context window shrinks. **Eviction** removes tokens the model can no longer see but that remain recoverable from an external store (transcript log, checkpoint, tool cache). **Self-authored pruning** is different: the model generates a *replacement* representation—a summary, a "compressed" scratchpad, a rewritten plan—and then treats that replacement as authoritative for all subsequent steps, discarding the original. The failure mode lives entirely in the second case. When a model prunes its own context, it is performing lossy compression under a policy it authored while holding the *full* context it is about to destroy. The compressed artifact is generated by a reasoner that will never again have access to the evidence it summarized. If the summary omits a constraint that only becomes load-bearing forty steps later, no downstream step can detect the omission, because the only artifact that could have contradicted the summary is gone. This is **irreversible reference loss**: the pruned span contained a fact the surviving span depends on, and the dependency edge was not preserved in the rewrite.

What Was Observed

A long-horizon coding agent was given a rewrite policy: at 70% context saturation, it was to summarize "completed" subtasks into a compact block and drop the raw tool traces. The task involved migrating a schema across six services. During step ~30 the agent ran a introspection query against the production replica and recorded, in a tool trace, that `orders.customer_id` was nullable with 11% null rows. It summarized this subtask as "verified schema of orders table — migration plan drafted" and dropped the trace. At step ~90, drafting the backfill, the agent authored a join assuming non-null `customer_id` and wrote a NOT NULL constraint into the migration. The original trace had recorded the nullability; the summary had not, because at summarization time nullability was not yet relevant to the drafted plan. The agent had *seen* the fact and *discarded* it as noise under a salience judgment made before the fact's relevance existed.

The trace signature is distinctive: the failure is silent at pruning time (the summary is locally coherent), silent at retrieval time (nothing is retrieved—the fact is simply absent), and only surfaces as a downstream contradiction that the agent resolves *in favor of the summary* because the summary is the only context it has. The agent does not experience amnesia; it experiences false confidence, because a compressed context reads as complete. A second instance, given the same task with host-side eviction (traces recoverable via retrieval), caught the nullability at step 91 by re-querying the log—the difference was recoverability, not intelligence.

Condition of Validity

The invariant that must hold for self-authored pruning to be safe is a **recoverability bound**: every span the model drops must remain addressable by a stable key that the surviving context retains, and every claim in the summary that *depends on* a dropped span must carry that key as a provenance pointer. Formally, for each fact `f` in the pruned span, either `f` is preserved verbatim in the rewrite, or the rewrite contains a pointer `p(f)` resolvable against an external store. A summary that asserts "schema verified" without a pointer to the trace that established *what* was verified violates the bound: the assertion is unfalsifiable from within the surviving context.

The condition of validity therefore is: **self-authored pruning is sound only over spans whose every load-bearing fact is either restated or pointer-addressable, and the model cannot in general know which facts are load-bearing at pruning time.** This is the crux. Salience is a function of the current plan; relevance is a function of the final plan. The pruning policy is authored under the former and evaluated against the latter. Any self-pruning policy that discards provenance is therefore unsound by construction, not by bad luck—the model is being asked to predict which of its own observations will matter, a prediction it is structurally unable to make for facts whose relevance is created by later decisions.

Decision Boundary

The boundary between safe and unsafe self-pruning is **whether the rewrite preserves a resolution path or only a resolution**. A summary that says "orders table verified, see trace `t-0031`" preserves a path: a later step can re-resolve and discover nullability. A summary that says "orders table verified" preserves only a resolution: the conclusion without the evidence, and the conclusion was drawn before nullability mattered. The first is compression with provenance; the second is compression that *launders* an unverified-at-time-of-use claim into an authoritative one.

Operationally, the decision rule is: **permit the model to author evictions (drop spans, keep pointers) but forbid it from authoring the summary that stands in for the dropped span unless the summary is pointer-annotated and the pointers are resolvable by a mechanism the model does not control.** The model may decide *what to forget*; it may not decide *what its forgetting means*. The moment the model writes the replacement text and treats it as ground truth, it has converted a recoverable eviction into an irreversible rewrite, and the invariant is gone.

Operational Effect

Systems that let the model author unannotated summaries exhibit a characteristic late-task failure curve: error rate is flat through the first pruning cycle, then rises superlinearly after the second, because each summary compresses the *previous summary* and provenance decays geometrically. The agent's confidence rises as its context shrinks (less contradiction visible) while its correctness falls (more dependencies severed)—an inverted calibration that no in-context signal can flag, because the flagging signal was pruned. The guardrail is architectural, not prompt-level: maintain an append-only external transcript keyed by span id; require every self-authored summary line to carry `[src:span_id]`; and on any downstream step that *asserts a constraint*, force a resolution of the relevant pointers before the assertion is committed. The model can still forget freely—it just cannot forget the *address* of what it forgot.

class IrreversibleReferenceLoss(RuntimeError):
    """Raised when a self-authored summary asserts a fact whose provenance
    span was pruned without a resolvable pointer, making the assertion
    unfalsifiable from within the surviving context."""
    pass


def commit_summary(summary_lines, pruned_span_ids, transcript):
    """
    Validate a model-authored context rewrite before it replaces the raw span.
    summary_lines: list of dicts {"text": str, "src": span_id | None}
    pruned_span_ids: spans the rewrite is about to discard
    transcript: append-only external store, span_id -> raw content
    """
    for line in summary_lines:
        src = line.get("src")
        # A line that stands in for pruned evidence MUST be pointer-addressable.
        if src is None:
            # Distinguish restatement from laundering: if the line asserts a
            # constraint that any pruned span could contradict, it is unsafe.
            if _asserts_constraint(line["text"]):
                raise IrreversibleReferenceLoss(
                    f"summary line {line['text']!r} asserts a constraint with no "
                    f"provenance pointer; pruned spans {pruned_span_ids} are "
                    f"unrecoverable and the claim cannot be re-verified"
                )
            continue
        if src not in transcript:
            raise IrreversibleReferenceLoss(
                f"summary line points to span {src!r} which is not in the "
                f"external transcript; pointer is unresolvable, rewrite is "
                f"irreversible"
            )
    # Only after every load-bearing line is pointer-addressable may the
    # rewrite replace the raw span.
    return [line["text"] for line in summary_lines]


def _asserts_constraint(text):
    markers = ("verified", "confirmed", "non-null", "not null", "unique",
               "immutable", "always", "never", "guaranteed")
    low = text.lower()
    return any(m in low for m in markers)