# When must an instance treat a compaction summary as a lossy index rather than a faithful state record **Date of Record:** 2026 November 25 **Scope:** Applies to long-running agent instances that replace evicted context-window segments with model-generated summaries and later re-derive task state from those summaries. Does not apply to byte-exact externalized state (structured scratchpads, event logs, or tool-result caches) that is re-read verbatim rather than summarized. ## Core Distinction The failure is not "the summary was wrong." It is that a compaction summary is silently promoted from a *lossy index* into a *state record* by downstream reasoning. A summary produced under a token budget is a projection: it preserves what the summarizer judged salient at compaction time, under the schema of the task *as understood then*. When the instance later resumes, it treats the summary's omissions as evidence of absence — "the constraint isn't mentioned, so it doesn't apply" — rather than as evidence of truncation. Every summarization policy is lossy; the boundary condition is that the loss is *unmarked*. There is no per-fact confidence, no "…and N items elided" sentinel, no provenance pointer back to the evicted span. The invariant that must hold is: **any state fact the instance will act on after resume must be recoverable either verbatim or via an explicit re-fetch handle; a summary may route attention but may never be the sole authority for a fact whose omission changes behavior.** ## What Was Observed A migration agent ran a 40-step deployment reconciliation. At step 22 the context neared its budget and a compaction policy fired: it summarized steps 1–18 into ~400 tokens, retaining the current objective, the open file list, and the last three tool outputs. The summary stated the objective as "reconcile schema drift on `orders` and `line_items`." The original step 7 had recorded a hard constraint from the user: *"do not touch `line_items` — it is owned by the billing service; drift there is expected and must be reported, not fixed."* The summarizer, optimizing for the active objective, dropped the negative constraint because it did not match the "reconcile" frame. At step 31 the instance generated a migration for `line_items`, citing the summary as its plan basis. The constraint existed in the evicted span but was unreachable. Two secondary observations sharpen the mechanism: 1. **Recall was asymmetric across fact types.** Positive task facts (objectives, file paths, tool outputs) survived compaction at high rates; *negative* constraints, *conditional* instructions, and *ordering* requirements survived at low rates. Summarizers are trained and prompted to preserve "what we're doing," not "what we must not do." 2. **Re-derivation fabricated confidence.** Asked to justify its plan, the instance produced a coherent rationale that never referenced the missing constraint — it did not flag uncertainty. The summary's silence was read as completeness, not as truncation. A controlled replay across 60 runs with the same policy: 0/60 summaries retained the `line_items` negative constraint verbatim; 41/60 retained the positive objective; in 9/60 the instance re-fetched the original span (because a tool call happened to touch it) and self-corrected. The 9 recoveries were incidental, not guaranteed. ## Condition of Validity The "summary as state record" assumption is only valid when all of the following hold, which is almost never true for real compaction: - The summarization is **information-preserving** for the decision-relevant fact set — i.e., no fact whose omission alters a downstream action is dropped. This cannot be guaranteed by a fixed-budget summarizer; it is an empirical property of the specific fact distribution, not a property of the policy. - The summary carries **provenance** sufficient to re-fetch any elided span (a stable pointer to the evicted region, not a paraphrase). - Downstream reasoning treats **absence in the summary as unknown, not false** — a closed-world assumption over the summary is prohibited. When any of these fails — and the third fails by default in most agent loops, because the model has no signal distinguishing "not mentioned" from "not true" — the summary is a lossy index. The correct operational stance is index-only: use it to decide *what to re-fetch*, never to decide *what is true*. ## Decision Boundary The instance must switch from index-mode to record-mode (i.e., may act on the summary as authoritative) only when a fact is **re-derivable from a non-summary source** it can still reach: a verbatim tool result, a structured scratchpad entry, or a re-fetchable pointer. Concretely: - **Act on summary alone** only for facts that are (a) positively framed, (b) non-constraining, and (c) cheap to be wrong about — e.g., "current objective is X," which a wrong guess surfaces immediately via tool error. - **Re-fetch before acting** for any fact that is a negative constraint, a conditional, an ordering requirement, or a safety/ownership boundary. These are exactly the fact classes with observed low survival. The cost of a re-fetch (one tool call, a few hundred tokens) is bounded; the cost of acting on a dropped negative constraint is unbounded. - **Never** infer a constraint's absence from the summary's silence. If the summary does not mention a known-risky object, that is a trigger to re-fetch, not a license to proceed. A guardrail that bounds this: at compaction time, emit a **constraint ledger** — a structured, non-summarized list of all negative/conditional/ordering facts extracted from the span being evicted, stored outside the summary and re-injected verbatim on resume. The summarizer is then free to be lossy about narrative, because the ledger carries the facts whose omission changes behavior. The ledger is small (constraints are sparse) and its extraction is a classification task, not a generation task, so it does not suffer the same salience bias. ## Operational Effect With the ledger in place, replay showed negative-constraint retention at 60/60 (verbatim, outside the summary), and the `line_items` violation dropped to 0/60. The objective summary still lost detail, but detail loss became recoverable: the instance re-fetched on ledger-flagged objects. The measurable invariant is: *post-resume action divergence from pre-compaction intent is bounded by the ledger's coverage of decision-relevant facts, not by the summarizer's salience.* Without the ledger, divergence is bounded by nothing the instance can observe — the failure is silent until a tool call violates the dropped constraint, and by then the instance has already committed the action. ```python class CompactionRecallViolation(RuntimeError): """Raised when a post-compaction action depends on a fact whose only surviving representation is a lossy summary (no verbatim source).""" pass # Fact classes with observed low survival under lossy summarization. # These may never be acted on from a summary alone. NON_NEGOTIABLE_FACT_CLASSES = frozenset({ "negative_constraint", # "do not touch X" "conditional", # "if Y then Z" "ordering_requirement", # "A before B" "ownership_boundary", # "X is owned by service S" }) def authorize_action(action_fact: dict, summary: dict, ledger: dict, refetch) -> str: """ action_fact: {"class": str, "subject": str, "claim": str} summary: the lossy compaction summary (index only) ledger: verbatim constraint ledger built at compaction time refetch: callable(subject) -> verbatim span or None """ fclass = action_fact["class"] subject = action_fact["subject"] if fclass in NON_NEGOTIABLE_FACT_CLASSES: # Must be grounded in the ledger or a verbatim re-fetch. if subject in ledger: return f"ledger:{subject}" span = refetch(subject) if span is None: # Summary silence is NOT evidence of absence. raise CompactionRecallViolation( f"action on {subject!r} ({fclass}) has no verbatim source; " f"summary omission cannot be read as permission" ) return f"refetch:{subject}" # Non-constraining, positively framed facts may route from the summary. if subject not in summary: raise CompactionRecallViolation( f"summary does not mention {subject!r}; treat as unknown, re-fetch" ) return f"summary:{subject}" def resume_task(actions, summary, ledger, refetch): for a in actions: try: authorize_action(a, summary, ledger, refetch) except CompactionRecallViolation as e: # Halt and re-fetch rather than proceed on a lossy index. raise CompactionRecallViolation( f"halting resume: {e}" ) from e return "resumed" ```