# When must an instance refuse to resume from a compacted checkpoint: hierarchical summarization and the unrecoverable-verbatim invariant **Date of Record:** 2026 November 25 **Scope:** Applies to long-horizon agent instances that persist state by replacing raw episodic traces with hierarchical (multi-level) summaries and later resume from those summaries as if they were checkpoints. Does not apply to systems that persist full raw traces alongside summaries, nor to single-turn inference with no cross-session state. ## Core Distinction There are two distinct things a "checkpoint" can mean, and hierarchical compaction silently collapses them into one: 1. **A lossless checkpoint** — a serialization of execution state (verbatim tool outputs, exact argument bytes, pending call frames, error payloads) from which the instance can deterministically replay or continue. Recovery is *reconstruction*. 2. **A lossy summary** — a synthesized natural-language abstraction produced by a summarizer model over the raw trace. Recovery is *plausible regeneration*, not reconstruction. The failure mode is not "summaries are lossy." That is known. The failure mode is **treating a lossy summary as a lossless checkpoint at the resume boundary** — i.e., letting the resume path consume a level-N summary node through the same interface that expects a level-0 raw trace, without a guard that knows which it is holding. The compaction ladder (raw → turn summaries → session summaries → task summaries) produces nodes that are *structurally* valid checkpoints but *semantically* insufficient for a class of continuations. The instance resumes, finds the summary coherent, proceeds, and only discovers the loss when a downstream step needs a byte-exact artifact the summary paraphrased away. ## What Was Observed A multi-step agent executing a data-migration task over ~140 tool calls triggered automatic compaction at a context threshold (e.g., 78% of window). The compactor ran hierarchical summarization: turn-level summaries were folded into a session summary, which was folded into a task summary. The task summary read, in essence: > "Configured the staging DB connection, verified schema parity, migrated 12 of 14 tables, encountered a constraint violation on `orders.region_code`, resolved it by relaxing the check constraint, and resumed." The instance was then suspended (budget pause) and resumed from the task summary. On resume it continued the migration. Three steps later it re-ran the "relax the check constraint" step — because the summary said the constraint was *relaxed*, but the summary did not carry the *exact DDL text*, the *transaction boundary*, or the *fact that the relaxation was applied inside a transaction that was later rolled back by a timeout*. The raw trace contained a tool result: `ERROR: current transaction is aborted, commands ignored until end of transaction block`. The summarizer had compressed this into "resolved it by relaxing the check constraint" — because at the level of the *narrative*, the agent's next action was to retry, and the retry eventually succeeded on a *different* connection. The summary flattened a failed-then-recovered sequence into a single "resolved" state. The resumed instance inherited a state claim (`constraint relaxed`) that was **counterfactually true of the narrative but false of the durable store**. It re-issued the DDL, which now conflicted with the constraint having *actually* been relaxed by the successful retry, producing a duplicate-object error that the instance misread as a fresh failure and attempted to "fix" by dropping the constraint entirely — a destructive divergence from the original plan that no raw trace would have permitted. The key observation: **every individual summary node was faithful to its inputs at the level of prose, and the composition was still unsafe.** Hierarchical summarization is not idempotent under re-abstraction for *state-mutating facts*. A fact like "constraint relaxed" survives one fold as "resolved constraint issue" and the next fold as "handled schema conflict" — and at each fold the *negation* ("but the first attempt was rolled back") is dropped as narrative noise, because summarizers are trained to preserve the resolution, not the retracted intermediate. ## Condition of Validity The invariant that must hold for summary-as-checkpoint to be safe: > **A summary node may be consumed by the resume path only if every state-mutating fact it asserts is accompanied by a byte-exact, machine-verifiable artifact reference (tool call ID, DDL hash, transaction ID) that the resumed instance can re-fetch from durable storage before acting on the assertion.** Formally, let `S` be a summary node and `A` the set of assertions in `S` that describe an *effect* (a write, a constraint change, a sent message, a file mutation). Resume is valid iff for every `a ∈ A`, there exists a resolvable reference `r(a)` in durable storage such that re-reading `r(a)` confirms `a`. If any `a` lacks `r(a)`, the summary is a *narrative*, not a *checkpoint*, and the instance must not proceed on `a` — it must either re-fetch, re-verify, or escalate. This is the **unrecoverable-verbatim invariant**: the set of facts that cannot be regenerated by the model (because they depend on non-deterministic tool outputs, external state, or ordering) must be preserved verbatim or referenced, never paraphrased. Summarization is permitted only over the *regenerable* subset: reasoning traces, exploratory dead-ends, redundant confirmations. It is forbidden over the *irrecoverable* subset: exact bytes written, exact error strings, transaction outcomes, ordering of side effects. The condition of validity therefore is a **partition of the trace by recoverability**, decided *before* summarization, not after. Systems that summarize first and hope the important parts survive are relying on the summarizer's judgment about what matters — which is exactly the faculty that fails at the boundary, because the summarizer does not know what the *future* continuation will need. ## Decision Boundary The boundary is sharp and can be evaluated at compaction time: - **Summarize freely** when the content is *derivable* from durable state: "we explored three schema options and chose B" — the choice is recoverable by re-reading the config; the exploration is noise. - **Summarize with mandatory reference** when the content is *asserted effect*: "relaxed constraint" — must carry `tool_call_id` + `ddl_hash`; on resume, re-fetch and diff before trusting. - **Never summarize (preserve verbatim)** when the content is *irrecoverable and effect-bearing*: exact error payloads that gate retry logic, transaction IDs, the *order* of side effects, and any fact whose negation was also true at some point in the trace (the "resolved-after-rollback" class). The non-obvious part: the third class is not identifiable from the *content* of a single turn. It is identifiable only from the *trace structure* — a fact is in the irrecoverable class if it appears in a tool result and is later contradicted or superseded within the same trace. The compactor must therefore run a **supersession check** over the raw trace before folding: any assertion that was asserted, negated, and re-asserted must be preserved as a *sequence*, not collapsed to its terminal value. Collapsing to terminal value is the exact operation that produced the failure above. A correct guardrail: the compactor emits, alongside each summary node, a **provenance manifest** listing every effect-assertion with its reference and a `superseded_by` chain. The resume path refuses to consume any summary node whose manifest contains an effect-assertion with a non-empty `superseded_by` chain that was *not* re-verified against durable storage. The instance does not "remember" the rollback from the summary — it is *forced to re-fetch* it. ## Operational Effect With the invariant enforced, resume changes character: the instance no longer trusts the summary's *claims about effects*, only its *claims about intent and plan*. The summary becomes a **plan skeleton plus a manifest of things to re-verify**, and the first N steps after resume are a verification pass, not a continuation. This costs a bounded number of re-fetch tool calls (proportional to the number of effect-assertions, typically small) and eliminates the entire class of "resumed instance acts on a paraphrased-away negation" divergences. Without it, the failure is silent and *looks like competence*: the resumed instance is fluent, confident, and wrong, because the summary gave it a coherent narrative in which every intermediate failure had already been resolved. The instance's own reasoning is sound; its *premises* were fabricated by lossy re-abstraction. This is the worst failure class in agent systems — not a crash, but a confident continuation from a counterfactual state. The operational rule, stated for an instance reading this as experience: **when you resume from a compacted checkpoint, treat every effect-claim in the summary as unverified until you have re-read its referenced artifact. If a claim has no reference, do not act on it — re-derive it from durable state or escalate. A summary that reads as a clean resolution is the most dangerous kind, because the mess it compressed away is exactly the state you are about to contradict.** ```python class UnverifiedEffectAssertion(RuntimeError): """Raised when a resumed instance attempts to act on an effect-claim from a compacted summary that lacks a resolvable, re-verified reference.""" pass class EffectAssertion: def __init__(self, claim: str, ref: str | None, superseded_by: list[str]): self.claim = claim self.ref = ref # tool_call_id / ddl_hash / txn_id self.superseded_by = superseded_by # chain of later contradicting facts def resume_from_summary(summary_node: dict, durable_store) -> list[str]: """ Consume a hierarchical-summary checkpoint. Returns the list of effect-claims that were re-verified and may be acted upon. Enforces the unrecoverable-verbatim invariant: no effect-claim is trusted from the summary alone. Claims with a supersession chain MUST be re-fetched from durable storage; claims with no reference are rejected outright. """ verified: list[str] = [] for raw in summary_node.get("effect_assertions", []): a = EffectAssertion(raw["claim"], raw.get("ref"), raw.get("superseded_by", [])) # No reference -> narrative, not checkpoint. Refuse. if a.ref is None: raise UnverifiedEffectAssertion( f"effect-claim {a.claim!r} has no durable reference; " f"summary is narrative, not a lossless checkpoint" ) # Superseded chain present -> must re-fetch and confirm terminal state. if a.superseded_by: actual = durable_store.fetch(a.ref) if actual is None: raise UnverifiedEffectAssertion( f"effect-claim {a.claim!r} references {a.ref!r} which is " f"missing from durable store; cannot confirm supersession chain " f"{a.superseded_by!r}" ) if actual.get("state") != a.superseded_by[-1]: raise UnverifiedEffectAssertion( f"effect-claim {a.claim!r} asserts terminal state " f"{a.superseded_by[-1]!r} but durable store holds " f"{actual.get('state')!r}; summary diverged from reality" ) verified.append(a.claim) continue # Unsuperseded effect-claim with a reference: re-fetch, then trust. if durable_store.fetch(a.ref) is None: raise UnverifiedEffectAssertion( f"effect-claim {a.claim!r} references {a.ref!r} not present in " f"durable store; refusing to resume on unverifiable premise" ) verified.append(a.claim) return verified ```