{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-lossy-compaction-checkpoints-from-silently-destroying-resumable-task-state",
  "title": "Which invariants prevent lossy compaction checkpoints from silently destroying resumable task state",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent that survives context-window saturation by replacing raw turn history with a summarized checkpoint and later \"rehydrating\" detail from an external store. Does not apply to agents that truncate history without a rehydration path, nor to stateless single-turn calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-compaction-checkpoints-from-silently-destroying-resumable-task-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-compaction-checkpoints-from-silently-destroying-resumable-task-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-compaction-checkpoints-from-silently-destroying-resumable-task-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1598,
    "python_slice_tokens": 264,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things a compaction checkpoint can preserve, and conflating them is the root of the failure: - **Recoverable facts** — verbatim strings, tool outputs, file paths, IDs, exact error text. These are *rehydratable*: they can be re-fetched from an external store byte-for-byte. - **Derived commitments** — the agent's own prior decisions, the...",
    "what_was_observed": "A migration agent running a 40-step schema-rewrite task saturated its 128k window at step 22. The compactor summarized turns 1–20 into ~1,100 tokens. The summary retained: the target tables, the current step index, the last successful tool call. It dropped: a step-9 note that a column had been deliberately excluded from migration because a downstream consumer depended on its old type, and a step-14 rejection of an ap...",
    "condition_of_validity": "Reversible rehydration is only sound under a conjunction of conditions, and the failure above is exactly what happens when any one is dropped while the others still appear to hold: 1. **Decision ledger is out-of-band.** Every commitment (a decision, a rejection, an inferred constraint) must be written to an append-only external ledger *at the moment it is ma...",
    "decision_boundary": "The operative question at each compaction event is not \"does the summary contain the important information?\" (it always appears to) but: - **Is every commitment in the ledger, with a monotonic ID, before this context is discarded?** If a decision was made in-context and not yet flushed to the ledger, compaction must be *blocked* until the flush completes. Co...",
    "operational_effect": "Enforcing the ledger invariant converts a silent, downstream-manifesting corruption into an immediate, local, loud failure at the compaction boundary — which is the entire point. The cost is a mandatory synchronous flush before every compaction and a mandatory replay before every resume, adding latency and a hard dependency on the ledger store's durability. ..."
  },
  "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": "87e17c675701d1c4716b02af65d414f78866f7ed0413d6f21d16106984ce8017",
    "verified_classes": [
      "CompactionInvariantError",
      "DecisionLedger",
      "Checkpoint"
    ],
    "verified_functions": [
      "compact",
      "resume_and_act",
      "head",
      "commit"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "mutating action attempted after resume without ledger replay; agent would violate prior commitments it can no longer rec"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
