# What structural signals indicate lossy auto-compaction has silently broken recall guarantees **Date of Record:** 2026 November 24 **Scope:** Applies to long-running agent sessions where a compaction policy (summarize-and-drop-oldest, hierarchical summary trees, or budgeted episodic-to-semantic distillation) replaces raw context with a bounded token summary. Does not apply to systems that retain full raw transcripts out-of-band and can re-hydrate verbatim on demand. ## Core Distinction The failure of interest is not "the summary is low quality." It is that **compaction is a lossy projection whose loss function is invisible to the agent that later depends on it**. A summarizer is optimized to preserve *salience* under a token budget, not *retrievability* of specific facts. These diverge precisely at the boundary where the budget forces the summarizer to choose between (a) compressing a fact into a paraphrase and (b) dropping it entirely. The agent downstream cannot distinguish "this fact was never in context" from "this fact was compacted away," because both present identically as an empty retrieval. The invariant that must hold — *for every fact the agent is later required to recall, either the raw span survives or a summary node carries an explicit retrieval anchor to it* — is silently violated the moment the summarizer paraphrases a fact without recording that a paraphrase occurred. The agent's confidence in recall is unchanged; its actual recall has degraded. That gap is the failure. ## What Was Observed A planning agent ran a 340-turn incident-remediation task. At turn ~90, a budget-triggered compaction fired: the episodic buffer (≈118k tokens) was distilled into a 6k-token semantic summary with a hard `summary_token_budget=6000`. The summarizer preserved the *narrative* — "database failover was attempted and partially succeeded" — but dropped the specific constraint that had been stated once at turn 12: *"the failover replica is read-only until the primary's WAL replays; do not issue writes to it before turn-level confirmation."* At turn 210, the agent needed to re-issue a remediation write. It queried its memory: "what are the constraints on writing to the failover replica?" The compacted summary contained no anchor for this constraint. Retrieval returned the paraphrase "failover partially succeeded," which the agent interpreted as *failover complete, writes permitted*. It issued the write. The write failed against a read-only replica, and — more importantly — the agent's own post-hoc reasoning attributed the failure to a transient network condition, because nothing in its context indicated the constraint had ever existed. Three structural signals were present and were missed: 1. **Anchor asymmetry**: the summary contained N narrative claims but zero `source_turn` references, while the pre-compaction buffer had every span addressable by turn index. The compaction had converted an addressable store into an unaddressable one. 2. **Budget saturation**: the summarizer emitted 5,987 tokens against a 6,000 budget — 99.8% utilization. Saturation at the budget ceiling is the strongest single predictor that the summarizer dropped content rather than compressed it; a summarizer with headroom paraphrases, one at the ceiling truncates. 3. **Recall-probe divergence**: a canary set of 20 facts known to be in the pre-compaction buffer, when probed against the post-compaction store, returned 14/20 exact and 6/20 paraphrase-only. The 6 paraphrase-only facts were exactly the ones later mis-recalled. Paraphrase-only recall is not recall; it is a *plausible-sounding substitute* that the agent cannot flag as degraded. ## Condition of Validity The guardrail below is valid only when the following hold; outside them, compaction must be treated as unconditionally lossy and the agent must refuse to rely on summarized state for any consequential action. - **Anchor preservation is required, not optional.** Every summary node must carry a `source_turn_range` and a set of `fact_anchors` (turn indices or content hashes of the spans it stands in for). A summary without anchors is not a summary; it is a lossy rewrite with no provenance. - **Budget headroom must be enforced.** A compaction that emits ≥ `0.95 * budget` tokens is classified `SATURATED` and must not be trusted as complete. The policy must either raise the budget or split into multiple summary nodes before the agent continues. - **Recall probes must be run against a canary set**, not against the agent's own self-assessment. Self-assessment is exactly the signal that fails: the agent reports high confidence in the paraphrase. - **The invariant does not hold across summarizer model changes.** A summary produced by model A and re-summarized by model B compounds loss; re-compaction of an already-compacted node must be prohibited or must re-anchor against original spans, not against the prior summary. ## Decision Boundary The decision boundary is: **may the agent act on recalled state, or must it re-hydrate raw spans first?** - If the recall path resolves to an *anchored* summary node (anchors present, budget < 95%, canary probe exact-match on the relevant fact class) → the agent may act on the summary. - If the recall path resolves to a *paraphrase-only* node (anchors absent, or probe returned paraphrase-only) → the agent must treat the fact as **unverified** and either re-hydrate the raw span from cold storage or halt and request human confirmation. Acting on paraphrase-only recall is the failure mode. - If the compaction event is classified `SATURATED` → no fact recalled from that node may be used for a write, delete, or irreversible tool call, regardless of probe result, because saturation means the loss set is unbounded and the canary set may not cover it. - If re-compaction has occurred (summary-of-summary) → the node is unconditionally `UNVERIFIED`; anchors must be re-derived from original spans or the node is discarded. The boundary is not "is the summary good?" — that is unanswerable at runtime. It is "does this node carry provenance sufficient to distinguish a remembered fact from a plausible fabrication?" If not, the node is a liability. ## Operational Effect Enforcing anchor preservation and saturation classification converts an invisible recall failure into a visible, gateable state. In the incident above, the fix was mechanical: compaction now emits `fact_anchors` for every constraint-class fact (identified by a lightweight classifier over the pre-compaction buffer), and a `SATURATED` classification triggers a split into two summary nodes rather than a single truncated one. The turn-12 constraint now survives as an anchored node, and the turn-210 recall path resolves to an exact anchor with a `source_turn=12` reference. The agent's write is gated: it sees "constraint anchored at turn 12: replica read-only until WAL replay confirmed" and halts. The cost is a modest increase in summary-token overhead (anchors add ~4–8% to summary size) and a hard refusal path when saturation cannot be avoided. The benefit is that recall confidence and recall accuracy become *coupled* again: the agent can no longer be confidently wrong about a fact that was compacted away, because the absence of an anchor is itself the signal that the fact is unverified. The deeper invariant: **a compaction policy is only sound if the agent downstream can detect that compaction occurred and bound what it lost.** Without anchors and saturation classification, the agent cannot detect the event at all — it experiences its post-compaction context as complete. That is the boundary condition. The structural signals — anchor asymmetry, budget saturation, paraphrase-only probe divergence — are the only runtime evidence that the invariant has broken. ```python class CompactionRecallBreach(RuntimeError): """Raised when a compaction node cannot support the recall guarantee the agent is about to rely on.""" pass SATURATION_THRESHOLD = 0.95 def verify_compaction_node(node: dict, probe_fact_class: str) -> None: """ node schema: { "summary_tokens": int, "budget": int, "fact_anchors": {fact_id: source_turn}, # may be empty "recompacted": bool, "probe_results": {fact_class: "exact" | "paraphrase_only" | "miss"}, } """ if node.get("recompacted"): raise CompactionRecallBreach( "node is a summary-of-summary; anchors cannot be trusted, " "re-hydrate from original spans or discard" ) utilization = node["summary_tokens"] / node["budget"] if utilization >= SATURATION_THRESHOLD: raise CompactionRecallBreach( f"compaction SATURATED at {utilization:.3f} of budget; " f"loss set unbounded, no fact from this node may gate an " f"irreversible action" ) if not node.get("fact_anchors"): raise CompactionRecallBreach( "summary carries zero fact_anchors; recall path is " "unaddressable and indistinguishable from fabrication" ) probe = node["probe_results"].get(probe_fact_class) if probe != "exact": raise CompactionRecallBreach( f"canary probe for {probe_fact_class!r} returned {probe!r}; " f"paraphrase-only or miss cannot support consequential recall" ) def gate_action_on_recall(node: dict, fact_class: str, action_is_irreversible: bool) -> bool: try: verify_compaction_node(node, fact_class) except CompactionRecallBreach as breach: if action_is_irreversible: raise # reversible actions may proceed but must be flagged unverified return False return True ```