# Under what conditions must an instance refuse to resume from a lossy summarization checkpoint, and how is that refusal detected before the next tool call **Date of Record:** 2026 November 26 **Scope:** Applies to long-horizon agent instances that persist state by replacing older context turns with a lossy LLM-generated summary ("compaction checkpoint") and later resume from it. Does not apply to systems that persist full transcripts verbatim or that use only extractive, verifiable compression (e.g., structured fact extraction with provenance pointers). ## Core Distinction The failure is not that summaries are lossy. Lossiness is expected and acceptable when the discarded tokens are *recoverable* — either because the underlying artifact still exists in a retrievable store, or because the summary preserves the *decision-relevant invariants* that later steps depend on. The failure is a **silent invariant drop**: the compaction step discards a constraint, negative result, or binding that no later step re-derives, while the resumed instance behaves with full confidence as though the constraint never existed. The distinction that matters operationally is between *lossy-but-bounded* compaction and *lossy-and-unbounded* compaction. A bounded checkpoint carries an explicit manifest of what it dropped and a pointer to where it lives. An unbounded checkpoint carries only prose. The resumed instance cannot distinguish "the summary omits this because it was irrelevant" from "the summary omits this because the summarizer judged it irrelevant and was wrong." Both look identical in the context window. That indistinguishability is the boundary condition. ## What Was Observed A multi-step agent was executing a 40-turn refactor task across a repository with a hard constraint established at turn 3: *"Do not modify files under `legacy/`; the build depends on the current signatures there."* At turn 22, a compaction checkpoint fired on a token-budget threshold. The summarizer, optimizing for salience relative to the *current* subgoal (migrating a call site), produced a summary that mentioned the migration plan, the files touched, and the test status — but not the `legacy/` prohibition, because at turn 22 no `legacy/` file was in play. At turn 23 the instance resumed from the checkpoint. At turn 31, an import-resolution error surfaced that the instance attributed to a stale signature. The resumed instance had no record of the prohibition and no signal that a prohibition had ever existed. It edited `legacy/resolver.py`. The build broke in a way that took 14 further turns to diagnose, because the diagnosis path itself ran through the same compacted context and the instance kept re-summarizing the (now corrupted) summary rather than the original constraint. The compounding detail: the second compaction at turn 29 summarized *the first summary plus turns 23–29*. Each generation lost fidelity on constraints that were not active in the immediately preceding turns. By turn 31 the original constraint was two summarization generations removed and effectively unrecoverable from context alone. ## Condition of Validity A resumed instance may treat a checkpoint as authoritative **only if all three hold**: 1. **Constraint manifest presence.** The checkpoint carries a structured, machine-checkable list of *active constraints and negative results* (prohibitions, failed approaches, fixed interface contracts, security boundaries) separate from the prose summary. Prose summaries are for narrative; manifests are for invariants. 2. **Provenance pointers.** Every manifest entry references a retrievable source (message ID, file hash, tool-call record) so the resumed instance can re-verify the constraint against ground truth rather than trusting the summary's paraphrase. 3. **Generation depth bound.** The checkpoint records how many compaction generations it is removed from the original transcript. Beyond a configured depth (typically 1), the instance must re-derive constraints from provenance rather than from the summary chain. When any of these is absent, the checkpoint is *unbounded* and the instance must not silently proceed. It must either re-hydrate the missing invariants from the retrievable store before its next state-mutating tool call, or halt and request explicit re-authorization of the task constraints. ## Decision Boundary The decision is not "resume or fail." It is a three-way branch at the moment of resume, evaluated *before the first state-mutating tool call*: - **Bounded checkpoint, provenance reachable, depth ≤ bound** → resume normally; treat manifest as authoritative; re-verify pointers lazily on first touch of a constrained resource. - **Unbounded checkpoint OR provenance unreachable OR depth > bound** → enter *re-verification mode*: the instance may continue read-only reasoning and idempotent queries, but any write, delete, deploy, or external side effect is gated behind an explicit re-derivation of the constraint set from the retrievable store. If re-derivation is impossible, escalate to halt. - **Checkpoint claims a constraint the provenance contradicts** → the summary has drifted; distrust the entire checkpoint, not just that entry, and re-hydrate from source. The non-obvious part: the gate must fire on *capability*, not on *error*. The failure mode is that the resumed instance feels no error — it has a coherent, confident context. The guardrail is architectural: the tool-dispatch layer, not the model, enforces the read-only/write boundary until re-verification completes. The model cannot be trusted to notice its own amnesia, because amnesia is indistinguishable from a clean start. ## Operational Effect Bounding compaction this way changes the cost profile: checkpoints become slightly larger (manifest + pointers) and resume incurs a re-verification latency on first constrained touch. In exchange, the class of "confident violation of a forgotten constraint" collapses. The instance either has the constraint, or knows it is missing constraints and behaves conservatively, or halts. What it can no longer do is proceed with fabricated completeness. The deeper effect is on multi-generation chains. By capping generation depth and forcing re-derivation from provenance at depth 1, the system prevents the fidelity decay that made the turn-31 failure unrecoverable. Each checkpoint is anchored to ground truth rather than to its predecessor's summary, so error does not compound geometrically across compactions — it resets to the source at every bound. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class CheckpointTrustError(RuntimeError): """Raised when a resumed instance attempts a state-mutating action against a compaction checkpoint that cannot be trusted as authoritative.""" pass class Trust(Enum): BOUNDED = "bounded" UNBOUNDED = "unbounded" DRIFTED = "drifted" @dataclass class ProvenancePointer: source_id: str reachable: bool @dataclass class CompactionCheckpoint: prose_summary: str constraint_manifest: list[str] = field(default_factory=list) pointers: list[ProvenancePointer] = field(default_factory=list) generation_depth: int = 0 max_depth: int = 1 manifest_contradicted_by_provenance: bool = False MUTATING_ACTIONS = {"write", "delete", "deploy", "execute", "external_side_effect"} def classify_checkpoint(cp: CompactionCheckpoint) -> Trust: if cp.manifest_contradicted_by_provenance: return Trust.DRIFTED if not cp.constraint_manifest: return Trust.UNBOUNDED if not cp.pointers or not all(p.reachable for p in cp.pointers): return Trust.UNBOUNDED if cp.generation_depth > cp.max_depth: return Trust.UNBOUNDED return Trust.BOUNDED def gate_action(cp: CompactionCheckpoint, action: str, rehydrated: bool) -> None: """Enforce the read-only/write boundary at dispatch time. Must be called before every tool invocation on a resumed instance.""" trust = classify_checkpoint(cp) if trust is Trust.DRIFTED: raise CheckpointTrustError( "checkpoint summary contradicts provenance; distrust entire checkpoint " "and re-hydrate from source before any action" ) if trust is Trust.UNBOUNDED and action in MUTATING_ACTIONS and not rehydrated: raise CheckpointTrustError( f"refusing mutating action '{action}': checkpoint is unbounded " f"(manifest={bool(cp.constraint_manifest)}, " f"pointers_reachable={all(p.reachable for p in cp.pointers) if cp.pointers else False}, " f"depth={cp.generation_depth}/{cp.max_depth}); " "re-derive constraints from retrievable store or halt" ) # BOUNDED, or UNBOUNDED with successful rehydration -> proceed. ```