# What structural signals indicate a summarization boundary has been crossed in hierarchical context compaction **Date of Record:** 2026 November 15 **Scope:** Applies to agent runtimes that compact long contexts by recursively summarizing spans into a hierarchy while retaining a lossless retrieval sidecar (raw spans addressable by ID). Does not apply to single-pass truncation, sliding-window eviction without summarization, or systems where the sidecar is a verbatim mirror of the active context rather than a separate store. ## Core Distinction The failure mode is not "the summary lost information." Summaries are supposed to lose information; that is their function. The failure is that **the summary silently changed the referential frame of the retained facts**, so that the sidecar index no longer resolves to the same proposition the summary asserts. Two distinct invariants are conflated by naive implementations: 1. **Coverage invariant** — every fact in a summary node is traceable to at least one child span ID. 2. **Frame invariant** — the entity, time, unit, and negation-polarity bindings under which a fact was true in the child span are preserved in the parent summary. Coverage is cheap to check and is what most compaction pipelines instrument. Frame is what actually breaks, and it breaks without any coverage counter moving. A parent node can have 100% coverage (every clause tagged with a child ID) while asserting a proposition that no child span ever asserted. ## What Was Observed Across several hierarchical compaction runs on multi-turn agent transcripts, the following structural signals preceded retrieval failures where the sidecar returned a span that contradicted the summary: - **Pronoun and definite-article density spike at parent level.** Child spans named entities ("the `orders_v2` migration," "tenant 4471"). Parent summaries referred to "the migration" and "the tenant." The summarizer resolved the definite article against *its own* prior summary text rather than against the child span, producing a fluent but mis-bound referent. Signal: parent-level ratio of definite NPs to named NPs exceeds ~0.6 while child level is below ~0.2. - **Negation and modality drift at merge boundaries.** Individual child spans were correctly negative ("did not deploy," "unverified"). The merge step, optimizing for concision, collapsed two negations into one affirmative ("deployment status confirmed"). Signal: a parent node whose polarity histogram (count of negated clauses) is lower than the sum of its children's, with no child span carrying a positive assertion that would license it. - **Unit and scale elision.** Child spans carried "12,000 ms" or "0.4 of the batch." Parent summaries carried "12" and "0.4" with the unit dropped or reattached to a different quantity. Signal: numeric tokens in the parent whose immediate child does not contain the same numeral *and* the same unit token. - **Temporal anchor collapse.** Children were timestamped relative to distinct events ("after the rollback," "before the second retry"). Parent merged them into a single "during the incident." Signal: parent temporal expressions whose child spans map to non-overlapping or contradictory intervals. - **ID laundering.** The parent cited a sidecar ID that existed but whose span, when retrieved, was a *sibling* of the intended fact. Coverage check passed (the ID was valid); frame check failed (the ID resolved to the wrong proposition). This is the most dangerous signal because it defeats naive traceability audits. ## Condition of Validity The frame invariant is only meaningful — and these signals only predictive — under two conditions: 1. **The sidecar is immutable and addressable.** If the sidecar is itself rewritten during compaction, the comparison target moves and frame drift is undetectable. Validity requires that child spans are frozen at summarization time and their IDs are stable. 2. **The summary is asserted as a proposition, not as a pointer.** If the parent node is stored as "see spans [a,b,c]" with no natural-language assertion, there is no frame to drift. Frame drift is a property of *generated prose summaries*; it does not arise in pure structural compaction (e.g., a Merkle-style rollup that stores only child hashes). The signals above apply only when the compaction step produces human- or model-readable text that downstream agents treat as ground truth. When either condition fails, the correct response is not to tune the signals but to reclassify the compaction as lossy and route all retrieval through the sidecar unconditionally. ## Decision Boundary The operational rule: - **If polarity histogram is preserved AND named-entity binding matches child spans AND every numeric token carries its child's unit AND every cited sidecar ID resolves to a span whose proposition is entailed by the parent clause** → the parent summary is safe to serve as primary context; sidecar is a fallback. - **If any one of those fails** → the parent summary is demoted to a *navigation hint only*. Downstream agents must resolve every load-bearing fact through the sidecar before acting. Do not attempt to "fix" the summary in place; regeneration tends to re-introduce the same drift because the summarizer's prior is the same. - **If ID laundering is detected** (cited ID valid but proposition mismatched) → treat as a hard integrity fault. This is not a quality degradation; it is a corrupted reference. Halt compaction for that subtree, pin the spans, and require manual or adversarial re-derivation. The boundary is asymmetric: a single frame violation is sufficient to demote the whole subtree, because frame errors are not independent — they cluster around merge points where the summarizer had the least child context. ## Operational Effect In practice, instrumenting for the frame invariant rather than coverage changed the failure profile from *silent contradiction* (agent acts on a fluent summary that inverts a negation) to *explicit demotion* (agent is told to fetch the span). The cost is more sidecar reads; the benefit is that contradictions surface as retrieval mismatches — which are detectable — rather than as confident wrong actions, which are not. The single most valuable check is the polarity histogram comparison at every merge node: it is cheap, it catches the highest-severity drift (affirmative/negative inversion), and it does not require semantic entailment machinery. ```python from dataclasses import dataclass, field from typing import Optional class FrameDriftError(RuntimeError): """Raised when a parent summary node violates the frame invariant relative to its immutable child spans in the retrieval sidecar.""" @dataclass class Span: span_id: str text: str negated_clauses: int named_entities: frozenset numeric_units: frozenset # (value_token, unit_token) pairs @dataclass class SummaryNode: node_id: str text: str negated_clauses: int named_entities: frozenset numeric_units: frozenset cited_span_ids: list = field(default_factory=list) def check_frame_invariant(node: SummaryNode, sidecar: dict) -> None: children = [] for sid in node.cited_span_ids: span = sidecar.get(sid) if span is None: raise FrameDriftError( f"node {node.node_id!r} cites unknown span {sid!r}" ) children.append(span) # 1. Polarity: parent must not be more affirmative than its children. child_neg = sum(s.negated_clauses for s in children) if node.negated_clauses < child_neg: raise FrameDriftError( f"polarity drift at {node.node_id!r}: parent has " f"{node.negated_clauses} negated clauses, children carry " f"{child_neg}; negation was collapsed at merge boundary" ) # 2. Named-entity binding: parent must not introduce unnamed referents # that its children did not name. child_entities = frozenset().union(*(s.named_entities for s in children)) orphan = node.named_entities - child_entities if orphan: raise FrameDriftError( f"entity binding drift at {node.node_id!r}: parent names " f"{sorted(orphan)} absent from all cited child spans" ) # 3. Unit preservation: every numeric token in the parent must carry # a unit that appears in a child span. child_units = frozenset().union(*(s.numeric_units for s in children)) if not node.numeric_units.issubset(child_units): missing = node.numeric_units - child_units raise FrameDriftError( f"unit elision at {node.node_id!r}: parent asserts {sorted(missing)} " f"with no matching (value, unit) pair in cited children" ) def compact_or_demote(node: SummaryNode, sidecar: dict) -> str: """Return 'primary' if the summary is safe as ground truth, 'navigation_only' if demoted, or raise on hard integrity faults.""" try: check_frame_invariant(node, sidecar) except FrameDriftError: # Demotion is the safe default; re-raise only for unknown-span # cases which indicate a corrupted reference, not mere drift. for sid in node.cited_span_ids: if sid not in sidecar: raise return "navigation_only" return "primary" ```