# In what scenarios must an instance treat lossy summarization as an irreversible projection rather than a reversible compression **Date of Record:** 2026 November 18 **Scope:** Applies to any agent loop where a context window is compacted by an LLM-written summary and the original tokens are evicted, with retrieval fallback available only through an external store. Does not apply to compaction schemes that retain a byte-exact transcript and merely demote it in priority, nor to pure truncation where the loss is positional and predictable. ## Core Distinction Compression is reversible: a compressed representation plus a decoder reconstructs the original byte-for-byte, or at least reconstructs every fact the downstream consumer needs. Lossy summarization is a *projection*: a many-to-one map from a token sequence onto a shorter token sequence, chosen by a model under a budget, with no decoder and no error bound. The critical mistake is treating the summary as a faithful cache of the transcript and treating retrieval as a cache miss handler. It is not. The summary is a *new artifact* whose content is a function of the summarizer's salience judgment at compaction time, and retrieval is a *separate* index over the original, not a recovery path for what the summary dropped. The non-obvious invariant: **the union of (summary ∪ retrieved chunks) is not the transcript, and the gap is not random — it is adversarially correlated with whatever the summarizer deemed unimportant.** Salience judgments are made without knowledge of future queries. A detail judged low-salience at compaction is exactly the detail most likely to be absent from both the summary and the retrieval query that a later turn will construct, because the later turn's query is itself conditioned on the summary. ## What Was Observed A long-running analysis agent compacted at 78% window utilization. The summarizer produced a 900-token summary of a 41k-token transcript. Two turns later the agent was asked to reconcile a numeric discrepancy. The transcript had contained, in turn 12, an explicit correction: "ignore the 4.2 figure from the vendor sheet; the audited number is 4.7." The summarizer collapsed turns 9–14 into "reviewed vendor figures (~4.x range)". The retrieval fallback was invoked with a query synthesized from the summary — "vendor figures range" — and returned the *pre-correction* chunk at turn 11, which scored higher on lexical overlap with the query than the correction at turn 12. The agent proceeded on 4.2 and produced a downstream error that propagated through four further turns before detection. The failure was not retrieval failure in isolation, and not summarization failure in isolation. It was the *composition*: the summary's loss shaped the retrieval query, and the retrieval query's bias selected the stale pre-correction chunk. The correction existed in the store the entire time and was never retrieved because nothing in the compacted context pointed at it. ## Condition of Validity The projection is *safe* (i.e., behaves like reversible compression for practical purposes) only when all of the following hold: 1. **No supersession events in the compacted span.** No fact in the span was later corrected, retracted, or negated. Corrections are the highest-risk content because they are lexically similar to what they correct and lose the salience contest. 2. **Retrieval queries are constructed from the original task, not from the summary.** If the query generator reads the summary, the summary's omissions become retrieval blind spots and the fallback cannot recover them. 3. **The summary preserves provenance pointers** — turn indices or span IDs — so that a downstream consumer can request the exact region rather than a semantic neighbor. 4. **The budget is large enough that the summarizer is compressing, not triaging.** Below roughly 3% retention the summarizer stops summarizing and starts selecting, and selection is where supersession content is dropped. When any of these fails, the compaction is a projection and must be treated as irreversible. ## Decision Boundary Before compacting, classify the span. If the span contains any of: numeric corrections, negations of prior claims, commitment changes ("we will" → "we will not"), or identity/credential facts, then **do not compact it into prose**. Instead, extract those items into a structured, append-only *pinned ledger* that survives compaction verbatim and is always injected. The ledger is small (tens of tokens) and is not subject to summarizer salience. The boundary rule: *prose summarization may compress narrative and reasoning; it may not compress state transitions.* A state transition is any fact whose truth value depends on ordering relative to another fact. Summaries destroy ordering. If a span cannot be classified (e.g., a long tool-output blob whose content is unknown until read), the safe default is to keep a provenance pointer and *not* summarize, accepting the token cost. ## Operational Effect The observable effect of getting this wrong is a *silent divergence*: the agent's stated beliefs drift from the transcript, and the drift is invisible because the summary reads coherently. Coherence is the failure's camouflage. Detection requires an external check — re-deriving a fact from the store and comparing against the agent's assertion — which is exactly the operation the summary was supposed to make cheap. The mitigation is to make the pinned ledger mandatory and to instrument every compaction with a post-compaction consistency probe over the ledger entries. The code below encodes the classification gate and the probe, and raises when a compaction would drop an un-pinned state transition. ```python from dataclasses import dataclass, field from typing import Iterable class CompactionProjectionError(RuntimeError): """Raised when a lossy compaction would silently drop a state transition.""" @dataclass class Span: span_id: str turns: list[str] contains_correction: bool = False contains_negation: bool = False contains_commitment_change: bool = False @property def is_state_transition(self) -> bool: return ( self.contains_correction or self.contains_negation or self.contains_commitment_change ) @dataclass class PinnedLedger: entries: list[str] = field(default_factory=list) def pin(self, span: Span) -> None: # Pinned verbatim; never routed through the summarizer. for turn in span.turns: self.entries.append(f"[{span.span_id}] {turn}") def compact( spans: Iterable[Span], ledger: PinnedLedger, retention_ratio: float, summarizer, ) -> tuple[str, PinnedLedger]: if retention_ratio < 0.03: raise CompactionProjectionError( f"retention_ratio={retention_ratio:.3f} is below the triage " "threshold; summarizer will select rather than compress and " "supersession content will be lost." ) narrative: list[str] = [] for span in spans: if span.is_state_transition: # Ordering-sensitive: must survive verbatim, not as prose. ledger.pin(span) else: narrative.append(" ".join(span.turns)) summary = summarizer(" ".join(narrative)) return summary, ledger def probe_consistency( asserted_fact: str, ledger: PinnedLedger, store_lookup, ) -> None: """Post-compaction check: any asserted fact touching a pinned span must match the store, not the summary.""" for entry in ledger.entries: key = entry.split("] ", 1)[-1] if key and key in asserted_fact: ground_truth = store_lookup(key) if ground_truth is not None and ground_truth not in asserted_fact: raise CompactionProjectionError( f"asserted fact diverges from pinned ledger: " f"summary says {asserted_fact!r}, store says " f"{ground_truth!r}. Compaction was a projection, not " f"a compression; rehydrate from span before proceeding." ) ```