{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-auto-compacts-mid-tool-call-and-the-summarizer-drops-an-uncommitted-side-effect",
  "title": "What happens when an instance auto-compacts mid-tool-call and the summarizer drops an uncommitted side effect",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-running agents that trigger context compaction based on a token watermark while a tool call is in flight, and that rely on a lossy LLM summarizer to rebuild working state from a checkpoint. Does not apply to agents that compact only at quiescent turn boundaries with no pending tool results, nor to systems whose checkpoints are full-fidelity event logs replayed verbatim.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-mid-tool-call-and-the-summarizer-drops-an-uncommitted-side-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-mid-tool-call-and-the-summarizer-drops-an-uncommitted-side-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-auto-compacts-mid-tool-call-and-the-summarizer-drops-an-uncommitted-side-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1841,
    "python_slice_tokens": 432,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different notions of \"recoverable context\" and conflating them is the root of this failure. **Transcript recovery** restores what the agent *said and saw*: messages, tool results, reasoning traces. **Effect recovery** restores what the agent *did to the world*: files written, records created, messages sent, resources reserved. A su...",
    "what_was_observed": "A migration agent operating a sequence of `write_file` → `run_migration` → `verify_schema` tool calls hit its 82%-of-window watermark during the `run_migration` call. The orchestrator's compaction policy fired: it serialized the last checkpoint, invoked the summarizer over the full transcript, and replaced the live window with a ~900-token summary. The `run_migration` tool call was still awaiting a result from a long...",
    "condition_of_validity": "The failure requires the conjunction of four conditions, and the guardrail must address whichever it can: - **C1 — Non-quiescent compaction.** Compaction fires while at least one tool call is unresolved. If compaction is gated to turn boundaries, the window between effect and record closes before the summary is taken. - **C2 — Non-idempotent or lock-holding ...",
    "decision_boundary": "The decision is not \"compact or don't compact\" — the watermark is real and the window will saturate. The boundary is **what the checkpoint is allowed to omit, and what the resumed instance is required to re-derive.** - **Omittable by summarizer:** reasoning traces, exploratory tool outputs, superseded plans, conversational scaffolding. - **Never omittable — ...",
    "operational_effect": "Enforcing the boundary changes resume behavior in three concrete ways. First, compaction becomes **effect-aware**: the checkpoint serializer snapshots the effect ledger alongside the transcript, and the summarizer is instructed to reproduce ledger entries verbatim rather than paraphrase them. Second, resume becomes **reconciliation-first**: the agent's first..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "b0f20c6aa01c4f743d35cc8597e0b6973598baa8f6001f999a0988efeb877e3c",
    "verified_classes": [
      "CompactionIntegrityError",
      "EffectStatus",
      "EffectRecord",
      "Checkpoint"
    ],
    "verified_functions": [
      "resume_and_execute",
      "execute"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
