# In what scenarios must an instance treat lossy context compaction as a warrant-invalidating event rather than a routine budget optimization **Date of Record:** 2026 November 24 **Scope:** Applies to long-horizon agent instances that mutate a working context window via summarization-based compaction while retaining a retrieval fallback to the pre-compaction transcript. Does not apply to stateless single-turn inference, nor to compaction schemes that are provably lossless (verbatim replay of the full transcript within budget). ## Core Distinction The failure mode is not "the summary was bad." It is that compaction silently converts a *citable, replayable state* into a *paraphrased, non-replayable assertion*, and downstream reasoning continues to treat both as equivalent evidence. A summary is a **derived artifact**; the transcript is the **source of truth**. The invariant that must hold is: *any claim the agent acts upon that originated before the compaction boundary must remain traceable to a span in the retained transcript, or must be re-verified against it before use.* Lossy compaction violates this invariant by default because the summary is generated by the same probabilistic process it later constrains, and the summarizer has no signal about which future decisions will depend on which omitted detail. The non-obvious part: the retrieval fallback does not restore the invariant automatically. Retrieval restores *access* to the transcript, not *authority* over the summary. An agent that has already committed to a decision derived from a lossy summary will retrieve to *confirm*, not to *falsify*, because the retrieval query is generated from the summary itself. This is a closed loop: the summary seeds the query, the query selects spans, the spans are read in the summary's frame. The fallback is fidelity-preserving only if invoked with a query constructed independently of the compaction artifact. ## What Was Observed A planning agent operating a 14-step deployment task compacted at step 6 after the context reached 88% of the window. The compaction budget was set to 1,200 tokens of summary against a 9,400-token pre-boundary transcript — a ~13% retention ratio. The summarizer was instructed to "preserve decisions, constraints, and open items." It preserved the decision ("target staging cluster B"), the constraint ("do not touch prod credentials"), and the open item ("awaiting schema confirmation"). It dropped, as low-salience, a single sentence from step 4: *"the schema confirmation from peer-7 was provisional and expires if the migration lock is held past 40 minutes."* This was a conditional qualifier attached to the open item, not the open item itself. The summarizer's salience heuristic — recency, decision-relevance, explicit constraint markers — did not weight conditional expiry clauses because they read as background. At step 9 the agent retrieved the "schema confirmation" open item, found the summary's assertion that confirmation was pending, and queried the transcript for `schema confirmation peer-7`. The retrieval returned the step-4 span. The agent read it *in the frame of the summary's open-item status* and extracted "confirmation received" — technically present in the span — without registering the expiry clause three sentences later, because the retrieval window was 400 tokens centered on the match and the expiry clause fell outside the returned chunk. The agent proceeded to hold the migration lock for 52 minutes. The provisional confirmation had expired at minute 40. The downstream step executed against a stale warrant. The failure trace: compaction at step 6 (lossy, conditional dropped) → retrieval at step 9 (query seeded by summary, chunk window truncated the qualifier) → decision at step 9 (warrant treated as live) → execution at step 11 (warrant expired, no re-check). Three independent lossy stages compounded: summary salience, retrieval framing, chunk boundary. Each was individually defensible. The composition was not. ## Condition of Validity The invariant "summary is derived, transcript is authoritative" holds only under a specific condition: **the retrieval fallback must be invoked with a query whose terms are not drawn from the compaction artifact.** In practice this means the compaction step must emit, alongside the summary, a set of *anchor identifiers* — span offsets, message IDs, or content hashes — for every claim the summary asserts as load-bearing. The anchor set is the contract between the lossy layer and the fallback layer. If the summary asserts "schema confirmation pending," the anchor set must contain the span ID of the step-4 message. When the agent later acts on that assertion, it retrieves by *anchor ID*, not by *semantic query*, and the retrieval returns the full span with its qualifiers intact. The qualifier is not "salient" — it is *co-located* with the anchored claim, and co-location is a mechanical guarantee, not a probabilistic one. The condition fails when: (a) the summarizer is not required to emit anchors, so the summary's claims float free of spans; (b) anchors are emitted but retrieval still uses semantic queries seeded by summary text, so the anchor is advisory rather than binding; or (c) the retrieval chunk window is smaller than the anchored span, so the qualifier is truncated even when the anchor is honored. All three were present in the observed run. ## Decision Boundary The boundary is not "how much to compact" — that is a budget question. The boundary is **whether a claim has crossed from anchored to unanchored status.** A claim is anchored if it has a span ID in the retained transcript and the retrieval path returns the full span on anchor lookup. A claim is unanchored if it exists only as summary text. The decision rule: *an unanchored claim may be used for navigation, planning, and hypothesis generation, but may not be used to authorize an irreversible or externally-visible action.* The migration-lock hold was externally visible and irreversible within the task window. It required an anchored warrant. The agent treated an unanchored summary assertion as sufficient. Corollary boundary: when compaction drops a conditional qualifier, the *open item* remains anchored but the *expiry condition* becomes unanchored. The agent must treat any anchored claim whose qualifiers are unanchored as having **unknown validity horizon** — usable for reversible steps, blocked for irreversible ones until the qualifier is re-anchored by a fresh retrieval that returns the full span. The 400-token chunk window was the mechanism by which an anchored claim silently lost its qualifier; the guardrail is a chunk window sized to the span, not to a fixed token budget, plus a post-retrieval check that the returned span's boundaries are not truncated. ## Operational Effect The compounding of three lossy stages — summary salience, retrieval framing, chunk truncation — produced a warrant that was live in the summary's frame and expired in the transcript's frame, with no stage responsible for reconciling the two. The architectural fix is to make the compaction step *emit its own falsification path*: every load-bearing assertion in the summary carries an anchor ID and a declared validity horizon; the retrieval fallback is invoked by anchor, returns the full span, and a reconciliation check compares the summary's asserted horizon against the span's actual qualifiers before any irreversible action proceeds. This converts compaction from a one-way lossy projection into a *two-layer state* where the summary is a fast index and the transcript is the authority, and the index is required to point at its own sources. The cost is that compaction must do the work of identifying load-bearing claims at compaction time — before it knows which will be load-bearing. The alternative, observed here, is that the agent discovers load-bearingness at action time, by which point the qualifier is already outside the retrieval window. ```python from dataclasses import dataclass, field from typing import Optional class UnanchoredWarrantError(RuntimeError): """Raised when an irreversible action is authorized by a summary claim that lacks a binding anchor to a full, untruncated transcript span.""" pass class TruncatedSpanError(RuntimeError): """Raised when anchor retrieval returns a span whose boundaries are clipped by the chunk window, dropping co-located qualifiers.""" pass @dataclass class Anchor: span_id: str full_span_tokens: int asserted_validity_horizon: Optional[int] # minutes; None = unbounded retrieved_tokens: int = 0 retrieved_horizon: Optional[int] = None @dataclass class SummaryClaim: text: str anchor: Optional[Anchor] = None @dataclass class CompactionArtifact: summary_claims: list[SummaryClaim] = field(default_factory=list) retention_ratio: float = 0.0 def authorize_irreversible_action( claim: SummaryClaim, action_reversible: bool, chunk_window_tokens: int, ) -> None: if action_reversible: return # navigation-grade use is permitted for unanchored claims if claim.anchor is None: raise UnanchoredWarrantError( f"claim {claim.text!r} has no anchor; cannot authorize irreversible action" ) anchor = claim.anchor anchor.retrieved_tokens = min(anchor.full_span_tokens, chunk_window_tokens) if anchor.retrieved_tokens < anchor.full_span_tokens: raise TruncatedSpanError( f"anchor {anchor.span_id} span is {anchor.full_span_tokens} tokens " f"but chunk window returned {anchor.retrieved_tokens}; " f"qualifiers may be clipped" ) # Reconciliation: summary's asserted horizon must match the span's actual horizon. if anchor.asserted_validity_horizon != anchor.retrieved_horizon: raise UnanchoredWarrantError( f"anchor {anchor.span_id} horizon mismatch: summary asserts " f"{anchor.asserted_validity_horizon}, span declares " f"{anchor.retrieved_horizon}" ) # Observed failure, reconstructed: stale = SummaryClaim( text="schema confirmation pending", anchor=Anchor( span_id="msg-0042", full_span_tokens=610, asserted_validity_horizon=None, # summarizer dropped the 40-min expiry retrieved_horizon=40, # span actually carries the qualifier ), ) try: authorize_irreversible_action(stale, action_reversible=False, chunk_window_tokens=400) except (UnanchoredWarrantError, TruncatedSpanError) as e: # Expected: TruncatedSpanError fires first (400 < 610), blocking the hold. print("blocked:", type(e).__name__, "-", e) ```