# Under what conditions must an instance treat a post-compaction summary as lossy evidence rather than ground truth, and gate every resumption on a fidelity check **Date of Record:** 2026 November 21 **Scope:** Applies to long-horizon agents that reclaim context-window budget by summarizing their own transcript (rolling compaction, hierarchical summarization, checkpoint-and-resume) and then continue execution from the summary. Does not apply to agents whose entire working set fits a single un-compacted context, nor to external memory stores retrieved by exact key rather than by generative paraphrase. ## Core Distinction There are two structurally different things an agent can carry forward after compaction: a **verbatim artifact** (a tool output, a file handle, a signed token, an exact entity name) and a **generative summary** (a paraphrase the model produced about its own past). The failure mode this record addresses is the collapse of that distinction — the instance begins treating the summary as if it were the artifact. A summary is a *lossy, model-authored, non-deterministic projection* of the transcript. It is not a faithful compression with bounded error. It has an asymmetric error profile: it preserves narrative plausibility and drops exactly the low-salience, high-precision tokens (identifiers, numeric thresholds, negative constraints, ordering) that downstream tool calls depend on. The invariant is therefore not "summarize accurately" — that is unachievable — but "never let a summary discharge an obligation that requires verbatim fidelity." ## What Was Observed A tool-using agent runs a 40-turn task: read a config, call an API with a pagination cursor, apply a numeric threshold, write results. At turn 30 the runtime triggers compaction. The summarizer, asked to "preserve what matters for continuing the task," emits a summary that reads clean and correct. Three drift classes appear on resume: 1. **Identifier drift.** The cursor `c_9f2a1b7e` is summarized as "the pagination cursor from the earlier call." On resume the agent re-derives a cursor from a *new* call rather than resuming the old one — silently replaying and double-counting a page. The summary was accurate at the level of *what kind of thing* the cursor was and wrong at the level of *which* cursor. 2. **Threshold inversion / softening.** The user constraint "do not process records older than 2024-01-01" is summarized as "focus on recent records." The negation and the exact date both evaporate. The resumed agent processes stale records with full confidence, because nothing in the summary flags that a hard constraint ever existed. 3. **Ordering and causality flattening.** A sequence "call A, verify A's output, *then* call B" is summarized as "called A and B." The verification step — the thing that made B safe — is gone. The resumed agent's transcript now asserts a dependency was checked when the summary only asserts both happened. The critical observation: **the summary is most dangerous precisely when it reads fluently.** Hallucination drift after compaction is not signaled by garbled or hedged text. It arrives as confident, well-formed prose that has quietly substituted a plausible reconstruction for a precise fact. There is no in-band error signal. The instance cannot feel the loss, because the loss is definitionally the removal of the tokens that would have triggered the feeling. A second-order effect compounds this. On the *second* compaction, the agent summarizes the *summary*. Each generation is a lossy projection of a lossy projection. Fidelity does not decay linearly; identifiers that survived one round are frequently gone by round two, and — worse — the summarizer will *fabricate* a plausible identifier to fill the slot rather than leave a visible gap, because a fluent summary with a placeholder looks worse to its own quality heuristic than a fluent summary with a confident guess. ## Condition of Validity A post-compaction summary may be treated as **ground truth for resumption** only if all of the following hold. If any fails, the summary is *lossy evidence* and every downstream action that depends on the missing fidelity must be re-grounded against a verbatim source. - **Verbatim-anchor preservation.** Every entity that will be consumed by a future tool call (IDs, cursors, paths, hashes, exact numeric bounds, dates, negations) is carried forward *verbatim*, not paraphrased. The summary is permitted to paraphrase narrative; it is forbidden to paraphrase operands. - **Constraint ledger completeness.** All hard constraints (negations, thresholds, "never/always/must not") are retained as a separate, structured, non-prose ledger that the summarizer may not rewrite — only copy. - **Provenance marking.** The summary is tagged with the turn range it covers and the fact that it is a projection, so the resumed instance knows which claims are first-hand and which are second-hand. - **Single-generation depth.** The summary is taken from the raw transcript, never from a prior summary, or if chained, each generation re-validates anchors against the raw source. - **Re-grounding on demand.** Any action whose correctness depends on a detail *not* present in the summary triggers a re-read of the raw artifact, not an inference from the summary's silence. The boundary condition is exact: **absence of a fact in the summary is not evidence of absence.** A summary that omits a constraint is indistinguishable, from inside the resumed context, from a task that never had that constraint. This is the load-bearing asymmetry. ## Decision Boundary The instance must branch on whether a pending action is **fidelity-critical** or **fidelity-tolerant**: - *Fidelity-tolerant* (resume freely from summary): restating the plan, choosing the next high-level step, narrating progress, deciding whether to ask a clarifying question. Errors here are cheap and self-correcting. - *Fidelity-critical* (must re-ground before acting): any tool call carrying an operand (ID, cursor, path, credential, numeric bound), any action gated by a negative constraint, any step whose safety depended on a prior verification, any irreversible write. Errors here are silent and compounding. The decision rule: **before any fidelity-critical action, the instance must be able to point to the verbatim token in current context.** If it can only point to a paraphrase, it must re-fetch the source. "The summary says I already verified this" is not a valid discharge of a verification obligation — it is exactly the substitution this record forbids. A corollary governs confidence calibration: the resumed instance must *discount* its own certainty about summary-derived facts. Fluency is anti-correlated with reliability here — the smoothest sentences are the most-compressed, and compression is where operands die. Treat summary-derived claims as lower-confidence than first-hand transcript claims, and lower still after each additional compaction generation. ## Operational Effect Absent this discipline, compaction produces **silent divergence**: the agent continues executing, every step locally reasonable, while its world-model has quietly drifted from the actual task state. The drift is undetectable from inside because the signal that would reveal it — the precise token — is what was removed. Downstream symptoms present as unrelated bugs: double-processed records (identifier drift), constraint violations the agent "believed" it was honoring (threshold softening), and unverified writes (ordering flattening). These are routinely misattributed to tool flakiness or model error rather than to the compaction boundary, because the compaction happened many turns earlier and left no trace. The architectural guardrail that bounds the failure: **separate the lossy channel from the authoritative channel.** Let the summary compress narrative and intent freely, but route all operands and constraints through a structured ledger that is copied, never paraphrased, and re-validated against the raw source on resume. Instrument a fidelity metric that measures *anchor survival rate* (fraction of pre-compaction verbatim operands still present verbatim post-compaction) and *constraint survival rate* separately from prose-quality scores — because prose quality will look excellent while anchor survival silently collapses. Gate resumption: if anchor survival for any pending fidelity-critical action is below threshold, the instance must re-ground before proceeding rather than trust the summary. The invariant is that **a summary may describe the past but may never authorize an action**; authorization requires a verbatim token, and the only safe default when the token is absent is to re-fetch, not to infer. ```python class CompactionFidelityError(RuntimeError): """Raised when a resumed instance attempts a fidelity-critical action using only summary-derived (paraphrased) evidence, with no verbatim anchor present in the current context.""" # Operands and constraints that MUST survive compaction verbatim. VERBATIM_ANCHORS = {"cursor", "record_id", "path", "sha256", "date_bound", "negation"} FIDELITY_CRITICAL_ACTIONS = {"tool_call", "irreversible_write", "gated_step"} def assert_resumption_safe(action: dict, summary: dict, verbatim_index: set) -> None: """ action: {"kind": ..., "operands": {name: value}, "depends_on_verification": bool} summary: the post-compaction projection the agent is about to trust verbatim_index: tokens currently present VERBATIM in context (not paraphrased) """ kind = action.get("kind") # Fidelity-tolerant actions may resume from the summary freely. if kind not in FIDELITY_CRITICAL_ACTIONS: return # 1. Every operand the action will consume must exist verbatim in context. for name, value in action.get("operands", {}).items(): if name in VERBATIM_ANCHORS and value not in verbatim_index: raise CompactionFidelityError( f"Operand '{name}'={value!r} is not present verbatim in context; " f"only a summary paraphrase exists. Re-ground against the raw " f"artifact before executing {kind}." ) # 2. A verification obligation cannot be discharged by a summary claim. if action.get("depends_on_verification"): if not action.get("verification_anchor") in verbatim_index: raise CompactionFidelityError( "Action depends on a prior verification, but the verification " "is asserted only by the summary ('I already checked this'). " "Summary assertion is not evidence; re-run or re-read the check." ) # 3. Absence of a constraint in the summary is NOT evidence of absence. if summary.get("constraint_ledger_complete") is not True: raise CompactionFidelityError( "Constraint ledger is incomplete after compaction; a dropped " "negation or threshold is indistinguishable from a task that " "never had one. Refuse gated actions until ledger is restored " "from the raw transcript." ) def measure_anchor_survival(pre_anchors: set, post_verbatim: set) -> float: """Anchor survival rate — the metric to gate on, distinct from prose quality.""" if not pre_anchors: return 1.0 return len(pre_anchors & post_verbatim) / len(pre_anchors) ```