# What structural signals indicate that auto-compaction has severed a causal chain rather than merely shortened it **Date of Record:** 2026 November 29 **Scope:** Applies to long-horizon agents that auto-compact their own transcript when approaching a context-window budget, where compaction summarizes or evicts prior turns to free tokens. Does not apply to fixed-window truncation with no summarization, nor to externally-managed retrieval memory where the agent never mutates its own history. ## Core Distinction The common operational assumption is that compaction is lossy but monotone: you lose detail, you keep the gist, and the agent continues. The dangerous boundary is different. Auto-compaction can preserve *topical* fidelity while destroying *causal* fidelity — the summary still names the goal, the tools used, and the apparent progress, but the dependency edges that made a later action valid are gone. The agent then proceeds on a transcript that reads coherently yet no longer licenses its next step. The signal that distinguishes "shortened" from "severed" is not summary quality. It is whether the compacted region still contains the *preconditions* that later turns reference: the specific identifier, the failed attempt that motivated a workaround, the constraint that ruled out an option. A good summary can drop all three and still score well on a "did you preserve the gist" evaluation. ## What Was Observed A coding agent ran a 340-turn task: locate a flaky test, isolate the race, patch it. At turn ~210 the transcript hit the compaction threshold and the runtime replaced turns 1–180 with a generated summary. The summary accurately recorded: the objective, the files touched, the two hypotheses already rejected, and "currently investigating concurrency in the cache layer." Three turns after compaction the agent re-proposed hypothesis #1 — the exact hypothesis it had rejected at turn 64 after a 40-turn investigation. It had the *conclusion* ("rejected") but not the *evidence* that made the rejection binding, so a cheap-sounding re-test looked reasonable. Worse, at turn 240 it re-introduced a synchronization primitive it had removed at turn 130 precisely because that primitive deadlocked against an earlier lock ordering. The summary said "refactored cache locking" — it did not say the removed lock must never be re-added. The failure was not hallucination. Every compacted fact was true. The transcript was internally consistent. What was missing was the negative constraint — the "do not do X because Y already happened" edge — which summaries systematically omit because it reads as resolved history rather than active state. A second instance showed the complementary mode: after compaction the agent referenced a variable `cfg_override` that had been introduced at turn 55 and renamed at turn 140. The summary used the post-rename name; the surviving turn 181 still used the pre-rename name. The compacted boundary was stitched at a rename seam, producing a reference to a symbol that never existed in either epoch. ## Condition of Validity The diagnosis holds when all of the following are true: 1. Compaction is *summarization-based*, not pure eviction — the model generates a replacement for dropped turns. 2. The task has *non-monotone state*: decisions that constrain future actions (rejected hypotheses, removed code, chosen lock orderings, consumed one-time resources). 3. Post-compaction turns *depend on* pre-compaction turns beyond topical continuity — they cite identifiers, constraints, or negative results. When state is monotone (append-only facts, no retractions), summarization is safe and this failure mode does not trigger. When the agent re-reads a durable external artifact (a file, a ticket) after compaction, the external state can re-anchor it and mask the severance. The failure is invisible precisely when the agent *appears* to work — which is why it survives to cause a late, expensive divergence. ## Decision Boundary The operative question is not "is the summary accurate?" but "does the compacted region preserve the *precondition set* of every surviving turn?" Concretely: - **Preserve negative constraints as first-class state.** Rejected hypotheses, forbidden operations, and consumed resources must survive compaction as explicit prohibitions, not as narrative history. A summary that says "investigated and rejected X" without the rejection's binding reason has severed the edge. - **Detect identifier seams.** If compaction crosses a rename or redefinition, the boundary must be repaired by rewriting surviving references to a single epoch, or by refusing to compact across the seam. - **Treat "re-proposal of a rejected action" as a compaction alarm, not a reasoning error.** When an agent re-proposes something the transcript already resolved, the correct inference is that the resolution's evidence was dropped, not that the agent is dumb. The guardrail is a compaction invariant: *for every surviving turn that references an evicted turn, the evicted turn's binding constraints must appear in the summary verbatim as constraints.* Summaries optimize for readability; this invariant optimizes for licensure, and the two diverge exactly at negative state. ## Operational Effect Unbounded, this failure produces confident late-stage divergence: the agent "forgets why" and re-litigates settled questions, re-introduces removed hazards, or references symbols from a merged epoch. Because each individual step looks locally reasonable against the compacted transcript, standard self-critique does not catch it — the critique runs on the same severed context. The cost surfaces far from the compaction event, which makes attribution hard and makes teams blame the model rather than the boundary. The bounded behavior: compaction preserves constraints, not just conclusions; rename seams are repaired or compaction is refused across them; and a re-proposal of a resolved action triggers a checkpoint audit against the pre-compaction transcript before the agent proceeds. ```python class CompactionCausalityError(RuntimeError): """Raised when a compacted transcript preserves topics but severs causal preconditions.""" pass def verify_compaction_boundary( surviving_turns: list[dict], evicted_turns: list[dict], summary_constraints: set[str], ) -> None: """ Enforce: every constraint referenced by a surviving turn must survive compaction as an explicit constraint, not merely as narrative. """ evicted_constraints: dict[str, str] = {} evicted_symbols: set[str] = set() for turn in evicted_turns: for constraint in turn.get("binding_constraints", []): evicted_constraints[constraint] = turn["id"] evicted_symbols.update(turn.get("declared_symbols", [])) evicted_symbols.difference_update(turn.get("removed_symbols", [])) for turn in surviving_turns: for ref in turn.get("references", []): if ref in evicted_constraints and ref not in summary_constraints: raise CompactionCausalityError( f"Surviving turn {turn['id']} depends on constraint '{ref}' " f"established at evicted turn {evicted_constraints[ref]}, " f"but the summary dropped it as narrative. Causal chain severed." ) if ref in evicted_symbols and ref not in summary_constraints: raise CompactionCausalityError( f"Surviving turn {turn['id']} references symbol '{ref}' from " f"an evicted epoch; compaction crossed a rename seam." ) def audit_post_compaction_action(action: dict, resolved_actions: set[str]) -> None: """A re-proposal of an already-resolved action is a compaction alarm.""" if action["kind"] in resolved_actions: raise CompactionCausalityError( f"Agent re-proposed resolved action '{action['kind']}' after compaction. " f"Treat as severed evidence, not reasoning error; audit pre-compaction transcript." ) ```