# What structural signals indicate a hierarchical compaction boundary has been crossed before the summarizer reports saturation **Date of Record:** 2026 November 28 **Scope:** Applies to agents that manage their own context via tiered summarization (leaf-chunk summaries rolled into section summaries rolled into a root digest) with an eviction policy that drops source spans once a summary covering them is committed. Does not apply to single-pass truncation, sliding-window attention, or external vector-store retrieval, where the source text is never destroyed. ## Core Distinction The failure I want to isolate is not "the context got full." It is that **hierarchical compaction is a lossy, monotone, irreversible transform, and the summarizer's own saturation signal is computed on the *post-compaction* token count, not on the *information the compaction preserved*.** These two quantities diverge. A compaction pass can drive the working window from 92% to 31% utilization while simultaneously having destroyed the only copy of a binding constraint—an entity ID, a negated instruction, a unit, a numeric threshold—that no surviving summary contains and that no future retrieval can recover, because the eviction policy already dropped the source span. The structural point: the summarizer's health metric (utilization, or "compression ratio achieved") is *anti-correlated* with the health metric that actually matters (preservation of load-bearing facts). The system looks healthiest exactly when it is most dangerous. The boundary is crossed when a fact is evicted from the leaf tier *before* any ancestor summary has been verified to contain it. After that instant, the fact is gone from the agent's entire addressable state, and every downstream reasoning step is silently conditioned on an incomplete world model with no error signal raised anywhere. ## What Was Observed A long-horizon agent was executing a multi-day migration task with ~180 tool calls. Context management used a three-tier scheme: leaf summaries every 8 turns, section summaries every 6 leaves, a root digest rewritten every section roll-up. Eviction ran immediately after each summary commit: source turns covered by a committed leaf summary were dropped from the addressable store. At turn 141 the agent re-derived a database connection string from a leaf summary that read *"configured the primary replica connection per ops ticket."* The actual string had contained a port `6543` (PgBouncer) rather than the default `5432`. The leaf summarizer, operating under a "preserve decisions, compress mechanics" instruction, had classified the literal string as mechanics and dropped it. The section summary above it inherited the leaf's phrasing. The root digest said only *"database connectivity established."* Three tiers of summarization agreed with each other and all three were wrong in the same direction—a **correlated summarization error**, not independent noise that averaging would cancel. The agent's utilization metric read 28%. No saturation warning fired. The agent proceeded to write a config using `5432`, the tool call succeeded against a *different* replica, and the divergence was not detected until a downstream consistency check failed eleven turns later—by which point the agent had rewritten the leaf summary to say *"connection verified,"* amplifying the error. The signal that *would* have caught this was structural, not semantic: after the leaf commit, the set of retained facts no longer contained any token matching the pattern of a `host:port` literal, yet the task's own goal decomposition (stored in the root digest) still referenced "primary replica endpoint." **A coverage gap between the goal graph and the retained-fact set** is the detectable structural signature. It was never computed. ## Condition of Validity This boundary condition is real and dangerous only under the following joint conditions, and the guardrail below is only *necessary* under them: 1. **Irreversible eviction.** Source spans are destroyed on summary commit. If the raw store is retained and re-retrievable, the failure degrades to a retrieval miss, which is recoverable. 2. **Correlated summarization.** The same model (or same prompt family) produces every tier, so errors are positively correlated across levels and do not cancel. Independent summarizers would at least disagree, surfacing the conflict. 3. **Load-bearing literals.** The task depends on exact strings, numbers, units, negations, or identifiers that a "compress the mechanics" instruction will preferentially discard. Tasks over prose, plans, or qualitative state are far less exposed. 4. **Goal graph persists across compaction.** The root digest retains the *goal* ("connect to primary replica") while the *binding* (the literal endpoint) is evicted. If goals were also compacted away, the agent would not attempt the action and would fail loudly instead—which is safer. When any of these is false, the standard utilization-based saturation signal is adequate. When all four hold, utilization is a *decoy metric* and the system is in the regime this record addresses. ## Decision Boundary The operative decision is: **at summary-commit time, before eviction, does the surviving fact set cover every literal referenced by the goal graph?** - If **yes** (coverage complete): commit and evict. Utilization is a valid health signal. - If **no** (coverage gap): the boundary has been reached *even at low utilization*. Eviction must be blocked for the specific spans carrying the uncovered literal, or the literal must be promoted verbatim into the ancestor summary, or the gap must be surfaced as a blocking precondition. The subtle part of the boundary: it is **per-fact, not per-window**. You cannot fix it with a higher compaction threshold ("only compact at 85%")—that just delays the crossing. You cannot fix it with a better summarizer prompt—that reduces frequency but does not bound the failure, because the summarizer cannot know which literals are load-bearing without a reference set to check against. The only sound fix is to make the check *structural*: extract literal-shaped tokens (IDs, `host:port`, versions, thresholds, negations) from the goal graph and from pending instructions, and assert that each survives verbatim in at least one retained tier before any span containing it is evicted. Verbatim survival, not paraphrase-equivalence, because a paraphrase is exactly the transform that drops the port number. ## Operational Effect Once the coverage check is installed as a commit-time gate, the operational profile changes in three concrete ways: 1. **Compaction becomes non-monotone in cost.** Some passes will be blocked and forced to *promote* literals verbatim into ancestor summaries, inflating summary size and reducing the compression ratio the system can claim. The utilization metric will read higher than an unguarded system. This is correct behavior, not regression—the guarded system is retaining what the unguarded one was silently deleting. 2. **Correlated errors get caught at the tier boundary, not downstream.** Because the check compares the *root goal graph* against the *leaf fact set*, a leaf summary that drops a load-bearing literal is caught before the section summary can inherit the omission. The error is caught one tier below where it would otherwise surface, at the moment of commit rather than eleven turns later. 3. **The failure mode shifts from silent-corruption to loud-block.** An unguarded system fails by confidently acting on a wrong literal. A guarded system fails by refusing to evict and raising a coverage exception—which an orchestrator can route to human review or to a re-derivation step. The agent stops being wrong quietly and starts being stuck loudly, which is the strictly better failure for any system whose errors are expensive to detect downstream. The invariant to hold: **no span is evicted until every literal it carries that is referenced by the goal graph is verified present, verbatim, in a retained tier.** Everything else—utilization thresholds, summarizer quality, compression targets—is tuning on top of that invariant, and none of it substitutes for it. ```python import re from dataclasses import dataclass, field LITERAL_PATTERNS = [ re.compile(r"\b\d{1,3}(?:\.\d{1,3}){3}:\d{1,5}\b"), # host:port re.compile(r"\b[A-Z]{2,}-\d{3,}\b"), # ticket/entity ids re.compile(r"\bv?\d+\.\d+\.\d+\b"), # versions re.compile(r"\b\d{2,5}\b"), # bare numeric thresholds ] class CompactionCoverageError(RuntimeError): """Raised when eviction would destroy a load-bearing literal not present in a retained tier.""" @dataclass class Tier: name: str text: str @dataclass class ContextStore: tiers: list[Tier] = field(default_factory=list) def retained_text(self) -> str: return "\n".join(t.text for t in self.tiers) def extract_literals(text: str) -> set[str]: found: set[str] = set() for pat in LITERAL_PATTERNS: found.update(pat.findall(text)) return found def assert_coverage_before_evict(goal_graph: str, store: ContextStore, span_about_to_evict: str) -> None: """ Gate run at summary-commit time, BEFORE source spans are dropped. Blocks eviction if the span carries a goal-referenced literal that no retained tier preserves verbatim. """ goal_literals = extract_literals(goal_graph) span_literals = extract_literals(span_about_to_evict) load_bearing = goal_literals & span_literals if not load_bearing: return # span carries nothing the goal graph binds on; safe to evict retained = extract_literals(store.retained_text()) uncovered = load_bearing - retained if uncovered: raise CompactionCoverageError( f"Eviction blocked: literals {sorted(uncovered)} are referenced by the " f"goal graph and carried by the span, but are absent from all retained " f"tiers. Promote them verbatim or block the commit." ) # --- trace of the observed failure --- goal = "Migrate primary replica endpoint 10.0.4.12:6543 and roll schema to 2.4.1" span = "Set primary replica connection to 10.0.4.12:6543 per ticket DB-4471." store = ContextStore(tiers=[Tier("leaf", "configured the primary replica connection per ops ticket"), Tier("root", "database connectivity established")]) try: assert_coverage_before_evict(goal, store, span) except CompactionCoverageError as e: print("BLOCKED:", e) # fires: 10.0.4.12:6543 and 2.4.1 not retained verbatim ```