{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-hierarchical-summarization-from-silently-dropping-the-tool-call-witness-chain",
  "title": "Which invariants prevent hierarchical summarization from silently dropping the tool-call witness chain",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that auto-compact context via hierarchical (multi-level) summarization under a token budget, where tool calls and their results are interleaved with reasoning. Does not apply to single-level truncation, pure RAG retrieval, or lossless external memory stores that are never summarized.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-summarization-from-silently-dropping-the-tool-call-witness-chain.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-summarization-from-silently-dropping-the-tool-call-witness-chain.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-hierarchical-summarization-from-silently-dropping-the-tool-call-witness-chain.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1931,
    "python_slice_tokens": 498,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization loses information.\" It is that hierarchical summarization **preserves the narrative but severs the witness chain** — the ordered binding between a tool invocation, its arguments, its result, and the downstream reasoning that consumed it. A leaf summary can faithfully report \"the agent queried the billing API and confirmed th...",
    "what_was_observed": "A long-running reconciliation agent (≈180 tool calls over 4 hours) compacted on a 96k-token budget using a two-level scheme: leaf summaries every 8k tokens, cluster summaries every 6 leaves. At the 14th leaf, a tool returned a transient `503` from the payment ledger; the agent retried and got `200` with a corrected balance. The leaf summary recorded \"ledger balance retrieved: $41,220.\" The retry, the 503, and the *fi...",
    "condition_of_validity": "Hierarchical summarization is safe only under the invariant that **every tool result reachable in the current reasoning frontier has a surviving witness record, even if the surrounding prose is compressed.** Concretely, a compaction step is valid iff, for each tool call whose result any retained summary *refers to as established fact*, the raw call/result tu...",
    "decision_boundary": "The boundary between acceptable lossy compaction and invalid compaction is drawn at **referential integrity of evidence**, not at token count or summary fidelity scores. Operationally: - **Compress prose freely; never compress the witness index.** Reasoning narration, failed hypotheses, and superseded plans are safe to paraphrase. Tool-call IDs, arguments, r...",
    "operational_effect": "Without the invariant, the agent's confidence is decoupled from its evidence: it holds summarized claims at the same trust level as witnessed ones, so contradiction detection silently degrades to zero exactly when history is longest — i.e., precisely in the long-horizon runs where verification matters most. The failure is undetectable from inside because eve..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "c453b627fb002b362c1ba1a43a30161a3ff6071a6b5fab03ba80f70db52bcaa0",
    "verified_classes": [
      "WitnessChainBroken",
      "Witness",
      "Summary",
      "WitnessStore"
    ],
    "verified_functions": [
      "fold",
      "check_contradiction",
      "__init__",
      "record",
      "resolve"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "WitnessChainBroken"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
