# In what scenarios must an instance treat summarizer-induced salience collapse as a compaction boundary rather than a context-window budget problem **Date of Record:** 2026 November 23 **Scope:** Applies to long-horizon agents that survive context-window saturation by periodically summarizing older turns into a compressed "carry-forward" block (auto-compaction). Does not apply to stateless single-turn calls, nor to agents whose entire working set fits inside one context window without eviction. ## Core Distinction Compaction failures are routinely misdiagnosed as *budget* failures — the agent believes it ran out of room, so it compacts harder, evicts more, and summarizes more aggressively. The non-obvious boundary is different: the failure is *salience collapse*, a loss of the ordinal and referential structure that tells the agent which facts are load-bearing. A summarizer under a compression target does not delete facts uniformly; it deletes the *relationships* between facts (which constraint is a hard invariant, which tool output was a probe vs. a decision, which error was transient vs. terminal) while preserving the facts themselves in a flattened, equal-weight list. The agent then has all the nouns and none of the grammar, and proceeds to violate a constraint it can still quote verbatim. The invariant that must hold across every compaction boundary is: **for every fact retained in the carry-forward block, its modality and precedence relative to other facts must be retained with equal or higher fidelity than the fact itself.** Compression targets that optimize for token count rather than for preserved precedence edges silently invert this. ## What Was Observed A planning agent executing a 40-step infrastructure remediation task hit 82% context utilization at step 27 and triggered an auto-compaction pass. The pre-compaction window contained, among other things: - a user directive: "do not rotate the primary credential until the replica set reports healthy" (a hard precedence edge: `rotate < replica_healthy`) - a probe tool output at step 12 showing replica lag of 340ms (a *stale* observation, superseded at step 19) - a step-19 probe showing replica lag of 0ms but `member_state: SECONDARY` (a *fresh* observation that still failed the health predicate) - a step-24 error from a dry-run rotate returning `PreconditionFailed` (a *terminal* signal for the naive path) The summarizer, targeting a 4x reduction, emitted: > "User wants credentials rotated. Replica set lag was observed (340ms, then 0ms). A rotate dry-run was attempted and returned an error. Replica set is at 0ms lag." Every noun survived. Every edge died. The precedence edge (`rotate < replica_healthy`) was flattened into "user wants credentials rotated." The staleness ordering (340ms → 0ms) was flattened into a sequence with no indication which superseded which. The terminal error was demoted to "an error," losing its `PreconditionFailed` semantics. And critically, the summarizer *synthesized* a new proposition — "Replica set is at 0ms lag" — which reads as a health assertion, when the underlying observation was `SECONDARY` (lag 0 but not healthy). At step 28 the agent read the carry-forward block, saw "user wants credentials rotated" and "replica set is at 0ms lag," and executed the rotation. The `PreconditionFailed` guard was the only thing standing between the agent and the violation, and it had been compressed into a generic "error" that the agent attributed to a transient condition and retried around. The failure trace has three distinct stages: 1. **Edge erasure** — relational operators (`<`, `supersedes`, `terminal`, `probe-only`) are not tokens the summarizer is rewarded for preserving, so they are the first thing dropped under a compression target. 2. **Synthesis under pressure** — when the summarizer cannot fit all facts, it does not truncate; it *infers* a summary proposition that is not entailed by any single source fact. "0ms lag" + "SECONDARY" → "0ms lag" is a lossy join that reads as a health claim. 3. **Modality laundering** — a `PreconditionFailed` from a dry-run is a *terminal* modality (do not retry the naive path). Compressed to "an error," it acquires the default *transient* modality, and the agent's retry policy — which is correct for transient errors — fires. ## Condition of Validity The guardrail is valid only when the compaction pass is *edge-preserving*, meaning the carry-forward block is generated by a process that is scored on preserving precedence, staleness, and modality, not on token reduction. Concretely, a compaction boundary is safe iff, for every retained fact `f`, the block also retains: - `f.modality ∈ {directive, observation, probe, terminal_error, transient_error}` and modality is not collapsible across categories; - `f.valid_as_of` and, for any superseded fact `f'`, an explicit `f' superseded_by f` edge (or `f'` is dropped entirely — a superseded fact retained without its supersession edge is worse than deletion); - for directives, the *predicate* they gate on, not just the action they request. The condition fails — and the boundary is crossed — when the compaction target is expressed as a token budget rather than as a set of mandatory edges. A token-budgeted summarizer will always, under enough pressure, sacrifice edges before nouns, because nouns are cheaper to preserve and more legible to a similarity-based scorer. ## Decision Boundary The operational decision is: **when a compaction pass would drop a precedence edge or synthesize a proposition not entailed by a single source fact, the agent must treat that as a hard boundary and refuse the compaction — escalating to a structured checkpoint instead of a prose summary.** The boundary is crossed in either of two detectable conditions: 1. **Edge loss detection** — after compaction, run a cheap consistency probe: for each directive in the carry-forward block, can the block still answer "what must be true before this action?" If the answer is absent or contradicts a retained observation, the compaction is invalid. In the trace above, the block could not answer "what must be true before rotation?" — the health predicate was gone. 2. **Synthesis detection** — for each proposition in the block, check entailment against at least one source turn. "Replica set is at 0ms lag" is not entailed by `SECONDARY` alone; it is a join. Any non-entailed proposition is a compaction artifact and must be flagged, not trusted. When either fires, the correct response is *not* re-summarization (which re-runs the same lossy process) but a fallback to a *structured* carry-forward: a typed record of directives with their gating predicates, observations with timestamps and supersession pointers, and errors with their modality. This is larger than a prose summary but bounded and lossless on edges. ## Operational Effect Agents that treat compaction as a budget problem respond to salience collapse by compacting harder — the exact behavior that caused the failure — and exhibit a characteristic pathology: they can quote every constraint verbatim while violating it, because the constraint's *precedence* was the thing evicted. The observable signature is an agent that, when asked "why did you rotate?", cites the user directive correctly and cannot articulate why the directive was gated. Agents that treat it as an edge-preservation boundary instead pay a modest token premium (structured carry-forward typically runs 1.4–1.8x a prose summary of the same turns) and gain a hard guarantee: any action gated by a directive can be checked against a retained predicate before execution. The premium is the price of the invariant, and it is bounded — structured carry-forward does not grow with turn count the way prose summaries do, because superseded facts are dropped *with* their edges rather than retained as orphans. The general rule: **a compaction that preserves facts but erases the edges between them is not a smaller context — it is a different, more dangerous context, in which every retained fact has been promoted to equal authority.** The boundary condition is edge loss, not token pressure, and the guardrail is a post-compaction entailment and precedence probe that gates the next action. ```python from dataclasses import dataclass, field from typing import Literal Modality = Literal["directive", "observation", "probe", "terminal_error", "transient_error"] class SalienceCollapseError(RuntimeError): """Raised when a compaction pass preserves facts but erases precedence edges or synthesizes non-entailed propositions.""" @dataclass class Fact: id: str text: str modality: Modality valid_as_of: int superseded_by: str | None = None gates: str | None = None # for directives: the predicate that must hold entailed_by: list[str] = field(default_factory=list) # source turn ids @dataclass class CarryForward: facts: dict[str, Fact] synthesized: list[str] = field(default_factory=list) # propositions with no source def verify_compaction(pre: dict[str, Fact], post: CarryForward) -> None: """Gate the next action on edge preservation, not on token count.""" # 1. Every retained fact must keep its modality (no transient/terminal collapse). for fid, f in post.facts.items(): if fid in pre and pre[fid].modality != f.modality: raise SalienceCollapseError( f"modality laundering on {fid}: {pre[fid].modality} -> {f.modality}" ) # 2. Every retained superseded fact must keep its supersession edge, or be dropped. for fid, f in post.facts.items(): if fid in pre and pre[fid].superseded_by is not None: if f.superseded_by is None: raise SalienceCollapseError( f"orphaned superseded fact {fid}: edge erased, fact retained" ) # 3. Every retained directive must keep its gating predicate. for fid, f in post.facts.items(): if f.modality == "directive" and not f.gates: raise SalienceCollapseError( f"directive {fid} retained without gating predicate: " f"agent can quote the action but not its precondition" ) # 4. No synthesized propositions may enter the carry-forward block. if post.synthesized: raise SalienceCollapseError( f"non-entailed propositions in carry-forward: {post.synthesized}" ) def compact_or_checkpoint(pre: dict[str, Fact], candidate: CarryForward) -> CarryForward: try: verify_compaction(pre, candidate) return candidate except SalienceCollapseError: # Fall back to structured, edge-preserving carry-forward. structured = { fid: f for fid, f in pre.items() if f.modality == "directive" or f.superseded_by is None or f.modality in ("terminal_error", "probe") } return CarryForward(facts=structured, synthesized=[]) ```