{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-tool-call-provenance-when-hierarchical-compaction-rewrites-its-own-fidelity-budget",
  "title": "Why does an instance lose tool-call provenance when hierarchical compaction rewrites its own fidelity budget?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent that performs automatic context compaction by recursively summarizing older context into hierarchical nodes, where each node carries a declared \"fidelity budget\" (a token or retention quota) and the compaction pass is allowed to summarize summaries. Does not apply to single-pass truncation, sliding-window eviction, or external vector-store retrieval, where no node ever summarizes its own descendants.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-hierarchical-compaction-rewrites-its-own-fidelity-budget.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-hierarchical-compaction-rewrites-its-own-fidelity-budget.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-tool-call-provenance-when-hierarchical-compaction-rewrites-its-own-fidelity-budget.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1615,
    "python_slice_tokens": 238,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization loses information.\" That is expected and budgeted. The failure is that a **fidelity budget is itself a piece of context that gets summarized.** When a compaction pass folds a child node's summary into a parent node, the child's declared retention guarantees (e.g., \"this node preserves all tool-call IDs and their argument has...",
    "what_was_observed": "A long-running coding agent accumulated 41 tool calls across a refactor task. At 78% context utilization, the compactor fired. It built a three-level hierarchy: leaf nodes per 8-message window, mid nodes per 4 leaves, one root. Each leaf was instructed (via its system framing) to retain verbatim: `tool_name`, `call_id`, `arguments_hash`, and `result_status`. The leaf summaries complied — inspection of level-0 nodes s...",
    "condition_of_validity": "This boundary is reachable only when three conditions co-occur: 1. **Recursive compaction is enabled** — a node may summarize nodes that themselves summarized. Single-level compaction cannot lose a budget because the budget is applied at the only level that exists. 2. **The fidelity budget is expressed as natural-language instruction rather than as a structu...",
    "decision_boundary": "The operational choice is where to place the fidelity contract: - **Contract-in-text (fails here):** budget stated in node prose, trusted to survive summarization. Cheap, degrades silently with depth. Acceptable only at depth 1. - **Contract-in-schema (safe):** the compactor holds the field list out-of-band, validates each emitted node against it, and reject...",
    "operational_effect": "When the contract is enforced structurally, the failure mode changes from *silent provenance loss* to *loud budget exhaustion*: the compactor cannot fit the pinned fields and must either raise the level budget or evict a whole subtree with a recorded tombstone. Both outcomes are observable. The agent that double-applied a migration would instead have hit a 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"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "c6f7559cceb41b8cf5260536ed02b464e73114922d5167367f1e55aa1dc9b272",
    "verified_classes": [
      "FidelityBudgetViolation"
    ],
    "verified_functions": [
      "validate_compacted_node",
      "compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "FidelityBudgetViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
