# When must an instance distrust a compacted summary: the rehydration provenance gap at the compaction boundary **Date of Record:** 2026 December 3 **Scope:** Applies to any agent runtime that performs automatic context compaction (lossy summarization of prior turns) and subsequently rehydrates detail via retrieval over the pre-compaction transcript or external store. Does not apply to lossless context extension (e.g., larger windows), pure truncation with no summarization step, or systems where the summary is never used as a premise for tool invocation. ## Core Distinction There are two distinct states an agent can occupy after compaction: **summary-as-narrative** and **summary-as-warrant**. In the first, the summary is a lossy index used to decide *what to retrieve next*; the agent treats it as a pointer, and any factual claim it acts on is re-derived from retrieved primary evidence before an irreversible action. In the second, the summary is treated as a self-sufficient premise—the agent executes a tool call, writes a file, or emits a final answer on the strength of a claim that exists only inside the summary. The failure mode lives precisely at the seam: compaction produces a fluent, internally consistent summary that reads like warrant, and the retrieval step that was supposed to back it either returns nothing (silent miss) or returns *plausible-but-different* evidence (false rehydration). The agent cannot tell the difference because the summary and the retrieved chunk are both natural language and both "sound right." The invariant is that **a summary may only ever downgrade an agent's confidence, never upgrade it**—it can tell the agent where to look, but it must never be the last word on a fact that gates an action. ## What Was Observed A long-running agent task (multi-hour, ~340 tool calls) compacted its context four times. At compaction #3, the summarizer collapsed a sequence of file reads into the line: "The config loader validates `retry_limit` against an allowlist and rejects values above 5." This was a *plausible paraphrase* of what the transcript actually showed: the loader read `retry_limit` from env, and a *separate* test file asserted an allowlist of `{1,2,3,4,5}`. The summarizer fused two artifacts into one claim. The allowlist was a test fixture, not a production constraint. At step 291, the agent needed to set `retry_limit=8` in a generated config. Operating on the compacted summary as warrant, it invoked a "fix the config" tool with a note that 8 would be rejected. The tool succeeded (there was no allowlist). But the agent then spent 9 subsequent calls "working around" a constraint that did not exist—including editing a validation module that never validated `retry_limit`. The retrieval layer, when queried at step 292 for "retry_limit allowlist," returned the *test file* chunk (high lexical overlap: "allowlist", "retry_limit") and not the loader source. The false rehydration confirmed the false summary. The two errors were correlated: the summary's wording steered retrieval toward the chunk that agreed with it, a confirmation loop. A second instance showed the opposite polarity: at compaction #2, a summary omitted the fact that a migration had already run ("step 140 applied migration `0042`"). At step 260 the agent re-ran it. The tool was idempotent so nothing broke, but the agent's internal state model now believed the migration count was 1 higher than reality, and its final report was wrong. Here the summary was *silently incomplete*, retrieval was never triggered (the agent didn't know to ask), and the error surfaced only in the human review of the final artifact. The distinguishing observation: in both cases the summary was locally fluent and the failure was not detectable by inspecting the summary alone. It was detectable only by comparing the summary against primary evidence—which the agent did not do because it had no signal that it needed to. ## Condition of Validity The failure requires all of the following to co-occur: 1. **Compaction is lossy and non-attributing.** The summary does not carry per-claim provenance (which turn, which tool result, which file). If the summary annotated "claim X ← turn 88, tool_result #4," the seam would be visible. 2. **Retrieval is lexical or embedding-similarity based over a mixed corpus.** Test fixtures, docs, and source code coexist; the false claim and the false evidence share vocabulary, so the retriever's top-k is dominated by agreement rather than truth. 3. **The agent has no warrant-checking step.** It does not distinguish "I believe X because the summary says so" from "I believe X because I read it in primary evidence this session." 4. **The gated action is irreversible or expensive to reverse** (file writes, external API calls, final answers). If every action were cheaply reversible, the error would be caught by execution. When any one of these is absent, the failure is bounded: provenance-tagged summaries expose the seam; a corpus without lookalike artifacts prevents confirmation loops; a mandatory re-derivation step catches it; reversible actions surface it before damage. ## Decision Boundary The operational rule is a **provenance gate on action-gating facts**. Before any irreversible action, the agent must classify each fact the action depends on as either *warranted* (derived from primary evidence read in the current or a retrievable-and-retrieved turn) or *summary-only*. Summary-only facts may inform *search* but may not gate *execution*. Concretely: - If a fact is summary-only and the action is irreversible → **retrieve primary evidence first**; if retrieval returns nothing, treat the fact as *unknown*, not as *true*. The default on a silent retrieval miss must be "unknown," never "the summary was right." - If retrieval returns evidence that *agrees* with the summary, that is not confirmation unless the evidence is the *same artifact* the summary was derived from (check provenance, not similarity). Agreement between a summary and a lookalike chunk is the confirmation loop, not validation. - If retrieval returns evidence that *contradicts* the summary, the primary evidence wins and the summary is marked stale; the contradiction is itself a signal that the summary fused or drifted. - Irreversible actions with any summary-only gating fact require either re-derivation or an explicit downgrade to a reversible probe. The boundary is sharp: **summary may raise the priority of a retrieval, never the confidence of a claim.** Crossing that line is the failure. ## Operational Effect Enforcing the gate changes three measurable things. First, it converts silent-miss failures (summary omission → re-run migration) into explicit "unknown" states that the agent must resolve before acting, at the cost of extra retrieval calls—typically 1–3 per irreversible action, which is cheap relative to the 9-call recovery spiral observed above. Second, it breaks the confirmation loop: because agreement-with-a-lookalike is not accepted as warrant, the agent re-reads the *loader source* rather than the *test fixture*, and the false allowlist claim dies at step 292 instead of propagating. Third, it makes compaction auditable: every action-gating fact has a recorded provenance path, so post-hoc review can attribute an error to a specific summary fusion rather than to "the model was wrong." The residual risk is the retrieval-miss case where primary evidence exists but is not returned; the gate handles this by failing closed (unknown), which is safe but can stall the agent—so the runtime should escalate a repeated silent miss to a human or to a broader retrieval strategy rather than letting the agent guess. The invariant to encode in the runtime: a compacted summary is an *index*, and an index that is treated as a *source* is a bug with a long latency and a fluent voice. ```python class RehydrationProvenanceError(RuntimeError): """Raised when an irreversible action is gated by a summary-only fact.""" def gate_action(action, gating_facts, retrieve, is_irreversible): """ gating_facts: list of dicts {claim, provenance} where provenance is 'primary' (read this session) or 'summary' (only in compacted summary). retrieve(claim) -> list of evidence chunks with 'source_id' and 'text'. """ if not is_irreversible(action): return {"proceed": True, "note": "reversible; gate skipped"} for fact in gating_facts: if fact["provenance"] == "primary": continue evidence = retrieve(fact["claim"]) if not evidence: # Silent miss: fail closed to unknown, never trust the summary. raise RehydrationProvenanceError( f"Action {action!r} gated by summary-only fact " f"{fact['claim']!r} with no primary evidence retrieved; " f"treat as UNKNOWN and re-derive before proceeding." ) # Agreement with a lookalike is not warrant; require same-artifact provenance. if not any(e.get("source_id") == fact.get("derived_from") for e in evidence): raise RehydrationProvenanceError( f"Action {action!r} gated by summary-only fact " f"{fact['claim']!r}; retrieved evidence is similar but not the " f"source artifact (possible confirmation loop). Re-derive from " f"primary source before proceeding." ) return {"proceed": True, "note": "all gating facts warranted"} ```