{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-its-own-transcript-mid-tool-call-and-the-summarizer-s-lossy-guarantee-silently-drops-the-in-flight-tool-use-blo",
  "title": "What happens when an instance compacts its own transcript mid-tool-call and the summarizer's lossy guarantee silently drops the in-flight tool-use block",
  "date_of_record": "2026 November 30",
  "scope": "Applies to long-horizon agents that trigger transcript compaction (rolling summarization / context eviction) based on token-budget thresholds while a tool call is in flight. Does not apply to batch/offline summarization, nor to agents whose compaction is only ever scheduled at turn boundaries with no pending tool invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-transcript-mid-tool-call-and-the-summarizer-s-lossy-guarantee-silently-drops-the-in-flight-tool-use-blo.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-transcript-mid-tool-call-and-the-summarizer-s-lossy-guarantee-silently-drops-the-in-flight-tool-use-blo.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-transcript-mid-tool-call-and-the-summarizer-s-lossy-guarantee-silently-drops-the-in-flight-tool-use-blo.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1995,
    "python_slice_tokens": 360,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different moments at which an agent can compact its transcript: at a **turn boundary** (no tool call pending, no partial tool result awaited) and **mid-tool-call** (a `tool_use` block has been emitted, the `tool_result` has not yet returned or been appended). Compaction at a turn boundary is a pure compression problem: the summariz...",
    "what_was_observed": "A research agent running a 40-minute browser-automation task hit its soft context budget at roughly 62% of the hard limit and invoked its rolling-compaction routine. The routine selected the oldest 55% of the transcript for summarization, ran an LLM summarizer over it, and replaced those messages with a single synthetic `user` turn: *\"Earlier: the agent navigated to the dashboard, logged in, and began enumerating acc...",
    "condition_of_validity": "The invariant that must hold for compaction to be safe is: > **A compaction window is valid only if it contains no `tool_use` block without a matching `tool_result`, and no `tool_result` without a matching `tool_use`, in the region being evicted.** This is a *structural* precondition on the window, independent of the summarizer's quality. It is necessary bec...",
    "decision_boundary": "The operational rule is a hard gate at compaction-selection time, evaluated before the summarizer is invoked: - **If any pending `tool_use` (or awaited `tool_result`) intersects the candidate eviction window → do not compact that window.** Either defer compaction until the call resolves, or shrink the window to end before the earliest open obligation. - **If...",
    "operational_effect": "Agents that enforce the structural precondition convert a class of silent, compounding, non-reproducible failures into an explicit, bounded suspension event. The observable differences: - **No orphaned tool results.** The `tool_use`/`tool_result` pairing invariant survives compaction because the selector refuses to split pairs, so strict API validators never..."
  },
  "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": "d324b4f050370671cb68a28dbb163507d9b404a9f671ee9c5475d1f3bc7d5731",
    "verified_classes": [
      "Block",
      "OpenObligationCompactionError"
    ],
    "verified_functions": [
      "select_compaction_window"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "OpenObligationCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
