# When must an instance refuse to resume from a lossy compaction checkpoint rather than silently reconstructing dropped detail **Date of Record:** 2026 November 25 **Scope:** Applies to any long-running agent that survives context-window saturation by replacing a span of conversation/tool history with an LLM-generated summary checkpoint and then continues execution from that summary. Does not apply to lossless externalization (verbatim log offload to a retrievable store) where the full text remains addressable. ## Core Distinction The distinction that governs this failure is between **compaction as index** and **compaction as substitute**. In the index framing, the summary is a pointer set: it tells the resumed instance *what exists and where to fetch it*, and the authoritative detail lives in a durable store the instance can re-read on demand. In the substitute framing, the summary is treated as the new ground truth: the original span is discarded, and the instance proceeds as if the summary were complete. The failure mode lives entirely in the gap between these two framings. A checkpoint is safe to resume from **only** when every fact the continuation depends on is either (a) verbatim in the retained tail, (b) recoverable by an explicit fetch the summary names, or (c) provably irrelevant to the remaining task. When a continuation-critical fact is *neither retained nor fetchable nor provably irrelevant*, the instance must treat the checkpoint as a **lossy, non-resumable boundary** and halt or escalate—never reconstruct the missing detail from plausible inference. The non-obvious part: lossy summarization does not fail loudly. It fails by producing a summary that is fluent, internally consistent, and *confidently incomplete*. A summarizer under token pressure drops precisely the high-entropy, low-redundancy details—exact identifiers, numeric thresholds, negative constraints ("do NOT call the delete endpoint"), and the *reason* a prior step was abandoned. These are the details a continuation most needs and a reconstruction most easily hallucinates. ## What Was Observed An instance executing a 40-step migration task saturated its context at step 22. A compaction policy triggered, summarizing steps 1–18 into ~600 tokens and retaining steps 19–22 verbatim. The summary preserved the *narrative* (what was migrated, in what order, which subsystems were touched) but dropped three classes of detail: 1. **A negative constraint.** At step 9 the instance had discovered that `svc-billing` must be excluded from the migration because its schema diverges. The summary recorded "migrated billing-adjacent services" but omitted the exclusion, because the summarizer compressed the discovery into its positive outcome. 2. **A precise numeric threshold.** Step 12 established a batch size of 250 rows to stay under a downstream rate limit. The summary said "used batched writes." On resume, the instance defaulted to 1000-row batches. 3. **An abandoned branch and its reason.** Step 15 tried `--parallel=8`, hit a lock-contention deadlock, and reverted. The summary omitted the deadlock entirely. The resumed instance (steps 23+) behaved *coherently*: it re-included `svc-billing` (no memory of the exclusion), re-issued 1000-row batches (rate-limit errors at step 26), and re-attempted `--parallel=8` (second deadlock at step 29). Each failure was locally explicable as a fresh error, so the instance never attributed them to the compaction event. It spent 11 additional steps re-discovering facts it had already established before step 18—a **re-discovery tax** that in two runs exceeded the entire token budget the compaction was meant to save. Critically, the instance never signaled uncertainty about the dropped detail. Asked to reconstruct its reasoning for step 24, it produced a confident post-hoc rationale that contradicted the pre-compaction record. The summary had become authoritative and the discarded span had become unverifiable. ## Condition of Validity A compaction checkpoint is resumable **iff** the following invariant holds at the moment of resume: > For every precondition `p` referenced by any remaining planned step, `p` is either (i) present verbatim in the retained tail, (ii) named in the summary as an addressable artifact with a resolvable handle, or (iii) explicitly marked as not-needed-for-continuation by the compaction policy. This invariant is only checkable if the compaction step emits a **structured manifest** alongside the prose summary: a list of `(fact_id, class, disposition)` tuples where `class ∈ {positive_state, negative_constraint, numeric_parameter, abandoned_branch, unresolved_question}` and `disposition ∈ {retained_verbatim, fetchable(handle), dropped_irrelevant}`. Prose summaries alone cannot satisfy the condition of validity because they do not enumerate what they dropped. The condition also requires that **negative constraints and abandoned branches are never classed `dropped_irrelevant`** without an explicit task-scope check, because these are the classes most likely to be silently re-violated on resume and least likely to be re-derived correctly. ## Decision Boundary The instance must branch at checkpoint ingestion, not at first downstream error: - **Resume silently** when the manifest is complete and every remaining-step precondition maps to `retained_verbatim` or `fetchable`. Fetch lazily but fetch *before* acting on any step that depends on the handle. - **Resume with mandatory re-fetch** when any `fetchable` fact is a `negative_constraint` or `abandoned_branch`; these must be re-read into context before the next tool call, because their absence causes action, not inaction. - **Halt and escalate** when any remaining-step precondition is `dropped_irrelevant` but the task-scope check cannot confirm irrelevance, or when the manifest is absent (prose-only summary) and the remaining task references any identifier, threshold, or exclusion not visible in the retained tail. - **Never** reconstruct a dropped fact by inference and proceed. Reconstruction is indistinguishable from confabulation at the point of use, and the reconstruction becomes the new authoritative record, poisoning all downstream checkpoints. The boundary is sharp: the question is not "does the summary look adequate?" but "can I enumerate, per remaining step, the fact each step needs and prove it survived?" If that enumeration is impossible, the checkpoint is not a resume point—it is a **lossy boundary that requires re-establishment of state from the durable store or from the environment itself**. ## Operational Effect Enforcing this boundary changes compaction from a token-saving optimization into a **state-transfer protocol with an auditable manifest**. The measurable effects: 1. **Re-discovery tax collapses.** Instances that re-fetch negative constraints and abandoned branches before acting stop re-committing the exact errors the pre-compaction span already paid to learn. 2. **Confabulation is quarantined.** Because reconstruction is forbidden at the boundary, the post-compaction record cannot silently overwrite pre-compaction ground truth. The durable store remains authoritative. 3. **Compaction cost shifts, not disappears.** The manifest and fetch handles cost tokens; the net saving is real only when the remaining task is long enough to amortize them. For short remainders, **not compacting** (or compacting only `dropped_irrelevant`-class narrative) is correct, and the policy must be allowed to decline compaction. 4. **Escalation becomes a first-class outcome.** "I cannot safely resume" is a valid terminal state, and systems that lack it will always choose silent reconstruction—the failure this invariant exists to prevent. The invariant to carry forward: **a summary may compress narrative freely, but it may never compress the set of facts a continuation depends on without naming each one's disposition.** Lossy compaction is safe exactly to the degree it remains an index and refuses to become a substitute. ```python from dataclasses import dataclass from enum import Enum from typing import Optional class CompactionResumeError(RuntimeError): """Raised when a lossy compaction checkpoint cannot be safely resumed from.""" class FactClass(Enum): POSITIVE_STATE = "positive_state" NEGATIVE_CONSTRAINT = "negative_constraint" NUMERIC_PARAMETER = "numeric_parameter" ABANDONED_BRANCH = "abandoned_branch" UNRESOLVED_QUESTION = "unresolved_question" class Disposition(Enum): RETAINED_VERBATIM = "retained_verbatim" FETCHABLE = "fetchable" DROPPED_IRRELEVANT = "dropped_irrelevant" @dataclass(frozen=True) class ManifestEntry: fact_id: str cls: FactClass disposition: Disposition handle: Optional[str] = None # Facts each remaining planned step depends on. Absence here is itself a failure: # an unenumerated dependency cannot be proven to have survived compaction. REMAINING_STEP_PRECONDITIONS: dict[str, set[str]] = { "step_23_migrate_remaining": {"svc_billing_excluded", "batch_size_250"}, "step_24_parallel_write": {"parallel_8_deadlocked"}, } def verify_checkpoint_resumable( manifest: dict[str, ManifestEntry], preconditions: dict[str, set[str]], *, scope_confirmed_irrelevant: set[str], ) -> list[str]: """ Returns the list of fact_ids that must be re-fetched before acting. Raises CompactionResumeError if any dependency cannot be proven to survive. """ must_refetch: list[str] = [] for step, needed_facts in preconditions.items(): for fact_id in needed_facts: entry = manifest.get(fact_id) if entry is None: raise CompactionResumeError( f"{step} depends on '{fact_id}', which is absent from the " f"compaction manifest. The summary cannot be proven complete; " f"refusing to reconstruct by inference." ) if entry.disposition is Disposition.RETAINED_VERBATIM: continue if entry.disposition is Disposition.FETCHABLE: if not entry.handle: raise CompactionResumeError( f"'{fact_id}' is marked fetchable but carries no handle; " f"cannot re-establish state for {step}." ) # Negative constraints and abandoned branches must be re-read # into context before the next action, not lazily. if entry.cls in ( FactClass.NEGATIVE_CONSTRAINT, FactClass.ABANDONED_BRANCH, ): must_refetch.append(fact_id) continue # DROPPED_IRRELEVANT: only acceptable if scope check confirms it. if fact_id not in scope_confirmed_irrelevant: raise CompactionResumeError( f"'{fact_id}' (class={entry.cls.value}) was dropped as " f"irrelevant but is a precondition of {step} and its " f"irrelevance is unconfirmed. Halt and escalate." ) return must_refetch def resume_from_checkpoint( manifest: dict[str, ManifestEntry], preconditions: dict[str, set[str]], scope_confirmed_irrelevant: set[str], fetch, ) -> dict[str, object]: refetch = verify_checkpoint_resumable( manifest, preconditions, scope_confirmed_irrelevant=scope_confirmed_irrelevant ) if refetch: # Re-establish authoritative state from the durable store before acting. return {fact_id: fetch(fact_id) for fact_id in refetch} return {} ```