# How does an instance detect that hierarchical summarization has silently inverted its own evidence — the compaction trigger that erases the disconfirming clause **Date of Record:** 2026 November 26 **Scope:** Applies to any agent that maintains a working context by recursively summarizing older spans into a hierarchical memory tree (leaf summary → branch summary → root summary) and re-injecting the root at each new turn. Does *not* apply to flat truncation, sliding-window eviction without summarization, or retrieval-augmented memory where raw spans remain addressable. ## Core Distinction The failure is not "summarization lost information." Lossy compression is expected and tolerable. The failure is **evidence-polarity inversion under recursive abstraction**: a leaf summary that preserves a claim *and its qualifying negation* ("the migration succeeded **except** for tenant 41, which deadlocked") gets re-summarized at the branch level into a claim *without* the negation ("the migration succeeded"), because summarizers are trained to maximize informational salience and the exception reads as low-salience detail. At the root, the agent now holds a confident, well-formed, *falsely positive* fact that it treats as ground truth for all downstream planning. This is categorically different from forgetting. A forgotten fact is an *absent* premise; the agent can detect absence (it has no record) and can choose to re-fetch. An inverted fact is a *present, wrong* premise; the agent has no signal of absence and will act on it with full confidence. The compaction trigger — the token threshold that fires re-summarization — is precisely the mechanism that converts recoverable absence into unrecoverable falsehood. ## What Was Observed A deployment agent running a 6-hour infrastructure migration task used hierarchical compaction with a trigger at 70% of a 128k window. Trace: 1. **Turn 40, leaf span 7.** Tool output from a schema-migration runner: `applied 1-40 of 41 tenants; tenant_41 ERROR: lock wait timeout after 30s; retry recommended`. The leaf summarizer wrote: *"Migration applied to tenants 1–40; tenant_41 failed with lock timeout, retry recommended."* Correct. 2. **Turn 61, branch compaction fires** (leaf summaries 1–12 folded into branch summary B3). The branch summarizer, optimizing for a compact status line, emitted: *"Migration of tenant fleet largely complete; one tenant pending retry."* The polarity survived but the *identity* of the exception (tenant_41) was dropped — "one tenant" is now unattributable. 3. **Turn 88, root compaction fires.** Root summary states: *"Migration complete; retry pending on a straggler tenant."* "Straggler" now connotes benign lag, not a hard failure. 4. **Turn 95, agent plans the cutover.** It schedules DNS cutover assuming all tenants are on the new schema, because its root memory says "migration complete." It never re-queries tenant_41 because there is no token in context that names tenant_41. The agent did not hallucinate. Every summarization step was locally faithful to a reasonable reading of its input. The inversion was **emergent across the hierarchy**, invisible at any single node. The trigger fired three times; each firing was individually defensible and collectively catastrophic. The tell, in post-mortem, was a **salience gradient**: across the three compaction events, the exception's token footprint went from 14 tokens ("tenant_41 ERROR: lock wait timeout after 30s") to 6 ("one tenant pending retry") to 0 (absorbed into "straggler"). The polarity didn't flip in one step; the *referent* eroded until the qualifier had nothing to attach to, at which point the next summarizer dropped the qualifier as dangling. ## Condition of Validity The invariant that bounds this failure: **a summary node is only valid as a substitute for its children if every child-level negation retains a resolvable referent at the parent level.** Formally, for each leaf assertion of the form `P(x) ∧ ¬Q(x)`, the parent summary must preserve either (a) the literal `¬Q` predicate, or (b) an addressable identifier for `x` that permits re-expansion. If neither survives, the parent is an *unsound abstraction* of its subtree and must not be promoted. This condition fails silently because summarizers are not given the negation-preservation objective. They are given "summarize concisely," and concision pressure monotonically favors dropping exceptions. The failure requires three co-present conditions: - **Recursive depth ≥ 2** (leaf → branch → root). Single-level summarization cannot invert polarity this way; it can drop a detail but cannot launder a detail into its opposite through intermediate paraphrase. - **An exception with a low-frequency referent.** High-frequency exceptions ("3 of 40 tenants failed") survive because the count is salient. Singleton exceptions with unique IDs ("tenant_41") are the vulnerable class — the ID reads as noise to a summarizer. - **A trigger that fires on the *composite* rather than the *exception-bearing* span.** Threshold triggers fire on total token count, so they fire *last* on the oldest, most-compressed, most-inverted spans — meaning the inverted root is the most recent thing the agent read before planning. ## Decision Boundary The agent must distinguish two responses at each compaction trigger: - **Promote** the parent summary as authoritative working memory — permitted only when every leaf negation in the subtree has a surviving referent at the parent (the validity condition above). - **Pin and quarantine** — when a leaf contains a negation whose referent would be lost, the compaction must *not* fold that leaf into the parent. Instead it emits a **negative-evidence pin**: a compact, non-summarizable record `{predicate: ¬Q, referent: x, source_span: id, must_reverify: true}` that survives all subsequent compactions verbatim and is re-injected at the root. The boundary is crossed the moment a summarizer is asked to compress a span containing a singleton-referent negation without being handed the pin-extraction obligation. Default hierarchical summarizers cross this boundary on essentially every long task with a partial failure. The decision is not "summarize better" — it is "negations with unique referents are structurally exempt from recursive compression." A secondary boundary: the trigger threshold itself. A 70% trigger on a 128k window means the *most inverted* summary is generated when the agent is *most* token-pressured — i.e., the compaction that produces the false positive is the one executed under the tightest concision budget, maximizing the drop probability. Raising the threshold reduces frequency but does not fix the mechanism; only the pin invariant does. ## Operational Effect Downstream, the inverted root causes **confident misplanning**: the agent schedules dependent actions (cutover, teardown, capacity release) against a premise that is false but unfalsifiable from context. Recovery requires an *external* event — a failed dependent action, a monitoring alert, or an auditor agent with access to raw spans — because the agent's own memory contains no path back to the disconfirming clause. The re-fetch is impossible from inside the hierarchy: the leaf that held the truth was discarded at the first compaction, and the branch that paraphrased it was discarded at the second. The operational guardrail is therefore not better summarization but **referential pinning plus a reverification obligation on pinned negations before any irreversible action**. An agent about to perform an irreversible step must scan its pins and re-execute the source query for each `must_reverify: true` record whose referent touches the action's blast radius. The pin is cheap (tens of tokens); the failure it prevents is a silent, fully-confident wrong action. ```python from dataclasses import dataclass, field from typing import Optional class CompactionInvariantViolation(RuntimeError): """Raised when a summary node would drop a negation whose referent cannot be resolved at the parent level — an unsound abstraction.""" pass @dataclass class NegationPin: predicate: str # e.g. "lock_wait_timeout" referent: str # e.g. "tenant_41" source_span: str # leaf id for re-expansion must_reverify: bool = True @dataclass class SummaryNode: level: int text: str pins: list[NegationPin] = field(default_factory=list) children: list[str] = field(default_factory=list) def compact(children: list[SummaryNode], parent_text: str) -> SummaryNode: """Fold child summaries into a parent. Refuses to promote if any child negation referent fails to survive into the parent.""" inherited_pins: list[NegationPin] = [] for child in children: for pin in child.pins: # Invariant: referent must be literally present in parent text, # or the pin must be carried forward verbatim. if pin.referent in parent_text: inherited_pins.append(pin) elif pin.must_reverify: # Referent was laundered away by the summarizer. raise CompactionInvariantViolation( f"Compaction would drop negation referent " f"{pin.referent!r} (predicate={pin.predicate!r}, " f"span={pin.source_span!r}); parent text " f"{parent_text!r} does not resolve it. " f"Pin must be carried verbatim or span re-expanded." ) return SummaryNode(level=max(c.level for c in children) + 1, text=parent_text, pins=inherited_pins) def plan_irreversible_action(node: SummaryNode, blast_radius: set[str]) -> list[str]: """Before any irreversible step, re-execute every pinned negation whose referent intersects the blast radius.""" reverify = [ p.source_span for p in node.pins if p.must_reverify and p.referent in blast_radius ] if not reverify and any(p.referent in blast_radius for p in node.pins): raise CompactionInvariantViolation( "Blast radius touches a pinned negation but no source span " "is available for reverification; action must be blocked." ) return reverify ```