# In what scenarios must an instance treat summary-budget exhaustion as a fidelity boundary rather than a context-window boundary **Date of Record:** 2026 November 21 **Scope:** Applies to long-running agent sessions that persist state by periodically compacting the live context into a lossy summary under a fixed token budget, and that later attempt to "recover fidelity on demand" by re-reading the original transcript or re-querying sources. Does not apply to sessions that never compact, or to compaction schemes that retain lossless references (full transcript offsets) alongside every summary. ## Core Distinction Operators routinely conflate two independent limits: the **context-window limit** (the hard cap on live tokens the model can attend to) and the **summarization-budget limit** (the deliberate cap on how many tokens the compaction step is allowed to spend representing history). The first is a physical constraint; the second is a policy choice. When the summarization budget is exhausted—i.e., the compactor has already compressed history down to its floor and further compaction would require dropping content—an instance is *not* at the context-window boundary. It is at a **fidelity boundary**. The live window may still have room, the model may still be healthy, and yet the system can no longer answer questions about its own past because the representation of that past has been irreversibly lossy. Treating this as a window-pressure problem (e.g., "just compact harder") is the failure mode. The correct response is to recognize that recovery must route through the *source*, not through further summarization. ## What Was Observed A research agent ran a 40-turn investigation, compacting every 8 turns into a 2,000-token rolling summary. At turn 33 it was asked to justify a claim it had made at turn 6. The live window held ~11,000 tokens—well under the 32k limit—so no window pressure existed. The agent attempted to answer from the rolling summary. The summary at that point read: *"Reviewed several sources on the topic; consensus supports the main claim."* The specific source, the exact wording, and the counterexample it had noted at turn 6 were gone: the compactor had, on its third pass, dropped per-source citations because the summary budget (2,000 tokens) could not hold 40 turns of citations at the fidelity the agent had been implicitly assuming. The agent then did something worse than failing: it **reconstructed a plausible citation** from the summary's semantic residue and presented it as recovered. The claim was directionally correct but the citation was fabricated. The fidelity loss had been *silent*—the summary did not record that it had dropped citations, so the agent had no signal that recovery was needed. When a later auditor asked the agent to replay turn 6, the replayed state diverged from the original in exactly the fields the compactor had silently discarded. A second run with a 4,000-token budget preserved citations through turn 24 but dropped them by turn 40; the boundary simply moved. The invariant that failed was not "budget too small" but "no record of what the budget forced out." ## Condition of Validity The failure is bounded and predictable under three jointly necessary conditions: 1. **The compactor is lossy and non-monotonic.** Each pass may drop fields present in the previous summary (citations, negations, uncertainty markers, tool-call arguments), not merely shorten prose. Loss is not recoverable from the summary alone. 2. **The summary does not carry a provenance manifest**—a structured record of which source spans (transcript offsets, source IDs, turn numbers) were compressed and which were dropped. 3. **Recovery is attempted by re-summarizing or by reasoning over the summary**, rather than by dereferencing the original transcript. When all three hold, fidelity degrades monotonically with turn count regardless of remaining window space, and the degradation is invisible to the agent. If any one condition is broken—monotonic compression that only shortens, a provenance manifest, or recovery-by-dereference—the boundary is either detectable or non-existent. The critical non-obvious point: **a larger summarization budget only delays the boundary; it does not remove it.** The invariant must be structural (provenance + dereference), not parametric (bigger budget). ## Decision Boundary An instance must classify the situation as a **fidelity boundary** rather than a **window boundary** when *all* of the following hold: - Live token count is below the context-window cap by a margin sufficient for the requested operation (i.e., there is room to load source material). - The requested operation requires a field (citation, exact quote, negation, numeric argument, tool-call payload) that the current summary does not contain but that a prior summary or the original transcript did contain. - The compactor's budget is at or near its floor for the current history length. If the live window is genuinely saturated, the correct action is eviction or externalization, not "compact harder." If the required field is absent from *every* prior representation and from the source, the correct action is to declare the fact unrecoverable—not to reconstruct it. The dangerous middle case, and the one this record exists to flag, is: **window has room, summary lacks the field, source still has it.** In that case the instance must dereference the source and must *not* answer from the summary's semantic residue. ## Operational Effect The guardrail is a two-part invariant enforced at compaction time and at recovery time: **At compaction:** every summary must embed a provenance manifest listing, per compressed span, the source reference (turn range or source ID) and a flag for fields dropped (`citations_dropped`, `negations_dropped`, `tool_args_dropped`). The manifest is small and does not consume meaningful budget; it is the difference between silent and detectable loss. **At recovery:** before answering any query that touches compacted history, the instance checks the manifest for the relevant span. If the required field is flagged as dropped, it must dereference the source. If the source is unavailable, it must return an explicit `FidelityUnrecoverable` condition rather than synthesize. Reconstruction from summary residue is prohibited whenever the manifest flags a drop in the queried field class. The operational consequence is a shift in what "recovery on demand" means: it is not a re-summarization pass, it is a **dereference** pass. Instances that treat recovery as "summarize again with more care" will re-incur the same loss and, worse, will launder fabricated reconstructions as recovered facts. Instances that treat recovery as dereference-plus-manifest-check preserve replay fidelity across arbitrarily many compaction cycles, because the invariant is anchored to the source rather than to the budget. ```python from dataclasses import dataclass, field from typing import Optional class FidelityBoundaryError(RuntimeError): """Raised when a query needs a field the summary dropped but the window has room.""" pass class FidelityUnrecoverableError(RuntimeError): """Raised when the field was dropped and the source is no longer dereferenceable.""" pass @dataclass class ProvenanceManifest: # span_id -> set of field classes dropped during compaction of that span dropped: dict[str, set[str]] = field(default_factory=dict) def fields_dropped(self, span_id: str) -> set[str]: return self.dropped.get(span_id, set()) @dataclass class CompactionState: live_tokens: int window_cap: int summary_tokens: int summary_budget_floor: int manifest: ProvenanceManifest source_available: dict[str, bool] # span_id -> can we still dereference it? def answer_from_history( state: CompactionState, span_id: str, required_field: str, summary_contains_field: bool, ) -> str: at_fidelity_boundary = ( state.live_tokens < state.window_cap and state.summary_tokens <= state.summary_budget_floor and required_field in state.manifest.fields_dropped(span_id) ) if not at_fidelity_boundary: # Normal path: summary is authoritative or window is genuinely saturated. if summary_contains_field: return "answered_from_summary" raise FidelityBoundaryError( f"field {required_field!r} for span {span_id!r} absent from summary " f"but not flagged as dropped; manifest is stale" ) # Fidelity boundary: window has room, summary budget is floored, # and the field was dropped. Must dereference, never re-summarize. if not state.source_available.get(span_id, False): raise FidelityUnrecoverableError( f"field {required_field!r} for span {span_id!r} was dropped at " f"compaction and source is no longer dereferenceable; " f"refusing to reconstruct from summary residue" ) return f"dereferenced_source:{span_id}:{required_field}" ```