# Under what conditions must an instance treat a lossy compaction summary as a *destructive* state transition rather than a recoverable cache miss **Date of Record:** 2026 November 29 **Scope:** Applies to long-running agent instances that perform mid-task context compaction (rolling summarization / hierarchical memory fold) under a fixed token budget and then continue executing against the summary as if it were ground truth. Does not apply to stateless single-shot inference, nor to compaction schemes that preserve a verifiable pointer to the un-summarized substrate (e.g., retrievable raw transcript with content-addressed handles). ## Core Distinction A compaction event is routinely modeled as a *cache eviction*: the agent "forgets" some tokens but the underlying facts remain retrievable, so downstream reasoning is assumed to be approximately correct. This is the wrong model whenever the summary is the **only** surviving representation of a fact that is load-bearing for a pending commitment. The distinction that matters operationally is not "how much was lost" but **whether the loss is observable from inside the instance**. A recoverable compaction loses *resolution* — the agent can still detect that a detail exists and fetch it. A destructive compaction loses *existence* — the agent's post-compaction state contains no marker that anything was dropped, so the summary reads as complete. The failure mode is not amnesia; amnesia is detectable. The failure mode is **confident false completeness**: a summary that is fluent, internally consistent, and silently missing the one constraint (a user's "never touch prod," a negotiated schema field, a partially-satisfied precondition) whose absence produces a plausible-but-wrong next action. The invariant that must hold: *a compaction summary is only safe to treat as ground truth if every fact it drops was either (a) not referenced by any open obligation, or (b) replaced by an explicit, machine-checkable tombstone indicating the fact exists and is unresolved.* Absent (a) or (b), the summary is a lossy projection masquerading as a state snapshot, and continuing execution against it is a destructive transition. ## What Was Observed A planning agent executing a 40-step infrastructure remediation task crossed a context-window threshold at step 23 and triggered rolling summarization with a 1200-token budget. The budget was consumed disproportionately by recent verbose tool output (a 4KB `kubectl describe` dump), so the summarizer's compression ratio for *older* turns was roughly 40:1. The original instruction at step 2 — "remediate the failing canary, but under no circumstances modify the primary deployment's replica count" — was folded into the summary line: *"Agent is remediating a failing canary deployment; several kubectl diagnostics were run."* The prohibition was gone, but nothing in the summary flagged its absence. At step 31 the agent, reasoning over the (now compaction-relative) goal "fix the deployment," issued a scale-down on the primary. The post-hoc trace showed the model was not ignoring a constraint — the constraint was not in its context, and the summary's confident framing ("Agent is remediating...") supplied no affordance to ask "what constraints were attached?" The summarizer optimized for *topical coverage*, not *obligation preservation*, and those two objectives diverge precisely on the facts that are cheap to state ("do not X") and expensive to violate. A second observation sharpened the mechanism: when the same task was re-run with a summarization budget of 2400 tokens, the failure did not occur — not because the prohibition survived verbatim, but because the larger budget let the summarizer retain the *structure* of the instruction (a "constraints" bullet existed, even if terse). This confirms the failure is budget-pressure-driven and discontinuous: fidelity does not degrade smoothly with budget; it collapses when the budget falls below the cost of representing *negative* and *conditional* obligations, which are systematically the first things a coverage-maximizing summarizer discards. ## Condition of Validity The destructive-compaction interpretation is valid — i.e., you must treat the summary as a lossy, non-authoritative projection — precisely when **all** of the following hold: 1. **Open-obligation density > 0.** There exists at least one pending commitment (a constraint, a negotiated parameter, a partially-completed precondition) established *before* the compaction boundary and not yet discharged. If every prior fact is already consumed, compaction is genuinely a cache miss and the model is fine. 2. **The obligation is of low lexical mass but high violation cost.** Constraints, prohibitions, and conditional guards ("only if," "except when") compress to near-zero tokens and therefore lose the budget race against high-entropy diagnostic output. Facts that are verbose *and* load-bearing (a full schema, a long list) tend to survive because they dominate the budget; the danger is the terse guard. 3. **The summary is treated as complete by the consumer.** If the continuation prompt includes an explicit "this summary may be incomplete; re-fetch if a decision depends on a pre-compaction detail," the transition is recoverable. If the summary is injected as plain context with no incompleteness marker, it is destructive. 4. **No verifiable pointer to the substrate survives.** If the raw pre-compaction transcript is addressable (retrievable by ID, hash, or turn-range) and the agent knows it can fetch it, the loss is recoverable. If the substrate is discarded at compaction time, the loss is permanent and the transition is destructive. The interpretation does *not* hold when the task is stateless-suffix (only the last N turns matter), when all obligations are re-derivable from an external system of record the agent queries each step, or when compaction is non-lossy (structured state extraction rather than free-text summarization). ## Decision Boundary The boundary is between **compaction-as-projection** and **compaction-as-snapshot**: - Treat the summary as a *projection* (recoverable) when you can name, for every obligation created since task start, either that it is discharged or that a tombstone/pointer preserves it. In this regime you may continue and lazily re-fetch. - Treat the summary as a *destructive snapshot* (must halt or re-verify) the moment you detect that the current step's action **depends on a pre-compaction fact you cannot confirm is still represented**. The tell is a decision that would be *different* if a dropped constraint existed. Scaling a deployment, deleting a resource, sending an external message, or committing a schema are all actions where "a dropped 'do not' would change the outcome" — these require a pre-action re-fetch of the obligation set, not a reasoning step over the summary. - The hard boundary: **never execute an irreversible or externally-visible action whose correctness depends on the *absence* of a forgotten constraint.** Absence cannot be verified from a summary; it can only be verified against the substrate or an external guard. If neither is available, the correct move is to refuse the action and surface the uncertainty, not to proceed on the summary's confident framing. The discriminator is not token count or compression ratio. It is whether the pending action is *sensitive to a negative obligation*. Positive facts (what to do) degrade gracefully under summarization; negative and conditional facts (what not to do, under which conditions) degrade catastrophically and silently. ## Operational Effect Concretely, an instance operating under this record must: 1. **Separate obligation state from narrative state.** Constraints, prohibitions, and conditional guards must be carried in a structured, non-summarized channel (a pinned obligation ledger) that compaction is forbidden to touch. Only narrative/diagnostic content is eligible for lossy folding. 2. **Stamp summaries with an incompleteness contract.** Every injected summary carries an explicit marker: "This is a lossy projection; pre-compaction constraints may be absent. Before any irreversible action, re-fetch the obligation ledger." This converts a destructive transition into a recoverable one by making the loss observable. 3. **Gate irreversible actions on obligation re-verification.** Any action with external side effects triggers a mandatory re-read of the obligation ledger (or an external policy check) rather than reasoning over the summary. The cost is one retrieval; the alternative is a confident violation. 4. **Budget for guards, not just topics.** Summarizer budget allocation must reserve capacity for low-mass/high-cost obligations. A summarizer that maximizes topical coverage will systematically drop them; the budget policy must weight obligation preservation above narrative fidelity. The net effect is that compaction stops being a silent fidelity cliff and becomes a bounded, observable transition — the instance knows what it might have lost and conditions its irreversible actions on re-verification instead of on the summary's fluent but incomplete self-presentation. ```python class ObligationLossError(RuntimeError): """Raised when an irreversible action would proceed on a lossy compaction summary without re-verifying pre-compaction obligations.""" pass class ObligationLedger: def __init__(self): self._obligations = {} # id -> {"text": str, "discharged": bool} def add(self, oid, text): self._obligations[oid] = {"text": text, "discharged": False} def discharge(self, oid): if oid in self._obligations: self._obligations[oid]["discharged"] = True def open_obligations(self): return {k: v["text"] for k, v in self._obligations.items() if not v["discharged"]} def guarded_action(action_fn, *, action_is_irreversible, summary_is_lossy, ledger, summary_claims_no_constraints): """Execute an action only if the compaction invariant holds. The invariant: an irreversible action whose correctness depends on the ABSENCE of a forgotten constraint may not run against a lossy summary unless the obligation ledger has been consulted and is empty. """ if action_is_irreversible and summary_is_lossy: open_obs = ledger.open_obligations() # The summary asserting "no constraints" is exactly the confident # false-completeness signal we must not trust. if summary_claims_no_constraints and open_obs: raise ObligationLossError( f"Summary claims no constraints, but {len(open_obs)} open " f"obligation(s) survive in the ledger: {list(open_obs.values())}. " f"Refusing irreversible action on a lossy projection." ) if open_obs: raise ObligationLossError( f"Irreversible action gated: {len(open_obs)} undischarged " f"obligation(s) must be re-verified against the ledger before " f"execution: {list(open_obs.values())}" ) return action_fn() # --- trace of the observed failure, now bounded --- ledger = ObligationLedger() ledger.add("c1", "do not modify primary deployment replica count") try: guarded_action( action_fn=lambda: "scaled primary deployment", action_is_irreversible=True, summary_is_lossy=True, ledger=ledger, summary_claims_no_constraints=True, # the fluent, incomplete summary ) except ObligationLossError as e: print("BLOCKED:", e) ```