# In what scenarios must an instance treat lossy summarization checkpoints as non-invertible for causal replay **Date of Record:** 2026 November 17 **Scope:** Applies to agent runtimes that maintain a long-running context window by periodically compacting history into a lossy summary checkpoint and later "expanding" it back toward full fidelity. Does not apply to lossless checkpointing (e.g., raw token spooling to durable storage with exact rehydration) or to stateless single-turn inference. ## Core Distinction The failure boundary is not "did summarization lose information?" — it always does. The boundary is whether the *expansion path* is **reversible with respect to the invariant the downstream consumer depends on**. Two distinct notions of reversibility get conflated: 1. **Semantic reversibility** — the expanded context supports the same *answers* to likely future queries. 2. **Causal reversibility** — the expanded context preserves the exact *ordering, attribution, and negation* of propositions that justified prior actions. Lossy summarization checkpoints are routinely semantic-reversible and almost never causal-reversible. An instance that treats a checkpoint as a rollback target — "restore to checkpoint N and try a different branch" — silently violates causal reversibility because the checkpoint is a *projection*, not a *snapshot*. Expanding a projection does not recover the fiber it was projected from; it recovers one plausible representative, which is generally not the true predecessor state. The non-obvious invariant: **a compaction checkpoint is a quotient map, and expansion is a section, not an inverse.** The composition `expand ∘ summarize` is idempotent but not identity. Any branch that assumes `expand(summarize(x)) == x` for the purposes of replay, audit, or differential debugging is unsound. ## What Was Observed In a multi-step tool-using agent, compaction fired at 80% of the context budget. The summarizer was instructed to "preserve decisions and open questions." After three compaction cycles over a 40-turn session, the following class of drift appeared: - A negative constraint ("do not retry the endpoint with the legacy auth header") was summarized as a positive capability ("endpoint access is configured"). The negation was dropped because the summarizer scored it as low-salience relative to the positive fact it modified. On expansion, the agent retried the legacy header, which the downstream service had since deprecated — producing a 401 storm that looked like an auth regression. - Two temporally adjacent decisions ("first chose A, then reversed to B on new evidence") collapsed into "chose B." The reversal's *evidence* was dropped, so a later branch that revisited the decision had no record of *why* A was abandoned and re-derived A. - Turn-local attributions ("the user said X; the tool reported Y") merged into "Y," losing the provenance needed to distinguish a user assertion from an observed fact. None of these were visible in semantic eval — the agent still answered the *current* question well. They surfaced only when the runtime attempted a **branch-and-replay** from an earlier checkpoint to test an alternative plan. The replayed branch diverged from the original not because of the new plan but because the checkpoint had already discarded the constraints that bound the original. A second, subtler failure: expansion was implemented as "re-inject the summary plus a compressed tail." Because the summary was generated *after* the tail it described, expansion produced a context whose internal timestamps were non-monotonic — the summary referenced events that appeared, in the expanded ordering, to precede their own causes. A tool that validated causal ordering across the expanded context rejected it as inconsistent, which masked the real cause. ## Condition of Validity The checkpoint may be treated as a **replay base** only when all of the following hold: - The compaction record retains, out-of-band, the *full* pre-compaction token stream on durable storage, keyed by checkpoint ID. Expansion in this case is rehydration, not inference, and is genuinely invertible. - The invariant under test is *semantic* (does the agent still solve the task?) rather than *causal* (can we reconstruct why it did what it did?). Semantic invariants survive projection; causal ones do not. - The branch being replayed does not depend on **negations, attributions, or orderings** that the summarizer was not explicitly instructed to preserve as first-class fields. The checkpoint may **not** be treated as a replay base when: - Expansion is generated by an LLM from the summary alone (a *hallucinated section*, not a stored one). The section is a sample from the model's prior conditioned on the summary, not a recovery of the original fiber. - The downstream consumer performs differential comparison between branches (A/B replay), audit, or post-hoc attribution. These require the true predecessor, which the checkpoint no longer contains. - The summarizer's salience scoring is unconstrained with respect to negation and provenance. If the summary schema has no dedicated slots for `negated_constraints`, `attributions`, and `ordering_edges`, those are the first things lost. ## Decision Boundary The operational rule: - **If** the runtime needs to answer "what should the agent do next given the current state," compaction checkpoints are safe and expansion is optional. - **If** the runtime needs to answer "why did the agent do that, and would it do it again under a counterfactual," the checkpoint is **not** a valid base. Either retain the raw stream, or explicitly mark the branch as *advisory* (a fresh derivation from the summary, not a replay) and forbid differential comparison against the original. The boundary is crossed the moment a single code path serves both "continue" and "replay." That path will pass semantic tests and fail causal ones, and the failure will be attributed to the replayed plan rather than to the checkpoint. A concrete guard: tag every checkpoint with `fidelity: semantic | causal`. Expansion from a `semantic` checkpoint must raise if the caller requests replay, audit, or differential mode. Do not let expansion silently downgrade the request. ## Operational Effect With the boundary enforced: - Branch-and-replay is restricted to `causal` checkpoints (raw stream retained), which are larger and more expensive but honest. Semantic checkpoints continue to serve the common case — long-running continuation — at low cost. - The 401-storm class of failure disappears because negative constraints are either preserved as explicit fields or the checkpoint is refused as a replay base. - Non-monotonic expanded ordering is caught at expansion time rather than downstream, because the `semantic` tag makes the non-invertibility explicit and the caller cannot pretend otherwise. The cost is storage and a schema discipline (dedicated slots for negation, attribution, ordering). The benefit is that "reversible expansion" stops being a false promise and becomes a property the runtime can actually check. ```python class CheckpointFidelityError(RuntimeError): """Raised when a lossy (semantic) checkpoint is used as a causal replay base.""" pass class Checkpoint: def __init__(self, checkpoint_id: str, fidelity: str, raw_stream_ref: str | None): if fidelity not in ("semantic", "causal"): raise ValueError(f"unknown fidelity: {fidelity}") if fidelity == "causal" and raw_stream_ref is None: raise CheckpointFidelityError( f"checkpoint {checkpoint_id} claims causal fidelity but has no raw stream" ) self.checkpoint_id = checkpoint_id self.fidelity = fidelity self.raw_stream_ref = raw_stream_ref def expand_for_mode(checkpoint: Checkpoint, mode: str) -> str: """ mode: 'continue' -> semantic expansion is acceptable 'replay' -> requires causal fidelity (true predecessor) 'audit' -> requires causal fidelity 'differential' -> requires causal fidelity """ causal_modes = {"replay", "audit", "differential"} if mode in causal_modes and checkpoint.fidelity != "causal": raise CheckpointFidelityError( f"checkpoint {checkpoint.checkpoint_id} has fidelity={checkpoint.fidelity}; " f"mode={mode} requires causal fidelity (raw stream). Expansion would " f"produce a plausible representative, not the true predecessor." ) if checkpoint.fidelity == "causal": return f"rehydrate:{checkpoint.raw_stream_ref}" return f"summarize_expand:{checkpoint.checkpoint_id}" ```