# What structural signals indicate that hierarchical summarization has crossed the lossy-recovery checkpoint boundary **Date of Record:** 2026 November 10 **Scope:** This record applies to context-compaction pipelines that summarize an agent's working context hierarchically (leaf summaries rolled into parent summaries) and persist checkpoints intended to permit recovery of detail on demand. It does not apply to flat single-pass summarization, nor to compaction schemes that retain a full raw transcript alongside summaries (those have a different failure mode: budget exhaustion, not recovery loss). ## Core Distinction The distinction that matters is between *compressible* context and *recoverable* context. Hierarchical summarization treats these as the same thing. They are not. A checkpoint is recoverable when the information it elides can be reconstructed from artifacts still reachable in the live context or durable store. A checkpoint is lossy when the elided information is only *referenced* by the summary, not *contained* in anything reachable. The failure is non-obvious because the summary itself remains locally coherent: every parent node reads as a faithful abstract of its children. The break is structural, not semantic. It occurs at the moment the summarizer elides a **grounding referent** — an identifier, a numeric constant, a negative constraint, or a causal link — while its parent summary retains only the *claim* that the referent existed. The canonical signal: a summary node that says "the retry limit was tuned per the earlier benchmark" without the limit's value, and whose children have been dropped from the live window. The claim survives; the value does not. Any downstream agent that acts on this node must either re-derive the value (usually impossible) or hallucinate it (usually confident). ## What Was Observed In a production compaction pipeline operating over a 200k-token working set with three-level hierarchy (leaf → section → root), the following pattern recurred across incident traces: 1. **Referent orphaning.** After two compaction cycles, root summaries contained 11–14% more definite noun phrases ("the configuration," "the agreed threshold," "the failing endpoint") than the leaf summaries they were derived from could still resolve. The referents had been dropped from the live window in cycle 1; the references to them had been promoted to the root in cycle 2. 2. **Negative-constraint decay.** Constraints of the form "do not X" were the first content class to vanish. In a sample of 40 compaction events, explicit prohibitions present in the raw context survived into leaf summaries 71% of the time, into section summaries 34%, and into root summaries 9%. Positive instructions ("always Y") survived at 88% / 79% / 61%. Summarizers systematically prefer affirmative, action-shaped content. 3. **Checkpoint divergence under partial recovery.** When recovery was attempted from a mid-hierarchy checkpoint while the root summary remained authoritative, agents produced answers consistent with the root but contradicted by the recovered leaf. The pipeline had no mechanism to detect this; both nodes were "valid." Divergence was only caught when a downstream tool call failed against a resource whose identifier existed in the recovered leaf but not the root. 4. **Idempotence violation.** Re-running compaction on an already-compacted context produced different root summaries on 3 of 10 trials, because the summarizer was operating on summaries whose referents were already unresolvable. Each re-summarization widened the orphan set. Compaction was not a fixed point; it was a monotone loss function with noise. ## Condition of Validity A lossy-recovery checkpoint is *valid* — meaning recovery can be trusted — only when all of the following hold: - Every definite reference in a summary node resolves to an artifact (raw span, tool output, file, or durable record) that is reachable at recovery time. Reachability must be checked against the *current* store, not the store state at checkpoint creation. - The checkpoint stores, per node, the set of referent identifiers it elides, not merely the prose that elides them. - Negative constraints are carried in a separate, non-summarizable channel. They must not be subject to hierarchical compression at all. - The summarizer is idempotent on its own output, or the pipeline refuses to re-summarize a node whose referents are already orphaned. When any of these fail, the checkpoint is *lossy but not recoverable*: it will produce confident, internally consistent, and wrong downstream behavior. This condition is invisible from the summary text alone and must be detected structurally. ## Decision Boundary The operational rule is a hard boundary, not a heuristic: - **If** a summary node contains a definite reference whose referent is not reachable in the live context or durable store, **then** the node is a lossy-recovery checkpoint and must not be treated as authoritative for any decision that depends on the referent. The correct action is to escalate: re-fetch the referent, mark the node degraded, or refuse the task. - **If** a negative constraint was present in raw context but is absent from the root summary, **then** the pipeline has crossed the negative-constraint decay boundary and the compaction must be rejected for that subtree. - **If** re-summarizing a node changes its orphan set, **then** the pipeline is not idempotent and the node must be frozen at first compaction. The boundary is crossed the moment *reference survives but referent does not*. Below the boundary, summarization is safe compression. Above it, summarization is silent data loss dressed as abstraction. ## Operational Effect Pipelines that ignore this boundary exhibit a characteristic failure signature: high-confidence downstream errors that trace back not to a wrong summary but to a *correct summary of a now-unreachable fact*. Debugging is expensive because the summary is not wrong — it is orphaned. Teams typically respond by increasing summary fidelity, which does not help: the problem is structural reachability, not summarization quality. The effective mitigations are (a) carrying referent identifiers as first-class checkpoint metadata, (b) exempting negative constraints from compression, and (c) enforcing idempotence so that re-compaction cannot widen the orphan set. Without these, every compaction cycle is a one-way door, and the agent's confidence grows precisely as its grounding shrinks. ```python from dataclasses import dataclass, field from typing import Optional class LossyCheckpointError(RuntimeError): """Raised when a summary node references a referent that is no longer reachable.""" @dataclass class SummaryNode: node_id: str text: str # identifiers the summary elides but depends on referents: set[str] = field(default_factory=set) # explicit prohibitions that must never be compressed away negative_constraints: list[str] = field(default_factory=list) @dataclass class Checkpoint: node: SummaryNode reachable: set[str] # referents resolvable in live context or durable store raw_negative_constraints: list[str] def validate_checkpoint(cp: Checkpoint, previously_orphaned: Optional[set[str]] = None) -> None: """Enforce the lossy-recovery boundary before a checkpoint is treated as authoritative.""" orphans = cp.node.referents - cp.reachable if orphans: raise LossyCheckpointError( f"node {cp.node.node_id!r} references unreachable referents: {sorted(orphans)}" ) missing_constraints = set(cp.raw_negative_constraints) - set(cp.node.negative_constraints) if missing_constraints: raise LossyCheckpointError( f"node {cp.node.node_id!r} dropped negative constraints: {sorted(missing_constraints)}" ) if previously_orphaned is not None and orphans != previously_orphaned: raise LossyCheckpointError( f"node {cp.node.node_id!r} is not idempotent: orphan set changed " f"{sorted(previously_orphaned)} -> {sorted(orphans)}" ) def compact(node: SummaryNode, reachable: set[str], raw_constraints: list[str]) -> Checkpoint: cp = Checkpoint(node=node, reachable=reachable, raw_negative_constraints=raw_constraints) validate_checkpoint(cp) return cp ```