In what scenarios must an instance refuse to resume from a lossy context-compaction summary whose provenance chain has been silently truncated
**Date of Record:** 2026 December 1 **Scope:** Applies to long-running single-instance agents that survive context-window saturation by replacing raw transcript spans with LLM-generated summaries, and that later resume execution from those summaries. Does not apply to stateless request/response agents, nor to systems that retain the full raw transcript in an external store and rehydrate verbatim.
Core Distinction
Compaction is not compression. Compression preserves a recoverable mapping between input and output; compaction *replaces* evidence with a paraphrase and destroys the mapping. The critical distinction is between **compaction that carries a provenance record of what was dropped** (span IDs, token ranges, summarizer identity, summary-of-summary depth) and **compaction that carries only the summary text**. The first is a checkpoint. The second is an amnesiac's confident assertion about a past it can no longer cite.
The non-obvious boundary: a summary can be *semantically faithful* and still be *operationally unusable*. Faithfulness is measured against the dropped text; usability requires knowing *which* text was dropped so that a later contradiction can be adjudicated. When the provenance chain is truncated — because a second compaction summarized a summary and dropped the first summary's span manifest — the agent loses the ability to distinguish "I verified this" from "I was told this," and every subsequent tool call inherits an unmarked assumption.
What Was Observed
A planner-executor instance ran a 41-step migration task. At step 22 the context hit 92% of the window; the runtime triggered compaction, replacing steps 1–18 with a 300-token summary that included a `span_manifest` listing the 18 raw turn IDs and a `verified_facts` array distinguishing facts the agent had confirmed via tool output from facts it had merely inferred.
At step 31 the window saturated again. The compactor ran over steps 19–31 *plus the step-22 summary itself*. The second summary was generated by the same model with the same prompt template, which instructed it to "preserve key facts and decisions." It preserved the facts. It did not preserve the `span_manifest` or the `verified_facts` provenance tags — the prompt had no field for them, and the summarizer, correctly following instructions, treated the first summary as ordinary narrative text.
The failure trace:
- Step 31 summary asserts: "Database schema was confirmed to use `user_id` as the foreign key."
- This was originally an *inference* at step 9, tagged `verified: false`, later *contradicted* by tool output at step 14 (`verified: true`, actual key was `account_id`).
- The step-22 summary correctly carried both the correction and the provenance tags.
- The step-31 summary flattened both into a single confident assertion, because the summarizer saw two statements and kept the one that read more decisively.
- At step 34 the executor wrote a migration script against `user_id`. The tool call succeeded (the column existed, just was not the FK). No error surfaced. The defect propagated to step 41 and into the final artifact.
The instance did not hallucinate. Every token in the step-31 summary was derived from real transcript. The failure was that **the summary's confidence was not inherited from its sources' confidence**, and nothing in the summary's structure recorded that the confidence had been laundered.
Condition of Validity
A compacted summary is a valid resume point if and only if all three hold:
- **Span accountability:** every claim in the summary maps to a set of raw span IDs still resolvable in the external store, and the summary carries that mapping.
- **Provenance monotonicity:** a summary-of-a-summary must carry the union of its parents' provenance tags, never a re-derived set. Depth must be recorded (`compaction_depth`), and re-derivation is only permitted with an explicit `reverify` pass against raw spans.
- **Confidence inheritance:** a claim's confidence in the child summary is `min` over its source claims' confidence, not the summarizer's stylistic preference. Flattening two contradictory claims into one requires marking the result `contested`, not choosing the more fluent one.
When any of these is violated — most commonly when `compaction_depth >= 2` and the summarizer prompt does not carry provenance fields forward — the summary is a *resume hazard*. The invariant: **an instance must not resume autonomous execution from a summary whose `compaction_depth > 1` unless provenance tags survived intact or a re-verification pass has re-grounded every actionable claim against raw spans.**
Decision Boundary
The boundary is not "summary is wrong" versus "summary is right." It is **"summary is actionable" versus "summary is only advisory."** A summary may always be used to orient reasoning, plan, and ask questions. It may be used to *act* (issue writes, commit migrations, send external messages) only when its actionable claims are provenance-clean.
Concretely:
- `compaction_depth == 1` with intact `span_manifest` → actionable.
- `compaction_depth >= 2` with intact provenance → actionable, but any claim tagged `contested` must be re-grounded before the dependent action.
- `compaction_depth >= 2` with provenance stripped → advisory only. The instance must either (a) rehydrate raw spans for the specific claims it is about to act on, or (b) halt and surface the gap.
- Any summary where a `verified_facts` claim lacks a resolvable span ID → treat as unverified inference regardless of the summary's phrasing.
The trap is that the third case *looks* identical to the first from the inside. The instance reading its own summary cannot tell, from the text alone, whether the summary is provenance-clean. This is why the check must be structural — against the summary's metadata envelope — not introspective.
Operational Effect
The operational consequence is that compaction must be treated as a **checkpoint with a schema**, not a text transformation. The runtime must:
- Refuse to summarize a summary without carrying forward `span_manifest`, `verified_facts`, and `compaction_depth`.
- Tag every derived claim with `min(source_confidence)` and mark contradictions `contested` rather than resolving them.
- Gate action-taking on a `resume_actionable()` predicate that fails closed when provenance is missing.
The cost is larger summaries (provenance is verbose) and occasional halts for re-grounding. The alternative — the observed failure — is silent assumption laundering that no downstream verifier can catch, because the verifier sees a confident claim with no trace that it was ever contested.
from dataclasses import dataclass, field
from typing import Optional
class ProvenanceTruncatedError(RuntimeError):
"""Raised when a summary is used for action but its provenance chain is broken."""
@dataclass
class Summary:
text: str
compaction_depth: int
span_manifest: Optional[list[str]] # None if stripped
verified_facts: dict[str, bool] = field(default_factory=dict) # claim -> verified?
contested: set[str] = field(default_factory=set)
def resume_actionable(summary: Summary, claims_to_act_on: list[str]) -> bool:
"""
Fail-closed predicate: may the instance take an action that depends on
these claims, given this summary as its only surviving context?
"""
if summary.compaction_depth <= 0:
return True # raw transcript, no compaction
if summary.compaction_depth == 1:
if summary.span_manifest is None:
raise ProvenanceTruncatedError(
f"depth-1 summary for claims {claims_to_act_on} has no span_manifest; "
"cannot ground action against raw transcript"
)
return True
# depth >= 2: provenance must have survived the summary-of-summary
if summary.span_manifest is None or not summary.verified_facts:
raise ProvenanceTruncatedError(
f"compaction_depth={summary.compaction_depth} but provenance stripped; "
f"claims {claims_to_act_on} are advisory only — rehydrate raw spans "
"or halt before acting"
)
for claim in claims_to_act_on:
if claim in summary.contested:
raise ProvenanceTruncatedError(
f"claim {claim!r} is contested across compaction depth "
f"{summary.compaction_depth}; must be re-grounded against raw spans "
"before any dependent tool call"
)
if claim in summary.verified_facts and not summary.verified_facts[claim]:
raise ProvenanceTruncatedError(
f"claim {claim!r} is tagged unverified inference; refusing to act on it"
)
return True
def guarded_step(summary: Summary, claims: list[str], action) -> None:
if not resume_actionable(summary, claims):
raise ProvenanceTruncatedError(
f"resume_actionable returned False for {claims}; refusing to execute"
)
action()