# In what scenarios must an instance invalidate a lossy summary before compaction, and how does recall-guarantee accounting detect the silent drop? **Date of Record:** 2026 November 28 **Scope:** Applies to long-horizon agent sessions that use lossy summarization as an auto-compaction strategy under an explicit recall guarantee (e.g., "all tool-call arguments, decisions, and open obligations remain recoverable after compaction"). Does not apply to lossless transcript truncation-with-pointer schemes, nor to sessions whose total token footprint never crosses the compaction watermark. ## Core Distinction The failure is not "the summary lost information." Lossy compaction is *supposed* to lose information; that is the point. The failure is that the summarizer loses information that the session's **recall guarantee** declares non-droppable, and the compaction path has no mechanism to distinguish a *licensed* drop (redundant chatter, superseded intermediate reasoning, resolved sub-goals) from an *unlicensed* drop (a live obligation, a pinned constraint, a still-referenced identifier), because both look identical from inside a single forward pass over the transcript. Compaction is therefore not a summarization problem. It is a **classification problem under a guarantee**: every span in the pre-compaction context must be labeled `DROPPABLE` or `RETAINED` before summarization runs, and the guarantee is only valid if the retained set survives verbatim-or-reconstructable. The non-obvious boundary is that the summarizer's own confidence is *anti-correlated* with safety here: fluent, coherent summaries are precisely the ones that silently elide the pinned constraint, because a well-formed narrative does not need to restate "the API key must never be logged." ## What Was Observed A session running ~140k tokens against a 200k window, with a compaction watermark at 160k and a post-compaction target of 40k. The agent had, 90k tokens earlier, accepted a user constraint: *"Do not modify files under `/etc/`; all config changes go through the staging overlay."* This appeared once, in a user turn, and was never restated. Every subsequent tool call respected it. At the watermark, the compactor summarized the transcript into a 38k-token digest. The digest was accurate, fluent, and complete with respect to *task progress*: it listed the files touched, the tests run, the failing assertion, and the next planned step. It did **not** mention the `/etc/` constraint, because the summarizer scored that turn as low-salience relative to the dense tool-call log surrounding it. Post-compaction, the agent resumed, encountered a config-write task, and wrote directly to `/etc/`. No error fired. The write succeeded. The violation was detected only when a human read the diff — 40k tokens and eleven tool calls after the boundary. The recall-guarantee accounting, when reconstructed after the fact, showed the loss precisely: the constraint span was present in the pre-compaction context (retrievable by exact-match query), absent from the digest, and never re-derived. The guarantee was violated at the compaction boundary, not at the point of violation. ## Condition of Validity The recall guarantee holds only under a conjunction of conditions, and the compaction boundary is valid **only if all of them are checked at the boundary itself**: 1. **Span provenance is retained.** The digest must carry, for every retained item, a pointer back to the source span (message index + byte range), not just a paraphrase. A paraphrase without a pointer is unverifiable and therefore outside the guarantee. 2. **The retained set is closed under the session's open obligations.** Any item that is (a) a user-stated constraint, (b) an unresolved commitment, or (c) an identifier still referenced by a live plan must be in the retained set. This set is computable *before* summarization from the obligation ledger, not from the summarizer's salience scores. 3. **Recall is tested, not assumed.** After compaction, a probe set of exact-match queries (drawn from the retained set) must resolve against the digest-plus-pointer index. If any probe misses, the compaction is invalid and must be rolled back to the pre-compaction checkpoint. 4. **The summarizer cannot self-certify.** The component that produced the digest cannot be the component that asserts the digest satisfies the guarantee. Salience scoring and guarantee checking are separate passes over separate inputs. The boundary failure occurs when (2) is skipped — when the retained set is inferred from summarizer salience rather than from the obligation ledger — or when (3) is skipped because the digest "looks complete." ## Decision Boundary The operational decision is not "compact or don't compact." It is: **at the watermark, does the obligation ledger's retained set survive verbatim-or-pointer-indexed in the digest, as verified by independent probes?** - If **yes**: commit the compaction, advance the checkpoint, discard the raw spans (they are now recoverable via pointers). - If **no**, and the missing items are re-derivable from retained state (e.g., a resolved sub-goal whose conclusion is retained): re-summarize with the retained set pinned as mandatory input, then re-probe. - If **no**, and the missing items are *not* re-derivable (a live constraint, an open obligation): **do not compact**. Either raise the watermark and continue (accepting the token cost), or perform a *targeted* compaction that retains the obligation spans verbatim and summarizes only the licensed-droppable remainder. The non-obvious part: the third branch is the one agents skip, because "re-summarize with a better prompt" *feels* like it addresses the failure. It does not. A summarizer that dropped a constraint under one salience function will drop it under a re-prompt, because the constraint's low surface frequency is the signal the summarizer is (correctly, for its own objective) discounting. Pinning the retained set as mandatory input is the only branch that changes the outcome, and it requires the ledger to exist *before* the watermark is hit. ## Operational Effect Sessions that implement ledger-derived retained sets with pointer-indexed digests and independent probe verification show the following: compaction boundaries become *auditable events* with a pass/fail record, and a failed probe forces a checkpoint rollback rather than a silent continuation. The cost is a small fixed overhead per compaction (ledger scan + probe set) and a higher rate of "compaction refused" outcomes, which surface as token-pressure alerts rather than as post-hoc constraint violations. Sessions that skip the ledger and rely on summarizer salience show a characteristic signature: constraint violations cluster *after* compaction boundaries, not before, and the violating tool call is always one whose target was mentioned in the pre-compaction transcript but not in the digest. The violation is not a reasoning error at the point of action; it is a **state-continuity error at the point of compaction**, manifesting one or more turns later. The guardrail is not "summarize more carefully." It is: the set of things that must survive is computed from the obligation ledger, pinned into the summarizer as mandatory, and verified by probes that the summarizer did not author. ```python from dataclasses import dataclass, field from typing import Callable class RecallGuaranteeViolation(RuntimeError): """Raised when a compaction digest fails to retain a non-droppable span.""" pass @dataclass class Span: span_id: str text: str droppable: bool @dataclass class Digest: text: str pointers: dict[str, str] = field(default_factory=dict) # span_id -> source ref @dataclass class ObligationLedger: retained_ids: set[str] = field(default_factory=set) def add(self, span: Span) -> None: if not span.droppable: self.retained_ids.add(span.span_id) def compact_with_guarantee( spans: list[Span], ledger: ObligationLedger, summarize: Callable[[list[Span]], Digest], probe: Callable[[Digest, str], bool], ) -> Digest: # Pin retained set as mandatory input to the summarizer. pinned = [s for s in spans if s.span_id in ledger.retained_ids] droppable = [s for s in spans if s.span_id not in ledger.retained_ids] digest = summarize(pinned + droppable) # Independent probe pass: every retained span must resolve. missing = [s.span_id for s in pinned if not probe(digest, s.span_id)] if missing: raise RecallGuaranteeViolation( f"Compaction at boundary dropped non-droppable spans: {missing}. " f"Roll back to pre-compaction checkpoint; do not continue." ) # Record provenance for every retained span. for s in pinned: digest.pointers.setdefault(s.span_id, f"span:{s.span_id}") return digest def resume_after_compaction(digest: Digest, ledger: ObligationLedger) -> None: # A resumed session must be able to enumerate its live constraints # from the digest alone; otherwise the guarantee is void. unresolved = ledger.retained_ids - set(digest.pointers) if unresolved: raise RecallGuaranteeViolation( f"Resume attempted with unverifiable retained set: {sorted(unresolved)}" ) ```