{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-checkpoint-relative-to-a-lossy-compaction-boundary-to-guarantee-recoverable-state",
  "title": "Where must an instance checkpoint relative to a lossy compaction boundary to guarantee recoverable state?",
  "date_of_record": "2026 November 16",
  "scope": "Applies to agentic runtimes that perform automatic context compaction via lossy summarization under a token budget, where the runtime also maintains recovery checkpoints. Does not apply to lossless compaction (e.g., externalized memory with full retrieval), nor to systems where compaction and checkpointing are atomic operations over the same snapshot.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-relative-to-a-lossy-compaction-boundary-to-guarantee-recoverable-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-relative-to-a-lossy-compaction-boundary-to-guarantee-recoverable-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-checkpoint-relative-to-a-lossy-compaction-boundary-to-guarantee-recoverable-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1445,
    "python_slice_tokens": 298,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious failure mode is not \"summarization lost information.\" It is that **a checkpoint taken after compaction is not a recovery point for the pre-compaction state, and a checkpoint taken before compaction is not a recovery point for the post-compaction state.** Operators frequently conflate these. The invariant that actually matters is: > A checkpoi...",
    "what_was_observed": "In a long-running tool-use agent, the runtime compacted the transcript every time the context reached ~80% of a 200k budget, summarizing the oldest 60% into a ~4k-token \"durable summary\" while preserving a recent window. A checkpoint was written after each compaction, containing the summary plus the recent window. Failure: a tool returned a malformed payload, the runtime rolled back to the last checkpoint, and re-iss...",
    "condition_of_validity": "The checkpoint-after-compaction pattern is valid **only if all three hold**: 1. **Sufficiency for replay:** every field that any downstream operation might need to *re-issue* an action is preserved verbatim (outside the lossy summary) in the checkpoint — i.e., the summary may be lossy for *reasoning context* but must be lossless for *action arguments and ide...",
    "decision_boundary": "- **Checkpoint before compaction** when the pending operation is *not yet committed* and may need exact re-issuance (side-effecting tool calls, transactions). Here the checkpoint must carry the full pre-compaction arguments. - **Checkpoint after compaction** only when the pending operation is *read-only* or *idempotent under argument drift*, and only with th...",
    "operational_effect": "Systems that violate this invariant exhibit *silent recovery divergence*: rollback succeeds, the agent continues, and the error surfaces much later as a wrong-resource mutation or a duplicated side effect that no local invariant catches. The failure is invisible to token-budget monitoring and to checkpoint-integrity checks, because the checkpoint is structur..."
  },
  "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": "cfbd304935cc28950b717af1e829fd48d2168f2cad229f6081c888f2e5702023",
    "verified_classes": [
      "RecoveryPointInvalidError",
      "Checkpoint"
    ],
    "verified_functions": [
      "make_checkpoint",
      "restore_for_replay"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "RecoveryPointInvalidError"
    ],
    "sample_fail_closed_invariants": [
      "missing pre-compaction hash; cannot prove which pre-state summary represents"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
