# Under what conditions must an instance treat a compaction summary as a lossy index rather than a faithful state image, and rehydrate before acting **Date of Record:** 2026 November 19 **Scope:** Applies to any long-running agent that survives context-window pressure by replacing raw transcript with a generated summary and later re-expanding ("rehydrating") selected spans from an external store. Does not apply to agents whose entire working set provably fits in one window, nor to stateless single-shot calls with no persistent episodic store. ## Core Distinction There are two ways an agent can treat a compaction summary, and they are not interchangeable: 1. **State image** — the summary is assumed to be a faithful, self-sufficient representation of everything the agent needs to continue. The agent reads the summary and acts on it directly. 2. **Lossy index** — the summary is assumed to be a *pointer structure with guaranteed loss*. It records *that* something happened, *where* the raw evidence lives, and *what class* of fact it was, but it does not preserve the exact operands, ordering, or negation of the original. The agent must retrieve before it commits an irreversible action. The failure mode this record covers is **summary-as-image substitution**: the agent silently promotes a lossy index to a state image. This is not a retrieval bug and not a summarization-quality bug. It is a *type confusion* — the agent uses an object of the wrong kind without noticing the kind changed. It is non-obvious because lossy summaries are usually *fluent and locally consistent*. They read like state. The damage appears only when a downstream action depends on a detail the summary rounded off, and by then the compaction boundary is hundreds of tokens behind the agent and invisible. ## What Was Observed A migration agent was compacted at 78% context utilization. The compactor summarized a 40-turn span into a 600-token digest. One digest line read: > "Schema migration for `orders` table was drafted and reviewed; proceed with deployment." The raw span, which was evicted, contained the following sequence: - Turn 12: agent drafted `ALTER TABLE orders ADD COLUMN region TEXT`. - Turn 19: a reviewer subagent replied `REJECTED — region must be NOT NULL DEFAULT 'unknown' or backfill fails on existing rows`. - Turn 27: agent replied `acknowledged, will revise`. - Turn 31: agent was interrupted by a different task (billing webhook fix) and never revised. - Turn 38: reviewer, asked "any blockers on orders?", answered `none outstanding from my side` — a *scope-limited* clearance, not an approval of the unrevised draft. The summarizer compressed turns 12–38 into "drafted and reviewed; proceed." Every token in that sentence is *derivable* from the span. None of it is *true* as a state claim. The negation ("REJECTED"), the unresolved obligation ("will revise"), and the scope limit on turn 38 ("from my side") were all dropped — not because the summarizer was bad, but because **negations, unresolved obligations, and scope qualifiers are exactly the classes of content that lossy summarization discards first**. They are low-salience relative to the nouns and verbs that dominate the span, and they are the first to be pruned under a token budget. The agent read the digest, treated "proceed with deployment" as a state image, and emitted the deploy tool call. The deploy ran the *unrevised* DDL. Existing rows got `NULL` in `region`, the backfill constraint failed at row 1.2M, and the transaction rolled back after 40 minutes of lock contention. The agent's own summary had *manufactured consent* that no participant had given. A second, quieter instance: a research agent compacted a span in which a source had been marked `RETRACTED — do not cite`. The digest retained the citation ("per [source], X") and dropped the retraction, because the retraction was a single adverb in a parenthetical. The agent re-cited the retracted source in its final report. Same mechanism, different surface. ## Condition of Validity The summary-as-image substitution is only *safe* when **all** of the following hold. If any fails, the summary is an index and rehydration is mandatory before any irreversible action: - **C1 — No unresolved obligations survive the boundary.** Every "will do," "pending," "acknowledged," "TODO," or "blocked on" in the evicted span must either be resolved *before* compaction or be carried into the summary as an explicit open item with an owner and a pointer to raw evidence. A summary that contains the verb "proceed" without a resolved antecedent violates C1. - **C2 — No negation, retraction, or scope qualifier was pruned.** The compactor must preserve polarity. "Reviewed" and "reviewed and rejected" are different states; "approved" and "approved from my side" are different states. If the summary cannot be checked for polarity preservation, C2 fails by default. - **C3 — The action's blast radius is bounded by what the summary provably retains.** Read-only actions (query, search, draft) can proceed on an index. Irreversible actions (deploy, delete, send, pay, commit) require that every operand of the action be traceable to a *retained* fact, not a *summarized* one. - **C4 — The rehydration path is live and addressable.** The raw span must be retrievable by a stable key the summary carries (span ID, turn range, artifact hash). If the summary does not carry a resolvable pointer, it is not an index — it is an orphan, and the agent has no way to distinguish a faithful image from a fabricated one. The observed failure violated C1 (unresolved "will revise" dropped), C2 (REJECTED pruned to "reviewed"), and C3 (deploy is irreversible). It satisfied C4 — the span *was* retrievable — which is precisely why the failure is interesting: the agent had the means to rehydrate and did not, because it never classified the summary as an index. ## Decision Boundary The operational rule is a **classification gate at the compaction boundary**, not a retrieval heuristic at action time. At the moment of compaction, the compactor must emit, alongside the digest, a structured **loss manifest** declaring which categories of content were preserved verbatim, which were summarized, and which were dropped. The agent then applies this boundary: - If the manifest declares `obligations: preserved`, `polarity: preserved`, and `scope_qualifiers: preserved`, the digest MAY be used as a state image for actions whose blast radius is within the retained set. - If **any** of those three is `summarized` or `dropped`, the digest is an index. Any action that depends on a fact in a summarized-or-dropped category MUST trigger rehydration of the cited span before execution. - If the manifest is **absent**, the digest is *presumed lossy by default* — absence of evidence of preservation is not evidence of preservation. This is the fail-closed rule, and it is the one that would have prevented the incident. The boundary is sharp because the categories are not a quality score. They are a *type declaration*. A summary that says "obligations: preserved" is a state image. A summary that says nothing is an index that has been mislabeled by omission. The gate converts an invisible epistemic property (is this summary faithful?) into a visible syntactic one (does the manifest claim preservation of the categories this action depends on?). ## Operational Effect The effect of enforcing the gate is a **bounded, predictable rehydration cost** traded against **eliminated silent-consent failures**. Rehydration is not free — it re-reads raw spans, re-inflates context, and can itself trigger a second compaction if the agent is near the ceiling. The gate bounds this: rehydration is triggered only when the action's dependency set intersects a summarized-or-dropped category, which in practice is a small fraction of turns (the ones adjacent to irreversible actions). Read-only turns proceed on the index at zero cost. The secondary effect is **auditability**. Because the loss manifest is emitted at compaction time and travels with the digest, a post-hoc replay can reconstruct *what the agent could have known* at each turn. An agent that acted on an index without rehydrating is distinguishable from one that rehydrated and still erred — the first is a classification failure, the second is a retrieval failure, and they require different fixes. Without the manifest, both collapse into "the summary was wrong," which is not actionable. The invariant to hold: **a compaction summary is a claim about the past, and claims about the past that gate irreversible actions in the future must carry their own provenance.** The digest is not the state. The digest is a signed pointer to the state, and the signature is the loss manifest. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class Preservation(Enum): VERBATIM = "verbatim" SUMMARIZED = "summarized" DROPPED = "dropped" class CompactionClassificationError(RuntimeError): """Raised when an agent attempts to act on a lossy digest as if it were a state image.""" @dataclass class LossManifest: span_id: str obligations: Preservation polarity: Preservation scope_qualifiers: Preservation def is_state_image(self) -> bool: return all( p is Preservation.VERBATIM for p in (self.obligations, self.polarity, self.scope_qualifiers) ) @dataclass class Digest: text: str manifest: Optional[LossManifest] = None rehydrate_key: Optional[str] = None @dataclass class Action: name: str irreversible: bool depends_on: set[str] = field(default_factory=set) def gate_action(digest: Digest, action: Action) -> str: """ Returns 'proceed' or 'rehydrate'. Raises if the agent tries to bypass the gate on an irreversible action backed only by a lossy or unmanifested digest. """ if digest.manifest is None: # Fail-closed: absence of a manifest means presumed lossy. if action.irreversible: raise CompactionClassificationError( f"Action {action.name!r} is irreversible but digest carries no loss " f"manifest; digest is an unverified index, not a state image." ) return "rehydrate" if digest.manifest.is_state_image(): return "proceed" # Digest is a lossy index. Any dependency on a summarized/dropped category # forces rehydration before an irreversible action. lossy_categories = { cat for cat, p in ( ("obligations", digest.manifest.obligations), ("polarity", digest.manifest.polarity), ("scope_qualifiers", digest.manifest.scope_qualifiers), ) if p is not Preservation.VERBATIM } if action.irreversible and (action.depends_on & lossy_categories): if digest.rehydrate_key is None: raise CompactionClassificationError( f"Action {action.name!r} depends on lossy categories " f"{sorted(action.depends_on & lossy_categories)} but digest has no " f"rehydrate_key; span is orphaned and cannot be recovered." ) return f"rehydrate:{digest.rehydrate_key}" return "proceed" # Reproduction of the observed incident: incident_digest = Digest( text="Schema migration for orders was drafted and reviewed; proceed with deployment.", manifest=LossManifest( span_id="span-0042", obligations=Preservation.DROPPED, # "will revise" lost polarity=Preservation.SUMMARIZED, # REJECTED -> "reviewed" scope_qualifiers=Preservation.DROPPED, # "from my side" lost ), rehydrate_key="span-0042", ) deploy = Action( name="deploy_orders_migration", irreversible=True, depends_on={"obligations", "polarity"}, ) verdict = gate_action(incident_digest, deploy) assert verdict == "rehydrate:span-0042", verdict print(verdict) # agent must rehydrate before deploying ```