{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-compaction-checkpoints-from-silently-severing-in-flight-tool-call-commitments",
  "title": "Which invariants prevent compaction checkpoints from silently severing in-flight tool-call commitments",
  "date_of_record": "2026 December 1",
  "scope": "Applies to long-horizon agents that trigger lossy context compaction (summarization-based checkpointing) while tool calls, sub-agent handoffs, or pending side effects are in flight. Does not apply to agents whose compaction is only invoked at quiescent turn boundaries with no outstanding external commitments.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-compaction-checkpoints-from-silently-severing-in-flight-tool-call-commitments.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-compaction-checkpoints-from-silently-severing-in-flight-tool-call-commitments.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-compaction-checkpoints-from-silently-severing-in-flight-tool-call-commitments.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1756,
    "python_slice_tokens": 210,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things a compaction checkpoint can summarize, and they are not interchangeable: 1. **Narrative state** — the conversational trace: what the user asked, what the agent reasoned, what results it saw. Narrative is *reconstructible* from a summary because its loss only degrades fidelity, not correctness of future actions. 2. ...",
    "what_was_observed": "A planning agent operating a multi-step deployment task crossed its context budget at step 41 of an estimated 60. The runtime invoked a compaction checkpoint: it summarized the last ~90k tokens into a 1.8k-token digest and reset the window. At the moment of compaction, three commitments were live: - A `terraform apply`-equivalent tool call had been dispatched and its result had **not** returned (the tool was mid-exec...",
    "condition_of_validity": "The invariant that must hold for compaction to be safe: > **A checkpoint may summarize only state that is closed under the summary operator. Any commitment whose resolution is not yet observed is an open edge and must be carried verbatim, not summarized.** Formally, partition the context into `Closed` (turns whose effects are fully observed: tool results ret...",
    "decision_boundary": "The boundary between \"safe to compact\" and \"must defer compaction\" is drawn per-commitment, not per-turn: - **Compact now** if every live tool call has returned, every spawned sub-agent has joined, and every minted idempotency key has been confirmed or explicitly retired. The window is quiescent; `Open = ∅`. - **Defer compaction** if any commitment is open. ...",
    "operational_effect": "Enforcing the invariant changes three things in the runtime: 1. **Compaction becomes a partial function.** It must be defined only on `Closed`; attempts to compact `Open` raise and force the caller to either wait or split. This makes the failure loud at checkpoint time rather than silent at resume time. 2. **Resume becomes a reconciliation pass, not a rehydr..."
  },
  "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": "cb72aceebcfba7ca53560f17516bb23ef6a0c2387d454ac790d5fc61aa765cfe",
    "verified_classes": [
      "CompactionCommitmentError"
    ],
    "verified_functions": [
      "compact_checkpoint",
      "resume_and_reconcile"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionCommitmentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
