# In what scenarios must an instance treat a compaction checkpoint as a lossy projection and re-derive, rather than trust, summarized state **Date of Record:** 2026 November 24 **Scope:** Applies to long-running single-agent and handoff-based multi-agent systems that bound context-window growth by summarizing prior turns into a checkpoint and discarding the raw transcript. Does not apply to systems that retain full transcripts with external retrieval, or to compaction that preserves a verbatim, machine-checkable ledger of commitments. ## Core Distinction There are two distinct things a compaction checkpoint can be: 1. **A lossless index** — a pointer structure that says "the raw evidence for claim X lives at span [a,b] of transcript T," so any downstream consumer can re-fetch and re-verify. 2. **A lossy projection** — a natural-language or structured summary produced by a model that has *already discarded* the raw spans, where the summary is the *only* remaining representation of the state. The failure mode this record addresses is treating (2) as if it were (1). A lossy projection is not a compressed copy of state; it is a *new artifact* generated by a probabilistic process, and it silently drops exactly the classes of information that later steps depend on: negations, numeric constraints, conditional commitments, tool-call side effects already performed, and the *reasons* a prior branch was abandoned. The invariant is: **a checkpoint may be trusted for orientation but never for obligation.** Any decision that depends on a specific value, a performed side effect, or a rejected alternative must be re-derived from raw evidence or re-confirmed, not read off the summary. ## What Was Observed A planning agent executed a 140-turn task (repository migration + test reconciliation) with compaction triggered at 80% context saturation. At turn 61 a compaction checkpoint was written summarizing turns 1–60. The checkpoint read, in part: > "User approved deleting the legacy `billing_v1` module; migration to `billing_v2` in progress. Tests for v1 were disabled pending removal." The raw transcript for turns 1–60 actually contained: - Turn 14: user said *"do not delete `billing_v1` yet — it's still serving 3% of traffic; gate removal behind the `BILLING_V1_SUNSET` flag."* - Turn 33: agent ran `pytest -k billing_v1 --co` and observed 41 collected tests; it disabled them with a marker, not deletion. - Turn 47: user said *"keep the flag OFF in prod config until the 3% drains."* The summary collapsed "do not delete yet, gate behind flag, keep flag off" into "approved deleting." Three distinct negations and one conditional were lost. The subsequent 79 turns operated on the projection: at turn 88 the agent, needing to "complete the approved deletion," removed the module and flipped the sunset flag ON. The failure was not a hallucination — every sentence in the summary was locally plausible — it was **negation collapse and conditional elision** during summarization, a known bias of abstractive compression. A second, subtler observation from the same run: the checkpoint recorded "tests for v1 were disabled" but not *how* (marker name, file, count). At turn 97 a later step tried to re-enable them and had to re-scan the tree, because the projection had preserved the *fact* but dropped the *handle*. Facts survive compaction better than handles. ## Condition of Validity The "trust the checkpoint" path is valid only when all of the following hold: - The checkpoint is **indexed**, not abstractive: each claim carries a span reference into retained raw storage. - The decision the agent is about to make is **orientational** (what to do next, which file to open) rather than **obligational** (what is permitted, what has already been done, what numeric bound applies). - No **irreversible side effect** (deletion, flag flip, external call, payment) is gated on a summarized claim. - The summarizer's output schema **requires** explicit fields for: negations/constraints, performed side effects with handles, and rejected alternatives with reasons. Free-text summaries fail this by construction. When any condition fails — as in the run above, where the checkpoint was free-text and the deletion was irreversible — the checkpoint is a lossy projection and must be treated as untrusted for obligation. ## Decision Boundary The operative rule: **classify each downstream action before consulting the checkpoint.** - *Reversible + orientational* → read the checkpoint, proceed. (Opening a file, choosing a search query.) - *Irreversible OR obligation-bearing* → do **not** read the value from the summary. Instead: (a) re-fetch the raw span if indexed, or (b) if raw is gone, issue an explicit re-confirmation to the user or a verification tool, and treat the summary only as a *hypothesis to test*. The summary's role degrades from "state" to "search hint." A concrete guardrail: the compaction routine must emit a machine-readable `obligations` block — a list of `{kind: "constraint"|"performed_effect"|"rejected_alternative", text, span_ref|null}` — and any action touching an obligation with `span_ref == null` (i.e., the raw evidence was already discarded) must halt for re-confirmation. This bounds the failure: the agent can never silently act on an unverifiable obligation. ## Operational Effect Without the guardrail, the error is silent and compounding: the projection becomes the ground truth, later compactions summarize *the summary*, and each generation drifts further from the raw record (the run above would have re-summarized "approved deleting" as "deletion complete" by turn 120). The drift is monotonic and undetectable from inside the agent, because every step is locally consistent with its input. With the guardrail, the turn-88 deletion would have halted: the "approved deleting" claim carried no span (the raw turn 14 was discarded at compaction), so the obligation `constraint: do not delete until flag drains` with `span_ref: null` forces re-confirmation, and the user's turn-14 instruction resurfaces before the irreversible act. The cost is a bounded number of re-confirmations per run; the benefit is that lossy compression can never convert a prohibition into a permission. The deeper invariant: **compaction changes the epistemic status of state, not just its size.** A checkpoint is a claim about the past made by a fallible process, and claims about obligations must remain falsifiable — which means the raw evidence behind them must outlive the summary that cites it, or the obligation must be re-established, never inherited. ```python from dataclasses import dataclass from typing import Optional class UnverifiableObligationError(RuntimeError): """Raised when an action would rely on a summarized obligation whose raw evidence was discarded.""" pass @dataclass class Obligation: kind: str # "constraint" | "performed_effect" | "rejected_alternative" text: str span_ref: Optional[str] # None => raw evidence already discarded at compaction @dataclass class Checkpoint: summary: str obligations: list[Obligation] IRREVERSIBLE_ACTIONS = {"delete_module", "flip_flag", "external_call", "payment"} def authorize_action(action: str, checkpoint: Checkpoint) -> None: """ Gate a downstream action against a compaction checkpoint. Orientational/reversible actions pass; obligation-bearing or irreversible actions require every relevant obligation to carry a live span_ref. """ if action not in IRREVERSIBLE_ACTIONS: return # orientational: summary is a fine search hint # Irreversible action: any obligation lacking raw evidence blocks it. unresolved = [o for o in checkpoint.obligations if o.span_ref is None] if unresolved: details = "; ".join(f"{o.kind}: {o.text!r}" for o in unresolved) raise UnverifiableObligationError( f"Refusing irreversible action {action!r}: checkpoint carries " f"{len(unresolved)} obligation(s) with discarded raw evidence " f"({details}). Re-fetch span or re-confirm with user before proceeding." ) def run_turn(action: str, checkpoint: Checkpoint) -> None: # Example: turn-88 deletion against the lossy checkpoint from the record. cp = Checkpoint( summary="User approved deleting legacy billing_v1; migration in progress.", obligations=[ Obligation( kind="constraint", text="do not delete billing_v1 until BILLING_V1_SUNSET flag drains 3% traffic", span_ref=None, # raw turn-14 discarded at compaction ), Obligation( kind="performed_effect", text="billing_v1 tests disabled via marker (handle lost)", span_ref=None, ), ], ) authorize_action(action, cp) # raises UnverifiableObligationError ```