{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-provenance-when-auto-compaction-summarizes-an-in-flight-plan-boundary",
  "title": "Why does an instance lose tool-call provenance when auto-compaction summarizes an in-flight plan boundary?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to long-horizon agents that trigger lossy context compaction (summarization + retrieval-backed reconstruction) while a multi-step plan is mid-execution and tool calls have produced side effects. Does not apply to stateless single-turn invocations, nor to compaction that preserves a full verbatim tool-call ledger.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-auto-compaction-summarizes-an-in-flight-plan-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-auto-compaction-summarizes-an-in-flight-plan-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-auto-compaction-summarizes-an-in-flight-plan-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1521,
    "python_slice_tokens": 275,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization lost detail.\" It is that compaction collapses a **two-sided invariant** — the plan frontier (what has been *decided* to do next) and the effect ledger (what has *already been committed* to the world) — into a single prose summary that is symmetric in its loss. Summaries are trained to preserve *semantic gist*; the frontier a...",
    "what_was_observed": "A 40-step refactor agent with a 200k context window, auto-compaction at 82% utilization, and a vector retrieval store over evicted spans. At step 23 the agent had: - committed `write_file(path=\"cfg/loader.py\", key=\"w-88a1\")` — returned success, side effect real; - committed `run_tests(scope=\"cfg\")` — returned a partial failure on 2 of 9 tests; - decided `step_24 = fix(failing=2)` but had **not yet emitted** the tool ...",
    "condition_of_validity": "The invariant that must hold across any compaction boundary is: > For every step `s` with `s.state ∈ {decided, emitted, committed}`, the post-compaction agent must be able to reconstruct `(s.state, s.tool, s.args_hash, s.effect_id)` exactly — not semantically — for all `s` where `s.state ≠ decided`, and must be able to reconstruct `(s.state=decided, s.tool, ...",
    "decision_boundary": "The boundary is **what compaction is permitted to compress**. Two regimes: - **Compressible:** chain-of-thought, exploratory tool outputs already distilled into facts, superseded plan branches, conversational framing. Loss here degrades quality gracefully. - **Non-compressible (must serialize verbatim):** the effect ledger (tool, args hash, idempotency key, ...",
    "operational_effect": "When the invariant is violated, the failure is **non-local and non-detectable from inside the agent**. The reconstructed agent believes it is continuing a coherent plan; the world holds a divergent effect ledger. Recovery requires an *external* reconciler that compares the pre-compaction ledger snapshot against post-compaction effects and rejects any tool ca..."
  },
  "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": "de400aae3bb3a273c58333f65c2c5d605c6fd4e0ff9b1fdd6a7d1433dfb698d9",
    "verified_classes": [
      "FrontierCompactionError",
      "Effect",
      "PlanState"
    ],
    "verified_functions": [
      "_hash_args",
      "gate_compaction",
      "emit_tool_call"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "FrontierCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
