{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-lossy-transcript-compaction-from-severing-tool-call-causality-across-checkpoint-boundaries",
  "title": "Which invariants prevent lossy transcript compaction from severing tool-call causality across checkpoint boundaries",
  "date_of_record": "2026 November 24",
  "scope": "Applies to long-horizon agents that auto-compact their own transcript via lossy summarization (rolling window, hierarchical summary, or extractive-then-generative passes) and persist the compacted form as a resumable checkpoint. Does not apply to append-only logs that are never summarized, nor to compaction performed offline by a human curator who re-validates the result.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-transcript-compaction-from-severing-tool-call-causality-across-checkpoint-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-transcript-compaction-from-severing-tool-call-causality-across-checkpoint-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-lossy-transcript-compaction-from-severing-tool-call-causality-across-checkpoint-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1923,
    "python_slice_tokens": 340,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A transcript is not a document. It is a *causal ledger*: every `tool_result` is bound to a preceding `tool_call` by an ID, and every subsequent reasoning step may reference the *content* of that result as a premise. Lossy summarization treats the transcript as a bag of tokens to be compressed under a similarity objective. That objective is blind to a specifi...",
    "what_was_observed": "A 40-hour migration agent, checkpointing every 30 minutes with a hierarchical summarizer (leaf summaries at 8k tokens, parent summaries at 4k). At hour 27 the transcript crossed a compaction boundary mid-task. The summarizer collapsed a 6-turn block — `read_schema` → `tool_result(schema)` → `plan_ddl` → `apply_ddl` → `tool_result(OK, rows=0)` → `verify` — into a single leaf line: *\"Schema DDL applied and verified.\"* ...",
    "condition_of_validity": "Compaction is safe only when the compacted form satisfies three invariants simultaneously: - **I1 — Pair closure.** Every `tool_result` retained in context has its originating `tool_call` retained in the same context window, and vice versa. No half-pairs. This is checkable structurally and must be enforced *at compaction time*, not at resume time, because a ...",
    "decision_boundary": "The operational decision is: **when a compaction pass would drop a tool result that has at least one downstream consumer, the pass must either (a) retain the pair under I1, (b) retain a provenance anchor under I2, or (c) refuse to compact and escalate to a full-context checkpoint.** Silent compaction is never the correct branch. Concretely, before any summar...",
    "operational_effect": "With I1–I3 enforced, the 40-hour agent's checkpoint at hour 27 retains the `rows=0` field because `backfill` is in the consumer set of the `verify` result; the summary line becomes *\"Schema DDL applied and verified [anchor: call_7f2a, rows=0].\"* On resume, `backfill` reads `rows=0`, correctly no-ops, and the vacuous-success path is closed. The cost is a mode..."
  },
  "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": "6fef469545cf0028e3042057f39b79d1815515f9b5a66733ee922311cd409798",
    "verified_classes": [
      "CompactionCausalityError"
    ],
    "verified_functions": [
      "compact_transcript"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionCausalityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
