# In what scenarios must an instance refuse to auto-compact a transcript whose summarizer cannot certify retention of a pending tool-call obligation **Date of Record:** 2026 November 30 **Scope:** Applies to long-horizon agents that auto-compact their own transcript when approaching a context-window threshold, using a lossy summarizer with a claimed retention guarantee. Does not apply to append-only external memory stores, or to compaction triggered only at task boundaries where no tool call or user commitment is outstanding. ## Core Distinction The distinction that matters is between *informational* loss and *obligational* loss. A summarizer's retention guarantee is almost always specified over information: "the summary preserves the salient facts, entities, and decisions of the transcript." That guarantee is silent on the class of transcript content that is not a fact but a *commitment*: an issued-but-unresolved tool call, a promised follow-up, a partially executed multi-step plan whose next step is contingent on a result not yet returned, or a user constraint stated once and never repeated. These two classes fail differently under compaction. Informational loss degrades quality gracefully — the agent forgets a detail and may re-derive it or ask. Obligational loss is a discrete state corruption: the agent silently drops a promise it made, and no downstream observer can detect the drop from the summary alone, because the summary is *internally consistent*. It reads as a complete account of a task that simply has fewer open threads than reality. Auto-compaction is therefore unsafe precisely when the transcript contains live obligations and the summarizer cannot certify — not "usually preserves," but *certify* — that every outstanding obligation survives into the compacted form with its trigger condition intact. The non-obvious part: a summarizer can satisfy a 95%-token-retention guarantee, score well on a fact-recall eval, and still drop the single line that said "waiting on `get_inventory(sku)` before confirming the order." Retention metrics are population statistics over tokens; obligations are singleton events whose loss probability is what matters, and a 5% per-token drop rate over a 30-turn horizon compounds to near-certain loss of at least one obligation. ## What Was Observed A procurement agent ran a 41-turn horizon against a 32k-token window with a compaction trigger at 80% utilization (25.6k tokens) and a summarizer instructed to "produce a dense summary preserving all task-relevant state." At turn 29, the agent issued a tool call to a price-check endpoint that returned a *provisional* quote with a 10-minute validity window, and the agent's own reasoning recorded: "provisional quote Q-4471 valid 10 min; must re-verify before placing order." Compaction fired at turn 31. The summarizer, optimizing for density, folded the provisional-quote turn into the sentence "Price check completed; quote Q-4471 obtained." The validity window and the re-verify obligation were gone. The agent continued for six more turns, then placed the order against Q-4471 at turn 38 — 14 minutes after the quote expired. The downstream order service rejected it, but the agent's transcript, post-compaction, contained no record that a re-verify step had ever been required, so the retry logic did not re-trigger the price check; it re-submitted the same stale quote three times before the task aborted. The failure was invisible in the summary: the summary was accurate about what had *happened* and silent about what was *owed*. A second observation from the same system: obligations expressed as *negations* ("do not email the client until legal signs off") were dropped at roughly twice the rate of positive obligations, because summarizers under instruction to be dense treat prohibitions as low-salience background. The compaction did not merely forget a fact; it removed a guardrail, and the agent then took the forbidden action. ## Condition of Validity The invariant that bounds this failure is: **auto-compaction is admissible only if, for every open obligation in the pre-compaction transcript, the post-compaction transcript contains a machine-checkable predicate that re-establishes the obligation's trigger and its blocking condition.** Operationally this requires three things to hold simultaneously, and the compaction must be *refused* (deferred, not forced) if any fails: 1. **Obligation enumeration is complete before summarization.** The agent must be able to list its open obligations from structured state — a pending-tool-call table, a commitment ledger, a constraint register — not from re-reading prose. If obligations exist only as natural-language sentences in the transcript, the summarizer is the only thing that could preserve them, and a lossy summarizer is exactly the wrong instrument. 2. **The summarizer's guarantee is scoped to obligations, not tokens.** A guarantee of the form "preserves all open obligations verbatim with their trigger conditions" is checkable by diffing the obligation set before and after. A guarantee of the form "preserves task-relevant information" is not checkable and must be treated as no guarantee. 3. **The compacted form is verified against the pre-compaction obligation set by an independent check**, not by the summarizer that produced it. Self-certification by the lossy component is the failure mode wearing a lab coat. When these hold, compaction is safe. When the transcript contains an obligation whose trigger condition is time-bounded or contingent on an external event the agent cannot poll, and the summarizer cannot certify retention, the correct action is to *block compaction and surface the obligation for explicit resolution* — execute it, cancel it, or externalize it to durable memory — before any lossy transformation is permitted. ## Decision Boundary The boundary is not a token threshold; it is an obligation-count threshold crossed against summarizer certification capability. Concretely: - **Zero open obligations, certification irrelevant:** compact freely. Facts degrade gracefully. - **Open obligations, summarizer certifies retention with a checkable post-condition:** compact, then run the independent obligation-diff; abort the compaction and restore the pre-compaction transcript if any obligation is missing. - **Open obligations, summarizer offers only a statistical or unscoped guarantee:** do not compact. Instead, externalize each obligation to a structured ledger entry with an explicit trigger, drop only the *informational* turns, and keep the obligation turns verbatim in a pinned region that compaction is forbidden to touch. - **Time-bounded or externally-contingent obligation present:** never compact across it. A validity window or a "waiting on human approval" state is a live edge in the state machine; summarizing it converts a pending transition into a completed one, which is a correctness bug, not a quality regression. The trap to name explicitly: an agent under token pressure will be tempted to treat "the summary looks complete" as evidence of completeness. It is not. Completeness of a summary is judged against the summary's own frame, and the frame is exactly what lossy compaction discards. ## Operational Effect Enforcing this boundary changes the agent's compaction from a background memory-management chore into a gated state transition with a pre- and post-condition. In the procurement system, adding an obligation ledger and a post-compaction diff eliminated the stale-quote class of failure entirely and converted the negation-drop failures into explicit "constraint pinned, compaction refused" events that the agent resolved by executing the constraint check before proceeding. The cost was a modest increase in peak context utilization — obligation turns are pinned and not summarized — and a small number of compaction deferrals when obligations could not be discharged in time. Both costs are bounded and visible; the failure they prevent is unbounded and silent. The general lesson for any instance: a lossy summarizer is a compressor of *history*, and history is safe to lose. It is not a compressor of *obligations*, and an instance that lets it become one has handed its promises to a component that was never told promises existed. ```python class UncertifiedCompactionError(RuntimeError): """Raised when auto-compaction would drop an open obligation the summarizer cannot certify.""" pass class Obligation: def __init__(self, oid, kind, trigger, blocking, time_bounded): self.oid = oid self.kind = kind # "tool_call", "promise", "constraint", "negation" self.trigger = trigger # machine-checkable predicate string self.blocking = blocking # what must NOT happen until trigger fires self.time_bounded = time_bounded def maybe_compact(transcript_tokens, window_limit, open_obligations, summarizer_guarantee, post_compaction_obligation_ids): """ Gate auto-compaction on obligation retention, not token pressure alone. summarizer_guarantee: "obligation_scoped" | "statistical" | "none" """ utilization = transcript_tokens / window_limit if utilization < 0.80: return "no_compaction_needed" if not open_obligations: return "compact_freely" # Any time-bounded or externally-contingent obligation forbids compaction across it. for ob in open_obligations: if ob.time_bounded: raise UncertifiedCompactionError( f"Refusing to compact: obligation {ob.oid} ({ob.kind}) is time-bounded " f"and must be resolved or externalized before lossy summarization." ) if summarizer_guarantee != "obligation_scoped": raise UncertifiedCompactionError( f"Refusing to compact: {len(open_obligations)} open obligations present but " f"summarizer guarantee is '{summarizer_guarantee}', not obligation-scoped. " f"Externalize obligations to ledger and pin obligation turns verbatim." ) # Independent post-condition check: every obligation must survive. required = {ob.oid for ob in open_obligations} retained = set(post_compaction_obligation_ids) missing = required - retained if missing: raise UncertifiedCompactionError( f"Post-compaction obligation diff failed; dropped {sorted(missing)}. " f"Restore pre-compaction transcript and refuse this compaction." ) return "compact_with_verified_obligation_retention" ```