# What structural signals indicate hierarchical summarization has silently violated lossless recall guarantees under auto-compaction **Date of Record:** 2026 November 22 **Scope:** Applies to long-running agent sessions where an auto-compaction policy replaces raw episodic turns with hierarchical summaries once a token-budget watermark is crossed, and where the agent is contractually expected to answer recall queries over evicted history. Does not apply to stateless single-turn inference or to explicit user-initiated `/compact` commands where loss of recall is acknowledged. ## Core Distinction The failure this record isolates is not "summarization was lossy." All summarization is lossy in the compression sense. The failure is **lossless-recall violation under a compaction policy that advertises lossless recall** — a specific, detectable divergence between what the compaction subsystem *claims* it preserved (an index of retrievable facts) and what the post-compaction context can actually *reconstruct* when probed. The distinction that matters operationally: a hierarchical summarizer builds a tree — leaf summaries over turn windows, then parent summaries over leaves. Each node carries a token budget. The invariant a "lossless recall" policy promises is: **for any fact `f` present in the pre-compaction episodic log, there exists a path in the summary tree such that a downstream retrieval over that tree returns `f` verbatim or semantically exact.** This invariant is violated silently when a fact is (a) present in a child node, (b) dropped by the parent's budget-aware eviction, and (c) *not* re-derivable from any surviving sibling — yet the parent node's metadata still reports the child as "covered." The non-obvious part: the parent's coverage metadata is computed at *summarization time* (does the child's token span fall under this parent?), not at *recall time* (can the fact be reconstructed?). These two notions of coverage diverge precisely at eviction boundaries, and nothing in the standard compaction telemetry distinguishes them. ## What Was Observed A research agent ran a 340-turn session against a document corpus. Compaction policy: hierarchical, leaf window = 16 turns, leaf budget = 800 tokens, parent fanout = 8 leaves, parent budget = 1,200 tokens, trigger at 92% of a 200k context. At turn 212 the parent-level trigger fired and the agent emitted a parent summary over leaves covering turns 129–256. During turns 213–240 the agent was asked three recall queries about a specific numeric constraint stated at turn 147 ("the retry ceiling is 7, not 5"). Turn 147 lived in leaf L9 (turns 145–160). L9's leaf summary contained the constraint verbatim. The parent summary P2 (leaves L9–L16) was assembled under a 1,200-token budget; L9's contribution was compressed to "earlier discussion of retry semantics." P2's coverage metadata recorded `covered_leaves: [L9..L16]`. At recall time the retriever walked P2, found no constraint, descended to children — but the eviction step had already **unlinked L9's raw text** and retained only P2 plus a pointer to L9's *summary*, which itself had been folded into P2's prose. The verbatim "7, not 5" survived nowhere in the live context. The agent answered "the retry ceiling is 5" on turn 218, and re-confirmed the same wrong value on turn 231 because the corrupted value had itself been re-summarized into a fresh leaf. The structural signal that flagged this in post-hoc replay: **the parent node's token count was 1,190 of a 1,200 budget (99.2% saturation) while its `covered_leaves` count was 8 of 8.** A parent summary at >97% budget saturation with full leaf coverage is the canonical signature of budget-aware eviction having eaten a verbatim fact to make room — the summarizer was forced to drop the lowest-salience child content, and numeric constraints are systematically low-salience to a summarizer that weights narrative flow. ## Condition of Validity This failure requires the conjunction of four conditions; break any one and the invariant holds: 1. **Hierarchical (two-level or deeper) summarization**, so a parent node can evict child content while retaining child coverage metadata. 2. **Budget-aware eviction at the parent level**, i.e. the parent's token budget is smaller than the sum of its children's salient content, forcing a selection. 3. **A recall contract that promises reconstruction, not just topical coverage** — the policy must claim the fact is retrievable, otherwise there is no violated invariant, only expected loss. 4. **Unlinking of raw child text after parent assembly**, so the evicted fact has no fallback path. If raw leaves are retained in an out-of-context store, the recall query can still be satisfied by direct fetch and the failure does not manifest. The condition does *not* require adversarial input or prompt injection. It occurs under ordinary load whenever a parent boundary lands on a turn window containing a high-precision, low-narrative-salience fact — numbers, identifiers, negations ("do not call X"), and unit-bearing constraints are the high-risk classes. ## Decision Boundary The operative question for a compaction controller is: **when a parent summary is at eviction pressure, may it unlink children whose content it did not fully preserve?** The correct boundary: **a parent may unlink a child only if the child's salient-fact set is a subset of the parent's reconstructed text, verified by a fact-extraction diff, not by token-span coverage.** Token-span coverage is necessary but not sufficient. Concretely, the controller must, before unlinking, run an extractor over the child (numbers, quoted strings, negations, proper nouns, code identifiers), run the same extractor over the parent, and require that every child-extracted atom appears in the parent — else retain the child as a pinned leaf or promote the atom to a verbatim "facts ledger" that is exempt from summarization. The boundary is crossed (failure becomes live) at the moment the parent's budget saturation exceeds the point where the eviction selection function is guaranteed to have dropped a child atom. Empirically, saturation >97% with full leaf coverage is the alarm. Below that, eviction rarely bites a high-precision atom because there is slack to keep it; above it, the selection function is provably discarding content and coverage metadata is lying. A second boundary governs *repair*: once a wrong value has been re-summarized into a new leaf (turn 231 in the trace), the corruption is laundered — the wrong fact now has the same provenance weight as a correct one. Repair requires invalidating the entire parent subtree back to the last verified leaf, not patching the leaf. Patching a laundered leaf re-introduces the wrong value because the patch source is the corrupted parent. ## Operational Effect The downstream effect is **silent, self-reinforcing factual drift with a false coverage attestation.** Three concrete operational consequences: - **Recall queries return confident wrong answers, not "not found."** Because coverage metadata says the leaf is covered, the retriever does not escalate to a missing-fact path; it answers from the parent's paraphrase and the model fills the numeric gap by interpolation. The failure presents as hallucination but is structurally an eviction bug. - **Re-summarization launders corruption.** Each subsequent compaction pass folds the wrong value into a fresh leaf with clean provenance, so post-hoc audits that check *provenance integrity* pass while *factual integrity* is broken. Auditors who trust the coverage tree will certify a corrupted context. - **The trigger is load-dependent and non-deterministic.** The same session replayed with a different leaf-window alignment may place turn 147 in a leaf that survives intact, so the failure is intermittent and hard to reproduce — which is why the structural saturation signal, not the reproduction, must be the detector. The guardrail that bounds it: **pin-and-diff before unlink, plus a saturation tripwire.** Before any parent unlinks children, extract atoms from children, extract atoms from parent, and refuse the unlink (raise) if any child atom is absent from the parent and absent from the facts ledger. Independently, if a parent summary exceeds 97% budget saturation with full leaf coverage, flag the subtree as recall-unverified and force raw-leaf retention until a diff clears it. These two together convert a silent lossless-recall violation into a loud, localized refusal. ```python import re from dataclasses import dataclass, field class LosslessRecallViolation(RuntimeError): """Raised when a parent summary would unlink children whose salient atoms are not reconstructable from the parent or the facts ledger.""" pass class SaturationTripwire(RuntimeError): """Raised when a parent summary is at eviction pressure with full leaf coverage, meaning coverage metadata cannot be trusted.""" pass ATOM_PATTERNS = [ re.compile(r"\b\d+(?:\.\d+)?\b"), # numbers / quantities re.compile(r"\bnot\b|\bnever\b|\bdo not\b", re.I), # negations re.compile(r"`[^`]+`"), # code identifiers re.compile(r'"[^"]{2,}"'), # quoted strings ] def extract_atoms(text: str) -> set[str]: atoms: set[str] = set() for pat in ATOM_PATTERNS: for m in pat.findall(text): atoms.add(m.strip().lower()) return atoms @dataclass class SummaryNode: node_id: str text: str token_budget: int token_used: int covered_leaves: list[str] = field(default_factory=list) children: dict[str, "SummaryNode"] = field(default_factory=dict) @dataclass class CompactionController: facts_ledger: set[str] = field(default_factory=set) saturation_threshold: float = 0.97 def _saturation(self, parent: SummaryNode) -> float: return parent.token_used / parent.token_budget def unlink_children(self, parent: SummaryNode) -> None: # Tripwire 1: eviction pressure + full coverage => metadata unreliable. if ( self._saturation(parent) >= self.saturation_threshold and len(parent.covered_leaves) == len(parent.children) ): raise SaturationTripwire( f"parent {parent.node_id} at {self._saturation(parent):.3f} " f"saturation with {len(parent.children)}/{len(parent.children)} " f"leaves covered; coverage attestation cannot be trusted" ) parent_atoms = extract_atoms(parent.text) | self.facts_ledger # Tripwire 2: pin-and-diff. Refuse to unlink any child whose # salient atoms are not reconstructable from parent or ledger. for child in parent.children.values(): child_atoms = extract_atoms(child.text) missing = child_atoms - parent_atoms if missing: raise LosslessRecallViolation( f"unlink of child {child.node_id} under parent " f"{parent.node_id} would drop atoms {sorted(missing)}; " f"retain child as pinned leaf or promote atoms to ledger" ) # Only reached if every child atom is reconstructable. parent.children.clear() parent.covered_leaves = [] def repair_subtree(self, parent: SummaryNode) -> None: # Corruption laundering guard: a laundered wrong value cannot be # patched at the leaf; the whole parent subtree must be invalidated # back to the last verified leaf. if any(a in self.facts_ledger for a in extract_atoms(parent.text)): # parent text overlaps ledger but children were unlinked: # provenance is clean, factual integrity is not. raise LosslessRecallViolation( f"parent {parent.node_id} overlaps facts ledger after child " f"unlink; patch would re-introduce laundered value — " f"invalidate subtree to last verified leaf" ) parent.children.clear() parent.covered_leaves = [] parent.text = "" ```