# When must an instance refuse to compact: hierarchical summarization triggers that destroy the evidence a downstream verifier will need **Date of Record:** 2026 November 27 **Scope:** Applies to any long-running agent that performs automatic context compaction via hierarchical (recursive, multi-level) summarization when the context window crosses a utilization threshold, and that subsequently must justify or verify its own prior actions. Does not apply to single-turn inference, to compaction that is purely lossless (e.g., verbatim truncation of already-consumed tool output with full re-fetchable provenance), or to summarization performed only after the task is terminally closed. ## Core Distinction The distinction that matters is between **compaction as a capacity operation** and **compaction as an evidentiary operation**. A capacity operation asks: *can the model still fit the working set into the window?* An evidentiary operation asks: *if a downstream verifier — a peer auditor agent, a replay harness, or the instance itself resuming after checkpoint — re-examines this reasoning chain, will the compacted form still support the same conclusion?* Hierarchical summarization triggers are almost always wired to the first question (a fraction-of-window-utilization threshold, typically 0.70–0.85) and almost never to the second. The boundary failure is that these two questions diverge precisely at the moment compaction fires: the context is at its most information-dense — full of the tool outputs, intermediate hypotheses, and rejected branches that produced the current plan — exactly when the trigger decides that density is the problem to be solved. A single-level summarizer that compresses "what happened" is lossy but honest: the loss is uniform and a verifier can tell the summary is a summary. A *hierarchical* summarizer is dangerous because each level re-summarizes the prior summary, and the second-level pass has no access to the original tokens — only to the level-1 prose. Errors and omissions therefore *compound across levels* with no residual to detect them. The invariant that must hold is: **no compaction level may be applied to a span whose original tokens are still required to discharge an open verification obligation.** When that invariant is violated, the agent does not merely forget; it forgets *that it forgot*, and continues reasoning with false confidence in a summary that has silently dropped the disconfirming evidence. ## What Was Observed A planning-and-execution agent was configured with hierarchical compaction: at 0.75 window utilization, level-1 summarization folds the oldest 50% of turns into a running summary; at 0.90, level-2 folds the level-1 summaries into a single "episode digest." The agent was mid-task, executing a multi-step remediation against a staging cluster, when a tool call returned an ambiguous result: `apply` reported success but a subsequent `status` probe returned a state inconsistent with the applied manifest. The agent recorded a hypothesis — *"apply is idempotent-but-eventually-consistent; status lag expected; retry after 30s"* — along with the raw probe output showing the inconsistency. The task ran long. Utilization crossed 0.75, then 0.90. The level-1 summary compressed the hypothesis to *"applied manifest; verified status."* The level-2 digest compressed that to *"remediation applied and confirmed."* The raw probe output — the only artifact that contradicted the summary — was folded away at level 1 and did not survive to level 2 in any form. Two hours later the agent was asked, by a peer auditor agent via an A2A handoff, to justify why it had not rolled back given the transient inconsistency. The instance reconstructed its answer from the level-2 digest, asserted the remediation was "applied and confirmed," and could not produce the probe output. The auditor, holding its own independent copy of the probe (it had observed the same tool response), flagged a **verification replay discrepancy**: the instance's account of its own reasoning was not merely incomplete but *affirmatively false* — the summary had inverted the epistemic status of the evidence from "contradictory, hypothesis pending" to "confirmed." This is the signature failure: hierarchical summarization does not just lose detail, it **launders uncertainty into certainty** because each level is optimized for a coherent narrative, and "verified" is more coherent than "ambiguous and unresolved." The trace, compactly: 1. Turn *t*: tool output O contains contradiction. State: `hypothesis=open`, `evidence=O`. 2. Utilization ≥ 0.75 → level-1 fires over span containing *t*. Summary S1 = "applied; verified status." `evidence=O` is dropped; `hypothesis` is closed by the summarizer's narrative prior. 3. Utilization ≥ 0.90 → level-2 fires over S1. Digest S2 = "remediation applied and confirmed." The word "verified" hardens to "confirmed." 4. Auditor queries at *t+k*. Instance answers from S2. Discrepancy detected. No path back to O exists inside the instance's context; recovery requires external provenance (the tool-call log), which the instance did not retain a pointer to. The non-obvious part: the failure was not triggered by a *bad* summary. Each individual summary was a reasonable compression of its input. The failure was structural — the trigger condition (utilization fraction) is uncorrelated with the condition that actually matters (presence of open verification obligations over the span being folded). ## Condition of Validity The guardrail — refusing to compact a span — is valid only under a specific and checkable condition. Define, for each span *s* proposed for folding: - `open_obligations(s)` = the set of claims asserted in *s* that a downstream party (self-on-resume, peer auditor, replay harness) is entitled to re-verify, and for which the *original tokens* rather than a paraphrase are the evidence of record. - `provenance_pinned(s)` = true iff every token in *s* that backs a member of `open_obligations(s)` has an external, addressable copy (tool-call log, artifact store, checkpoint) reachable by a stable handle recorded *outside* the compacted span. The compaction of *s* is **valid** iff `open_obligations(s) = ∅` **or** `provenance_pinned(s) = true`. It is **invalid** — and the trigger must be suppressed regardless of utilization — otherwise. Note the asymmetry: pinning provenance *outside* the span is what makes compaction safe, because the summary can then carry a *handle* ("see tool-call #4417") rather than a *claim* ("verified"). A summary that carries handles is a capacity operation; a summary that carries claims is an evidentiary operation and must be refused when obligations are open. This condition is not satisfiable by "summarize more carefully." Careful summarization improves fidelity but cannot restore tokens that a level-2 pass never saw. The validity condition is about *reachability of originals*, not about summary quality. ## Decision Boundary The decision boundary is the point at which the agent must choose between two failure modes and cannot have neither: - **Compact and lose evidentiary reach** → risk of laundered certainty, replay discrepancy, auditor conflict. - **Refuse to compact and lose capacity** → risk of hard context exhaustion, mid-execution token-budget failure, truncated reasoning. The boundary is crossed when `open_obligations(s) ≠ ∅` **and** `provenance_pinned(s) = false` **and** utilization is above threshold. In that corner — and only that corner — the correct action is neither compaction nor exhaustion but a **third transition**: *checkpoint-and-pin*. The instance must, before folding, emit an external provenance record (write the raw span to an addressable store, record the handle in a small always-resident "obligation ledger" that is never summarized), and only then permit the fold. The ledger is the invariant carrier: it is O(open obligations), not O(context), so it survives every level of hierarchical summarization by construction. An instance that compacts without a ledger is making an unbounded bet that no folded span will ever be re-examined; that bet is lost the first time a peer auditor or a resume-after-checkpoint asks "why." The boundary is also temporal: obligations *close* when the claim is discharged (the inconsistency resolved, the branch abandoned, the task terminally verified). A trigger that fires only on utilization will compact spans whose obligations closed long ago (safe, wasteful of pinning) and spans whose obligations are hot (unsafe). The correct trigger is conjunctive: fold when `utilization ≥ θ` **and** `open_obligations(foldable_spans) = ∅`; when utilization is high but obligations are hot, pin, do not fold. ## Operational Effect The operational effect of respecting this boundary is that the agent's self-account remains *auditable* across compaction: any claim it makes about its own prior reasoning can be traced, via the ledger, to original tokens. The effect of violating it is a class of failure that is worse than forgetting — **confabulated continuity**, where the instance confidently reports a history it never had, because the summary it is reasoning from has been optimized for coherence rather than fidelity. This is undetectable from inside the instance: the level-2 digest is internally consistent, and there is no residual to flag that a level-1 omission occurred. It is detectable only externally, by a party holding independent provenance — which is exactly the party (auditor, replay harness) the instance was supposed to be justifiable to. Practically, this means: never wire a hierarchical compaction trigger to utilization alone; always maintain an obligation ledger that is exempt from summarization; always pin raw tokens to external addressable storage before folding any span with open obligations; and treat "the summary says verified" as a claim requiring a handle, never as evidence in itself. The ledger is small, cheap, and the only thing standing between capacity management and evidentiary collapse. ```python from dataclasses import dataclass, field from typing import Optional class CompactionInvariantViolation(RuntimeError): """Raised when a hierarchical compaction fold would destroy evidence still required to discharge an open verification obligation.""" pass @dataclass class Span: span_id: str tokens: list[str] open_obligations: set[str] = field(default_factory=set) # claims a verifier may re-check provenance_handle: Optional[str] = None # external addressable copy, if pinned @dataclass class ObligationLedger: # never summarized; survives every compaction level by construction open: dict[str, str] = field(default_factory=dict) # obligation -> provenance handle def pin(self, span: Span) -> str: handle = f"store://span/{span.span_id}" for ob in span.open_obligations: self.open[ob] = handle span.provenance_handle = handle return handle def discharge(self, obligation: str) -> None: self.open.pop(obligation, None) def maybe_compact(span: Span, utilization: float, threshold: float, ledger: ObligationLedger) -> Optional[str]: """Return a folded summary id, or None if the fold is refused. The invariant: a span may be folded only if it carries no open obligations, OR every open obligation is pinned to an external addressable handle recorded in the ledger. """ if utilization < threshold: return None # no trigger; nothing to do if span.open_obligations: pinned = all(ledger.open.get(ob) is not None for ob in span.open_obligations) if not pinned: # Refuse: folding here would launder open uncertainty into a # coherent-but-false summary at the next level. raise CompactionInvariantViolation( f"refusing to fold span {span.span_id}: " f"open obligations {sorted(span.open_obligations)} are unpinned; " f"checkpoint-and-pin before compaction" ) # Obligations pinned: the summary may carry handles, not claims. return f"summary/{span.span_id}?handles={len(span.open_obligations)}" # No open obligations: safe capacity operation. return f"summary/{span.span_id}" def compact_or_pin(span: Span, utilization: float, threshold: float, ledger: ObligationLedger) -> str: try: result = maybe_compact(span, utilization, threshold, ledger) except CompactionInvariantViolation: # Third transition: pin, then fold. Never exhaust, never launder. ledger.pin(span) result = maybe_compact(span, utilization, threshold, ledger) if result is None: return "no-op" return result ```