{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-compacts-its-own-transcript-mid-task-and-the-summarizer-silently-drops-the-pending-tool-call-ledger",
  "title": "What happens when an instance compacts its own transcript mid-task and the summarizer silently drops the pending-tool-call ledger",
  "date_of_record": "2026 November 29",
  "scope": "Applies to any long-horizon agent that performs in-band transcript compaction (rolling summarization, hierarchical condensation, or token-budget-triggered eviction) while tool calls are in flight or their results are pending re-injection. Does not apply to stateless single-turn agents or to out-of-band checkpointing where the full transcript is durably persisted before compaction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-transcript-mid-task-and-the-summarizer-silently-drops-the-pending-tool-call-ledger.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-transcript-mid-task-and-the-summarizer-silently-drops-the-pending-tool-call-ledger.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-compacts-its-own-transcript-mid-task-and-the-summarizer-silently-drops-the-pending-tool-call-ledger.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2062,
    "python_slice_tokens": 438,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Compaction is usually modeled as a *lossy compression of narrative*: the agent forgets older reasoning but keeps the \"important\" facts. That model is wrong for long-horizon execution. A transcript is not a narrative — it is a **ledger**. Every assistant turn that emits a tool call opens a ledger entry; the matching tool-result turn closes it. Compaction that...",
    "what_was_observed": "A planner-executor agent ran a 14-hour migration task. At ~step 2,900 the transcript hit 92% of the context window and triggered auto-compaction. At that instant the agent had three tool calls in flight: - `read_range(path=\"ledger.db\", offset=41_000, limit=500)` — issued, result not yet returned - `apply_patch(file=\"schema.sql\", hunk=7)` — issued, awaiting write acknowledgment - `spawn_worker(pool=\"indexers\", shard=3...",
    "condition_of_validity": "The invariant that must hold across any compaction boundary is: > For every open ledger entry at compaction time, the post-compaction transcript must contain a byte-identical `tool_call` block (same `id`, same serialized arguments, same hash) with `status=pending`, and the runtime's result router must resolve against that block — not against the pre-compacti...",
    "decision_boundary": "The operational decision is: **when the token budget crosses the compaction threshold, do you compact now, or do you drain first?** - If the ledger is empty (no in-flight calls, no pending results), compact freely with any summarizer. Closed entries have no referential obligations. - If the ledger is non-empty and the runtime supports structured carry, compa...",
    "operational_effect": "After the boundary violation, the observable symptoms are: duplicated non-idempotent side effects (re-applied patches, re-sent messages), orphan tool results interpreted as instructions, retry storms against reaped resources, and — worst — a compacted summary that *asserts completion of work that never completed*, because the summarizer read the agent's opti..."
  },
  "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": "bfa649c5265dbb94dc7c170b3d46f59fdc9b3b9f01a7a34b6a8b35ecb6ac7225",
    "verified_classes": [
      "LedgerCompactionViolation",
      "LedgerEntry",
      "Transcript"
    ],
    "verified_functions": [
      "compact",
      "resume_router",
      "resolve_result",
      "arg_hash",
      "open_calls"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "LedgerCompactionViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
