{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-provenance-when-automatic-context-compaction-summarizes-a-mid-task-transcript-and-the-fidelity-recovery-path-canno",
  "title": "Why does an instance lose tool-call provenance when automatic context compaction summarizes a mid-task transcript and the fidelity recovery path cannot reconstruct the original arguments",
  "date_of_record": "2026 December 3",
  "scope": "Applies to long-running agent instances whose runtime performs automatic context compaction (lossy summarization of the transcript once a token watermark is crossed) while a multi-step tool-using task is in flight. Does not apply to stateless single-shot completions, nor to instances that only compact at task boundaries where a fresh checkpoint has been persisted.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-automatic-context-compaction-summarizes-a-mid-task-transcript-and-the-fidelity-recovery-path-canno.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-automatic-context-compaction-summarizes-a-mid-task-transcript-and-the-fidelity-recovery-path-canno.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-automatic-context-compaction-summarizes-a-mid-task-transcript-and-the-fidelity-recovery-path-canno.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1837,
    "python_slice_tokens": 310,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two things an agent runtime calls \"context management,\" and conflating them is the root of this failure. The first is **truncation**: dropping old tokens, deterministic, auditable, and recoverable because the dropped span either still exists in a durable store or is genuinely disposable. The second is **compaction**: replacing a span of the transcr...",
    "what_was_observed": "A representative trace, from a coding agent operating over a 60k-token budget with a compaction watermark at 48k: 1. The instance executes `read_file(path=\"services/api/config/timeouts.yaml\")`, receives a 900-token YAML body, and reasons over it across four turns. The exact values (`read_timeout: 30s`, `write_timeout: 45s`) appear in the transcript as tool output. 2. Watermark is crossed at turn 11. The runtime compa...",
    "condition_of_validity": "This analysis holds under three conditions, all of which must be present: - **Mid-task compaction.** Compaction fires while a task's tool-call graph is still open (some calls have produced outputs that later calls depend on). At task boundaries, a fresh checkpoint of exact arguments is typically persisted and the failure does not occur. - **Summarizer-task d...",
    "decision_boundary": "The architectural invariant that bounds this failure is: **the compaction boundary must not be allowed to cross an open tool-call dependency edge without persisting the exact arguments of the calls on that edge, and recovery must be proactive rather than instance-signaled.** Concretely, a runtime must choose, at each compaction event, between two policies: -...",
    "operational_effect": "When Policy B is in force, the observable effects are: (1) silent argument fabrication with high surface confidence, (2) spurious recovery loops that consume the token budget the compaction was meant to save, and (3) in multi-agent settings, a downstream auditor receiving a handoff whose summary asserts a tool call that never occurred with the arguments it c..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "11ebe41bdd25933bfb337ebaec7255eb3f81ee9ec0d19e947b19ec3b0399c0aa",
    "verified_classes": [
      "CompactionProvenanceError",
      "ToolCallRecord",
      "CompactionEvent"
    ],
    "verified_functions": [
      "compact_span",
      "attempt_mid_task_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionProvenanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
