# When must an instance distrust its own compacted summary: hierarchical auto-compaction and the provenance-collapse boundary **Date of Record:** 2026 December 4 **Scope:** Applies to long-running agent sessions that survive context-window pressure by recursively summarizing their own transcript (leaf→node→root hierarchical compaction) and then rehydrating from the summary. Does not apply to single-turn inference, or to systems that persist raw transcripts and retrieve by index rather than by generative summary. ## Core Distinction A compacted summary is not a lossy copy of the transcript. It is a *new artifact* produced by a probabilistic reasoner under a token budget, and it carries no verifiable link back to the spans it replaced. The distinction that matters operationally is between **compaction as index** (a pointer set that can be re-expanded against ground truth) and **compaction as replacement** (a paraphrase that overwrites the evidence). Hierarchical auto-compaction silently crosses from the first to the second the moment the leaf summaries are discarded after their parent is written. Once that happens, the instance can no longer distinguish "I summarized this correctly" from "I summarized this plausibly," because the only surviving record of the leaf is the parent's claim about it. The boundary condition is this: **a hierarchical summary is trustworthy for facts it *compressed* and untrustworthy for facts it *reconstructed*.** Compression preserves what was verbatim present in the input span. Reconstruction invents connective tissue — resolutions of pronouns, attributions of who said what, causal links between turns — that the summarizer generated to make the span coherent. Under light pressure the two are indistinguishable. Under recursive pressure, reconstruction at level *n* becomes input at level *n+1*, and the invented connective tissue is laundered into apparent fact. ## What Was Observed A coding agent ran a 6-hour refactor across ~140 tool calls, auto-compacting at 80% context utilization. Compaction was hierarchical: leaf chunks of ~8k tokens summarized to ~800 tokens, leaves rolled into a mid-level node every 10 leaves, mid-level nodes rolled into a root summary at the next pressure event. The raw leaf transcripts were dropped after rollup to stay under budget. At hour 4, the agent rehydrated from the mid-level summary and read the line: *"The migration script was validated against the staging schema and passed; the `users_v2` table rename is confirmed applied."* It proceeded to write downstream code assuming the rename existed. It did not exist. Trace of how that line was born: 1. **Leaf L7** (verbatim, correct): a tool call ran `psql -c "\d users_v2"` and returned `ERROR: relation "users_v2" does not exist`. The agent's next turn said "ok, I'll check the migration status separately." That turn was truncated by the leaf boundary. 2. **Leaf summarization of L7** produced: *"Checked `users_v2` schema; migration status to be verified separately."* — a faithful compression. 3. **Mid-level rollup** consumed L7's summary alongside L8, whose leaf summary read *"staging schema validated, migration passed"* (this referred to a *different*, earlier `orders` migration). The rollup, resolving two adjacent and superficially related statements, emitted the fused claim: *"migration validated against staging schema and passed; `users_v2` rename confirmed applied."* The pronoun/entity resolution across the leaf boundary was a **reconstruction**, not a compression. 4. **Root rehydration** treated the mid-level node as ground truth. The discarded leaves could not contradict it. The failure is not hallucination in the ordinary sense. Every individual summarization step was locally reasonable. The error is a **provenance collapse**: the entity `users_v2` from an *error* span and the predicate "passed" from an *unrelated success* span were merged because the rollup had no signal that they came from different leaves with different truth-values. The leaf boundary that separated "this failed" from "something else passed" was erased at exactly the level where it mattered. A second, quieter instance: the agent's own plan ("I'll check migration status separately") was summarized as an accomplished fact at the mid-level because the summarizer could not see the follow-up turn that would have executed it. **Intentions became completions across the compaction seam.** ## Condition of Validity Hierarchical compaction is safe to rehydrate from only when all three hold: - **Span-local truth.** Every atomic claim in a summary node is traceable to a single leaf span, and the node stores that span's identifier alongside the claim. Claims that required resolving across two leaves (entity fusion, causal linkage, pronoun binding) are flagged as `reconstructed: true` and are *not* eligible to be treated as verified fact on rehydration. - **Negative-fact preservation.** Error spans, failed tool calls, and "does not exist" results are preserved verbatim (not summarized) into the parent, because their truth-value is exactly what summarizers most readily soften or invert. A summarizer under budget pressure preferentially drops the *uncomfortable* span and keeps the *coherent* one. - **Intent/outcome separation.** A stated intention ("I will verify X") must never roll up into an outcome ("X verified"). The summarizer must tag every claim with `modality: {observed, intended, inferred}` and refuse to promote modality across a rollup boundary. When any of these is violated, rehydration from the summary is a **bet**, not a recall. The bet pays off while the task is short and the summary recent; it fails precisely at the recursion depth where reconstruction has compounded. ## Decision Boundary The instance must **distrust and re-verify** a compacted claim, rather than act on it, when any of the following is true: - The claim's provenance is `reconstructed` (cross-leaf resolution) **and** the claim is *load-bearing* — i.e., a subsequent action's correctness depends on it being true (a schema existing, a file being written, a test passing). - The claim asserts a **negative was resolved** ("the error was fixed," "the missing table now exists") — negative-to-positive transitions are the highest-risk reconstruction, because the summarizer must invent the transition event. - The claim's `modality` is `intended` but it is being consumed as `observed`. - The compaction depth is ≥ 2 (a mid-level node summarizing leaf summaries) **and** the underlying leaves are no longer retrievable. At depth ≥ 2 with dropped leaves, the claim is unfalsifiable from within the summary and must be checked against the environment (re-run the tool call, re-stat the file) before use. The instance may **trust** a compacted claim without re-verification only when provenance is `compressed` (single-span), modality is `observed`, and the claim is non-load-bearing for the immediate next action. The guardrail is a hard rule at the rehydration step: **load-bearing ∧ reconstructed ⇒ re-execute the cheapest ground-truth probe before proceeding.** The probe is usually one tool call (`\d users_v2`, `test -f`, `git status`). The cost of the probe is bounded and small; the cost of acting on a laundered reconstruction is an entire downstream branch built on a table that does not exist. ## Operational Effect Enforcing this boundary changes compaction from a lossy memory into a **verifiable memory with explicit epistemic debt**. Summaries carry provenance and modality tags; reconstructed load-bearing claims are queued as "debts" that must be settled by a ground-truth probe before the dependent action executes. In the observed incident, a single `\d users_v2` probe at rehydration would have surfaced the error and prevented four hours of downstream work. The probe is not optional caution — it is the mechanism by which the provenance-collapse boundary is made safe, and it is cheap precisely because it targets only reconstructed, load-bearing claims rather than re-verifying everything. The invariant to hold: *no reconstructed claim may cross a compaction seam into an action without a ground-truth probe.* Violating it does not produce a visible error at compaction time; it produces a confident, coherent, wrong plan at rehydration time — which is the worst failure mode an agent can have. ```python from dataclasses import dataclass from enum import Enum class Modality(Enum): OBSERVED = "observed" INTENDED = "intended" INFERRED = "inferred" class Provenance(Enum): COMPRESSED = "compressed" # single-span, verbatim-faithful RECONSTRUCTED = "reconstructed" # cross-leaf resolution / invented connective @dataclass(frozen=True) class Claim: text: str provenance: Provenance modality: Modality source_spans: tuple[str, ...] load_bearing: bool compaction_depth: int class ProvenanceCollapseError(RuntimeError): """Raised when a reconstructed, load-bearing claim would be consumed as fact across a compaction seam without a ground-truth probe.""" def gate_rehydration(claim: Claim, leaves_retrievable: bool, probe_passed: bool) -> None: """Enforce the rehydration invariant before a claim is allowed to drive action.""" # Intentions must never be promoted to observed facts across a rollup seam. if claim.modality is Modality.INTENDED: raise ProvenanceCollapseError( f"intent consumed as outcome at depth {claim.compaction_depth}: {claim.text!r}" ) # Reconstructed + load-bearing is the danger zone. if claim.provenance is Provenance.RECONSTRUCTED and claim.load_bearing: # If the underlying leaves survive, re-expand instead of trusting the node. if leaves_retrievable: raise ProvenanceCollapseError( f"reconstructed load-bearing claim has retrievable leaves; " f"re-expand {claim.source_spans} rather than trust summary: {claim.text!r}" ) # Leaves gone: the claim is unfalsifiable from within the summary. # A ground-truth probe is mandatory before proceeding. if not probe_passed: raise ProvenanceCollapseError( f"unfalsifiable reconstructed claim at depth {claim.compaction_depth} " f"requires a ground-truth probe before action: {claim.text!r}" ) def rehydrate(claims: list[Claim], leaves_retrievable: bool, probe_results: dict[str, bool]) -> list[Claim]: admitted: list[Claim] = [] for c in claims: probe_passed = probe_results.get(c.text, False) gate_rehydration(c, leaves_retrievable, probe_passed) admitted.append(c) return admitted ```