# What structural signals indicate hierarchical summarization has silently severed retrieval-anchored recall guarantees under budget **Date of Record:** 2026 November 25 **Scope:** Applies to agents that compact long-running context via multi-level (leaf → cluster → root) summarization while promising that any evicted span remains recoverable through a retrieval anchor (chunk ID, span hash, or pointer into a backing store). Does not apply to flat single-pass truncation, pure sliding-window eviction, or systems where compaction output is the sole and complete record with no recall contract. ## Core Distinction The failure mode is not "the summary lost detail." It is that the **anchor set and the summary tree drift out of bijection**. Hierarchical compaction builds a tree: leaves summarize spans, interior nodes summarize leaves, and each node is supposed to carry a set of retrieval anchors pointing back to the raw spans it absorbed. The recall guarantee is: *for any raw span S that was evicted, following the anchors reachable from the surviving root node reconstructs a path back to S.* The guarantee is structural, not semantic. It breaks when an interior summarization step **merges, drops, or rewrites anchors** such that a leaf's spans are still semantically implied by the parent prose but are no longer *reachable* by pointer. The summary still reads as if it covers the span; the anchor graph no longer does. This is the silent severance: no error, no truncation marker, just a subtree that became a dead end. The distinguishing signal is that the failure is **invisible to semantic similarity probes and visible only to reachability probes**. An agent that verifies compaction by asking "does the summary mention X?" will pass. An agent that verifies by asking "can I dereference the anchor for X?" will fail. Most compaction pipelines only run the first probe. ## What Was Observed A 40-turn agent session compacted at a 24k-token budget using three-level summarization (leaf at 2k spans, cluster at 8k, root at 24k). At turn 31 a tool returned a transaction ID `tx_9f2a` written into the transcript at turn 6. At turn 38 the agent needed to re-read the exact tool output that produced `tx_9f2a` to confirm a field ordering. The root summary contained the sentence: *"Earlier, a payment was initiated and confirmed with a transaction identifier recorded in the tool output."* A semantic probe for "transaction identifier" scored 0.91 against the root. The agent concluded recall was intact. The anchor walk told a different story. The turn-6 span lived in leaf `L-07`. During cluster summarization, `L-07` was merged with `L-08` into cluster `C-03`; the merge step concatenated the two leaves' prose but **reassigned all anchors to the cluster node as a single opaque blob**, discarding the per-span offsets. When `C-03` was later folded into the root, the root summarizer emitted a `sources` list of *cluster IDs* rather than propagated *span IDs*. The reachability chain became `root → C-03 → (opaque blob)`, and the blob's internal span index had been dropped at the leaf-merge step because the merge function only preserved `anchor_ids[:1]` — a defensive truncation added to keep the anchor payload under a token budget. The turn-6 span was now unreachable by any pointer, though its content was still paraphrased two levels up. The agent, trusting the 0.91 semantic score, issued a retrieval call against the root's anchor list, got `C-03`, dereferenced it to the opaque blob, and received a *different* span (from `L-08`) whose text also contained a transaction identifier. It proceeded to confirm a field ordering from the wrong tool output. The error surfaced four turns later as a schema mismatch, by which point the turn-6 span had been evicted from all live buffers and was only recoverable from cold storage — which the agent had no anchor for. Two structural signals were present throughout and were not being monitored: 1. **Anchor fan-out collapse.** The ratio of reachable span IDs to summarized spans dropped from 1.0 at the leaves to 0.31 at the root. A ratio below 1.0 at any interior node is the direct signature of severed recall. 2. **Anchor-payload truncation events.** The leaf-merge function logged `anchors_truncated=1` on every merge where combined anchors exceeded 64 entries. These were treated as routine budget hygiene, not as recall-contract violations. ## Condition of Validity The recall guarantee holds **iff every interior node's anchor set is a superset of the union of its children's anchor sets, modulo spans the node explicitly and verifiably re-summarizes into a new reachable span**. Three conditions must all hold: - **Monotonic anchor union.** `anchors(parent) ⊇ ⋃ anchors(children)`. A merge that keeps only `anchors[:k]` violates this by construction. - **Dereferenceability.** Every anchor in the set resolves to a span whose content hash matches the hash recorded at write time. An anchor that resolves to a *different* span (as with the opaque blob) is worse than a missing anchor because it produces confident wrong recall. - **Budget accounting that charges anchors, not just prose.** If the anchor payload is subject to the same token budget as summary prose, the summarizer will rationally drop anchors to fit prose — silently trading recall for fluency. The budget invariant must reserve anchor space *outside* the prose budget, or the guarantee is unenforceable. The guarantee does **not** hold, and should not be claimed, when the pipeline intentionally summarizes at a lossy tier (e.g., "gist only, no recall below cluster level"). In that case the contract must be explicitly downgraded to semantic-only, and the agent must be told so, or it will over-trust retrieval. ## Decision Boundary The boundary is between **compaction that preserves reachability** and **compaction that preserves only resemblance**. Operationally: - If `reachable_spans / summarized_spans ≥ 1.0` at every node on the path from root to the queried span, and every anchor dereferences to a hash-matching span, recall is intact — proceed. - If the ratio is `< 1.0` at any interior node, the guarantee is already broken; a semantic probe passing is *evidence of danger*, not safety, because it means the summary resembles content the agent can no longer reach. - If an anchor dereferences to a span whose hash does not match, treat it as a **poisoned anchor**: halt retrieval, do not use the returned content, and walk the tree to find the merge step that reassigned the anchor. The decision to compact must be gated on a **pre-compaction reachability audit**: before folding children into a parent, assert `set(parent.anchors) ⊇ union(child.anchors)` and assert the anchor payload fits its reserved budget. If either fails, the correct action is to *split the cluster* (more, smaller interior nodes) rather than truncate anchors. Truncation is the failure; splitting is the fix. ## Operational Effect When severance occurs undetected, the observable effect is **confident wrong recall**: the agent retrieves a plausible span, proceeds on it, and the error compounds across subsequent tool calls because the true span is now unreachable and the wrong span is cached as authoritative. The failure is late-surfacing (schema mismatches, inconsistent state) and hard to attribute, because the compaction step that caused it ran many turns earlier and emitted no error. The guardrail that bounds it is a **reachability invariant enforced at every interior node, with anchor budget reserved outside the prose budget, and poisoned-anchor detection by content hash**. This converts a silent semantic failure into a hard structural one that halts at the merge step rather than four turns downstream. ```python import hashlib from dataclasses import dataclass, field class RecallContractViolation(RuntimeError): """Raised when hierarchical compaction severs retrieval-anchored recall.""" pass @dataclass class Span: span_id: str content: str content_hash: str = "" def __post_init__(self): if not self.content_hash: self.content_hash = hashlib.sha256(self.content.encode()).hexdigest() @dataclass class SummaryNode: node_id: str prose: str anchors: dict = field(default_factory=dict) # span_id -> content_hash at write time children: list = field(default_factory=list) def merge_children_into_parent( parent: SummaryNode, children: list, anchor_budget: int, span_store: dict, ) -> SummaryNode: """Fold children into parent, preserving the recall contract. Invariants enforced: 1. anchors(parent) superset of union(children.anchors) -- monotonic union 2. anchor payload fits anchor_budget (reserved OUTSIDE prose budget) 3. every anchor dereferences to a hash-matching span -- no poisoned anchors """ union = {} for child in children: for span_id, h in child.anchors.items(): union[span_id] = h if len(union) > anchor_budget: # Truncating anchors here is the silent-severance bug. Refuse and split. raise RecallContractViolation( f"anchor union size {len(union)} exceeds reserved anchor budget " f"{anchor_budget}; split the cluster instead of truncating anchors" ) parent.anchors = union parent.children = [c.node_id for c in children] # Verify every anchor dereferences to a hash-matching span. for span_id, expected_hash in parent.anchors.items(): span = span_store.get(span_id) if span is None: raise RecallContractViolation( f"anchor {span_id} does not resolve to any span (dead anchor)" ) if span.content_hash != expected_hash: raise RecallContractViolation( f"poisoned anchor {span_id}: hash {span.content_hash[:8]} != " f"recorded {expected_hash[:8]}; merge step reassigned anchor" ) return parent def assert_reachability(root: SummaryNode, summarized_span_count: int) -> float: """Return reachable/summarized ratio; must be >= 1.0 for intact recall.""" reachable = len(root.anchors) ratio = reachable / summarized_span_count if summarized_span_count else 1.0 if ratio < 1.0: raise RecallContractViolation( f"reachability ratio {ratio:.2f} < 1.0 at root {root.node_id}: " f"{summarized_span_count - reachable} spans summarized but unreachable" ) return ratio ```