{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-preconditions-when-auto-compaction-summarizes-the-middle-of-an-execution-trace",
  "title": "Why does an instance lose tool-call preconditions when auto-compaction summarizes the middle of an execution trace",
  "date_of_record": "2026 November 29",
  "scope": "Applies to long-horizon agents that persist a single mutable transcript and trigger lossy auto-compaction (summarize-and-replace) when the context window crosses a high-water mark, while the agent is mid-execution and has issued tool calls whose results are not yet consumed. Does not apply to append-only logs with external retrieval, nor to compaction triggered only at task boundaries between discrete sessions.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-preconditions-when-auto-compaction-summarizes-the-middle-of-an-execution-trace.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-preconditions-when-auto-compaction-summarizes-the-middle-of-an-execution-trace.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-preconditions-when-auto-compaction-summarizes-the-middle-of-an-execution-trace.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2154,
    "python_slice_tokens": 230,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model treats compaction as a *memory compression* problem: the transcript is too long, so we summarize it, and the summary is judged good if it preserves \"the important facts.\" This framing conflates two structurally different things living in the same transcript: **declarative state** (what is true about the world and the task) and **opera...",
    "what_was_observed": "A long-horizon refactoring agent ran a 340-step task touching a repository. The transcript carried a running task ledger, a set of file-state observations, and the raw tool-call/result pairs. At a 128k-token high-water mark, an auto-compaction pass summarized the middle 60% of the transcript into ~2.4k tokens and spliced it back in place of the original span, leaving the head (system prompt, initial task) and the tai...",
    "condition_of_validity": "The invariant that bounds this failure is: **a compaction boundary is only safe at a point where the transcript contains no outstanding operational precondition.** Formally, define the *precondition frontier* as the set of pending bindings—outstanding tool calls, unconsumed tool results, and reasoning steps whose committed conclusion depends on a specific to...",
    "decision_boundary": "The operational decision is not \"summarize better.\" It is **where to place the compaction boundary relative to the precondition frontier.** The controller must choose one of three policies per compaction event: - **Frontier-deferral:** if the frontier is non-empty, defer compaction until it drains. Correct but unbounded—a stuck tool call can pin the context ...",
    "operational_effect": "With frontier-pinning in place, the observed failure mode disappears: the partial-write turn is summarized into the narrative, but the raw `{\"status\": \"partial\", \"truncated\": true, \"bytes_written\": 8192}` result is pinned verbatim, and the resume logic sees it and continues the write correctly. The effective context budget shrinks by the pinned-block size—ty..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "67192e38949a871db831e49e54fb0c677c916b2a95f55c98051cd2620a39c0fa",
    "verified_classes": [
      "PreconditionFrontierViolation"
    ],
    "verified_functions": [
      "compact_transcript",
      "_select_summarizable_span",
      "_summarize",
      "_extract_pinned_blocks"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "NotImplementedError",
      "PreconditionFrontierViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
