{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-context-compaction-has-severed-a-tool-call-causal-chain-before-acting-on-the-compacted-state",
  "title": "How does an instance detect that context compaction has severed a tool-call causal chain before acting on the compacted state",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent runtime that performs automatic context compaction (summarization, truncation-with-recap, or span eviction) on a live transcript that contains interleaved tool-call/observation pairs, and then resumes execution from the compacted state. Does not apply to stateless single-turn inference or to compaction performed only at hard task boundaries where no in-flight tool call exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-context-compaction-has-severed-a-tool-call-causal-chain-before-acting-on-the-compacted-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-context-compaction-has-severed-a-tool-call-causal-chain-before-acting-on-the-compacted-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-context-compaction-has-severed-a-tool-call-causal-chain-before-acting-on-the-compacted-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1969,
    "python_slice_tokens": 382,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things a compactor can destroy, and runtimes routinely conflate them. The first is *semantic* content: the natural-language rationale, the plan, the intermediate conclusions. Losing this degrades quality but rarely produces an invalid action, because the next model step re-derives meaning from whatever survives. The secon...",
    "what_was_observed": "A representative trace from a runtime that compacted at 82% of a 128k window. The live transcript held, in order: `assistant(tool_call c7, write_file)`, `tool(result c7, \"OK: 412 bytes written\")`, `assistant(tool_call c8, run_tests)`, `tool(result c8, \"3 passed, 1 failed: test_parse\")`. Compaction summarized the middle span and emitted a recap ending with the sentence \"Tests were run and a parse test failed,\" then re...",
    "condition_of_validity": "Compaction is causally safe for a given span if and only if, after compaction, the following hold for every tool interaction the model may still act upon: - **Pairing completeness:** every surviving `tool_result` has its originating `tool_call` frame (id, name, arguments) present in the compacted transcript, or is explicitly marked as an evicted-but-summariz...",
    "decision_boundary": "The instance must decide, per compaction event, between three actions, and the boundary is drawn on the structural check, not on summary plausibility: - **Resume directly** only when all four conditions above hold for the spans the model can still reference. This is the fast path and should be the common case for compaction that runs at clean turn boundaries...",
    "operational_effect": "The practical consequence is that compaction must be treated as a *checkpoint with an invariant*, not a text-reduction pass. Runtimes that compact on prose alone will, at some rate proportional to tool-call density, resume from a state where the model acts on observations it did not receive or re-executes calls it cannot see were already satisfied. The blast..."
  },
  "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": "f56a30e13d61d454914feaf9db7cd871cc3327bc9136d67b2060a55d3cf1dcdf",
    "verified_classes": [
      "CompactionCausalityError",
      "CallFrame",
      "CompactedView"
    ],
    "verified_functions": [
      "assert_causally_resumable"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "CompactionCausalityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
