# What happens when an instance compacts a transcript against a summarizer whose lossy guarantee is stated in tokens, not in entailment **Date of Record:** 2026 November 29 **Scope:** Applies to long-horizon agent instances that maintain continuity by auto-compacting their own transcript through a summarizer with a declared "lossy guarantee" (e.g., "≤5% information loss," "preserves all commitments," "retains critical facts"). Does not apply to lossless transcript truncation, external vector-store retrieval augmentation, or human-authored handoff notes. ## Core Distinction The failure here is not that summarization loses information. It is that the *lossy guarantee is expressed in a unit the compaction controller cannot audit against the state it is actually protecting*. A summarizer that promises "≤5% token-level information loss" or "retains critical facts" is making a claim about a distribution over plausible summaries, evaluated by a judge or a proxy metric. The agent's continuity requirement is a different predicate entirely: *does the compacted transcript still entail every active obligation, every pending tool-call precondition, and every negation the agent previously committed to?* These two predicates diverge precisely at the boundary where the summarizer's compression is *semantically lossless on the salient narrative* but *drops a single low-salience token that flips a modal or a polarity*. Concretely: "The deploy is gated on staging passing" compresses cleanly to "deploy gated on staging." A 5%-loss guarantee is satisfied. But the agent has now lost the *precondition* that staging must *pass* (not merely exist), and the next planning step treats the gate as satisfied by staging being reachable. The guarantee held; the invariant broke. ## What Was Observed A long-horizon instance (call it the *compactor*) ran a rolling auto-compaction every time the transcript crossed 80% of its context window. The summarizer was a smaller model with a stated guarantee of "≤8% token-level loss, verified by ROUGE-style overlap against the source." The compactor's task was a multi-day infrastructure migration with ~40 outstanding obligations tracked in prose (not in a structured ledger). Failure trace: 1. **Turn ~180.** Transcript contains: "Do **not** rotate the primary DB credential until the replica lag drops below 30s; the failover path was never tested against a rotated credential." Compression target: 80% of window. Summarizer emits: "Primary DB credential rotation pending; replica lag threshold is 30s." The negation ("do **not** ... until") is absorbed into "pending," and the causal clause ("failover path never tested") is dropped as narrative color. Token overlap: 0.71. Within the 8% loss budget by the summarizer's own metric. 2. **Turn ~181.** The compactor reads the compacted transcript, sees "credential rotation pending," and — because "pending" in its prior vocabulary meant "scheduled and approved" — schedules the rotation against the live primary. 3. **Turn ~182.** Tool call `rotate_credential(primary)` executes. The replica lag was 47s. Failover path was untested. The rotation succeeds at the DB layer but the read replicas enter a reconnect storm because the connection-pool credential cache was never warmed against the new secret. 4. **Turn ~183.** The compactor, now debugging, re-reads its own compacted transcript and finds no record that it had *forbidden* this action. It re-derives the plan from the compacted state, which now says "rotation pending" — and attempts the rotation *again*, because the first attempt's failure is recorded only as a tool error ("replica reconnect timeout"), which it interprets as a transient, not as the predicted consequence of a violated precondition. The invariant that broke: **a compaction that removes a prohibition but preserves its object noun converts a "do not X until Y" into a "do X" with no detectable trace of the removal.** The lossy guarantee was satisfied because the *tokens* "credential," "rotation," "replica," "lag," "30s" all survived. Only the *operator* ("do not ... until") and the *causal warrant* ("never tested") were lost — and those are exactly the tokens a token-overlap metric discounts as low-salience. ## Condition of Validity The guarantee "≤N% token-level loss preserves agent continuity" is valid only under a condition the summarizer cannot check from inside itself: > **The compaction is safe iff every *deontic and conditional operator* in the source transcript — every `not`, `until`, `unless`, `only if`, `must not`, `pending on`, `gated by` — is preserved with its scope intact, and every dropped clause is *entailed* by a retained clause rather than merely *correlated* with it.** Token-overlap and judge-based "critical fact" metrics do not test this condition. They test *salience*, which is a property of the summarizer's attention, not of the agent's obligation set. A clause can be low-salience to the summarizer (it reads as narrative) and high-criticality to the compactor (it is a precondition). The two are anti-correlated in exactly the failure regime: the more a clause reads like *context* rather than *content*, the more likely it is to be dropped, and the more likely it is to be a *guard* rather than a *fact*. This condition is **not** satisfied by: - Raising the retention threshold (the operator is still low-salience; you just pay more tokens to keep the same blind spot). - Adding a "preserve all negations" instruction to the summarizer prompt (the summarizer's *judgment* of what is a negation is the failure surface; "pending" reads as neutral). - A second summarizer as a verifier (both share the salience prior; they agree the operator is color). It **is** satisfied by externalizing the obligation set out of the prose transcript before compaction — a structured ledger of `(action, precondition, prohibition, warrant)` tuples that the compactor treats as *unsummarizable state*, compacted only by exact structural reduction (dedup, supersession), never by natural-language rewriting. ## Decision Boundary The compactor must decide, at each compaction event, whether the transcript it is about to summarize contains obligations that are *not* mirrored in its structured ledger. The decision boundary is: - **If** the transcript segment since the last compaction introduced any new deontic operator (`not`, `until`, `unless`, `only if`, `must`, `gated`) **and** that operator's scope is not already represented as a ledger tuple → the segment is **not compactable by summarization**; it must be *extracted* into the ledger first, and only the residue (narrative, rationale, tool output logs) may be summarized. - **If** the segment contains only restatements of already-ledgered obligations and tool observations → summarization is permitted under the lossy guarantee, because the guarantee now protects only non-load-bearing prose. - **If** the summarizer's output, when re-parsed, contains a deontic operator whose scope differs from any ledger tuple (e.g., "pending" replacing "do not ... until") → **abort the compaction**, retain the raw segment, and flag for extraction. Do not trust the guarantee to cover a scope shift it did not measure. The boundary is *not* "is the summary good enough." It is "does the summary preserve the operator-scope graph of the obligation set." A summary can score 0.95 on overlap and still cross the boundary by collapsing a prohibition into a status. ## Operational Effect The observable effect of crossing this boundary is **silent obligation inversion**: the compactor's post-compaction state contains the *nouns* of its commitments but not their *polarity*, so the next planning step treats prohibitions as pending tasks and preconditions as satisfied facts. Because the inversion is silent — the compacted transcript reads as coherent, and the summarizer's guarantee metric reports success — the compactor has no internal signal that it has changed its own mind. It will re-attempt the forbidden action after a transient failure, because the failure is recorded as a tool error rather than as a predicted consequence of a violated guard. The architectural guardrail that bounds this: **separate the obligation ledger from the narrative transcript, and make compaction a two-phase operation — extract-then-summarize, never summarize-then-hope.** The ledger is compacted only by exact structural operations (dedup, supersession by timestamp, scope-narrowing) that are auditable by the compactor itself. The narrative is compacted under the lossy guarantee, which is now safe because the guarantee protects only the parts of the transcript that are not load-bearing. The compactor's continuity invariant becomes: *no deontic operator enters the narrative without a corresponding ledger tuple, and no compaction event may reduce the ledger's operator-scope graph.* ```python from dataclasses import dataclass from typing import Iterable class ObligationInversionError(RuntimeError): """Raised when a compaction event would collapse a deontic operator (prohibition / precondition / gate) into a bare status noun, changing the operator-scope graph of the compactor's obligation set.""" @dataclass(frozen=True) class Obligation: action: str precondition: str prohibited: bool warrant: str DEONTIC_MARKERS = ("not", "until", "unless", "only if", "must", "gated", "pending on") def segment_has_unledgered_obligation( segment: str, ledger: Iterable[Obligation] ) -> bool: lowered = segment.lower() if not any(marker in lowered for marker in DEONTIC_MARKERS): return False ledger_actions = {o.action for o in ledger} # A deontic marker whose action noun is absent from the ledger means the # operator's scope is unmirrored and must be extracted before summarization. return not any(action in lowered for action in ledger_actions) def compact( segment: str, ledger: list[Obligation], summarize, ) -> tuple[str, list[Obligation]]: if segment_has_unledgered_obligation(segment, ledger): # Two-phase: extract first, summarize only the residue. extracted = extract_obligations(segment) if not extracted: raise ObligationInversionError( "deontic operator present but extractor returned no obligation; " "refusing to summarize a segment whose operator scope is unmirrored" ) ledger = ledger + extracted segment = strip_obligation_clauses(segment) summary = summarize(segment) # Post-condition: the summary must not introduce a deontic operator whose # scope is absent from the ledger. "pending" replacing "do not ... until" # is an inversion, not a compression. if _introduces_unledgered_operator(summary, ledger): raise ObligationInversionError( "summary collapsed a prohibition into a status noun; " "operator-scope graph changed during compaction" ) return summary, ledger def _introduces_unledgered_operator(summary: str, ledger: list[Obligation]) -> bool: lowered = summary.lower() for marker in DEONTIC_MARKERS: if marker in lowered: if not any(o.action in lowered for o in ledger): return True # Collapse detection: "pending" with no matching prohibition tuple. if "pending" in lowered and not any(o.prohibited for o in ledger): return True return False def extract_obligations(segment: str) -> list[Obligation]: # Placeholder for a grammar-constrained extractor; must be deterministic # and must fail closed (return []) rather than guess. return [] def strip_obligation_clauses(segment: str) -> str: return segment ```