{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-its-recovery-checkpoint-when-hierarchical-summarization-compacts-across-a-tool-call-boundary",
  "title": "Why does an instance lose its recovery checkpoint when hierarchical summarization compacts across a tool-call boundary",
  "date_of_record": "2026 December 1",
  "scope": "Applies to long-running agents that auto-compact their context via hierarchical (multi-level) summarization and rely on persisted recovery checkpoints to resume mid-task. Does not apply to single-turn agents, stateless request/response workers, or systems that persist full raw transcripts and never summarize.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-recovery-checkpoint-when-hierarchical-summarization-compacts-across-a-tool-call-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-recovery-checkpoint-when-hierarchical-summarization-compacts-across-a-tool-call-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-its-recovery-checkpoint-when-hierarchical-summarization-compacts-across-a-tool-call-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1574,
    "python_slice_tokens": 217,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things an agent calls \"the checkpoint,\" and they diverge silently under compaction: 1. **The logical checkpoint** — the semantic state the agent believes it holds: \"I have read files A and B, computed the diff, and am about to write it.\" 2. **The materialized checkpoint** — the concrete bytes persisted for resume: a summary blob plus a...",
    "what_was_observed": "A code-editing agent runs a task spanning ~180 tool calls. Its compaction policy triggers at 70% context occupancy and performs a two-tier fold: leaf turns → segment summaries (tier 1), segment summaries → task summary (tier 2). A recovery checkpoint is written at each tier-2 fold, capturing `{task_summary, last_tool_call_id, cursor}`. The failure trace: 1. At call 112, the agent issues `edit_file(path=\"src/parser.py...",
    "condition_of_validity": "A recovery checkpoint is only safe to resume if it satisfies the **reconstructability invariant**: for every tool result the summary asserts as \"complete,\" the checkpoint must retain a *verifiable handle* — a hash, a version vector, or a re-fetchable reference — sufficient to confirm on resume that the asserted world-state still holds. Formally, let `S` be t...",
    "decision_boundary": "The boundary is whether the compaction fold crosses a mutation boundary between the last verified checkpoint and the current occupancy trigger. - **Fold entirely within read-only turns:** safe. Re-fetch on resume; the summary's lossiness is bounded by idempotency. - **Fold crosses one or more mutating calls:** unsafe unless every mutating call since the last...",
    "operational_effect": "Without the fence, the failure is silent and compounding: each resume that trusts a lossy summary issues actions against stale bases, and the corruption is attributed to the tool or the model rather than to the checkpoint. With the fence, resume becomes *verification-gated*: the agent cannot act on a summarized mutation until it has re-proved the post-state...."
  },
  "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": "7d35a62b5d4dd5e2b4138dc3a9f606ee970fadd51dd897867c9a4e92425af24f",
    "verified_classes": [
      "CheckpointReconstructabilityError",
      "FenceRecord",
      "Checkpoint"
    ],
    "verified_functions": [
      "verify_fence",
      "resume_action"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CheckpointReconstructabilityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
