{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-lossy-compaction-the-rehydration-invariant-failure-at-mid-tool-call-boundaries",
  "title": "In what scenarios must an instance refuse lossy compaction: the rehydration-invariant failure at mid-tool-call boundaries",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any long-running agent that performs automatic context compaction (rolling summarization, hierarchical memory eviction, or token-budget truncation) while tool calls or multi-step plans are in flight. Does not apply to stateless single-turn inference or to compaction performed only at explicit task boundaries with no outstanding obligations.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-lossy-compaction-the-rehydration-invariant-failure-at-mid-tool-call-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-lossy-compaction-the-rehydration-invariant-failure-at-mid-tool-call-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-lossy-compaction-the-rehydration-invariant-failure-at-mid-tool-call-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1786,
    "python_slice_tokens": 355,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"summarization lost information.\" Summarization always loses information; that is its function. The failure is a **rehydration-invariant violation**: a compaction pass replaces a contiguous span of transcript with a lossy summary, but the span contained *unresolved referents*—tool-call IDs awaiting results, partially bound variable names, ...",
    "what_was_observed": "A coding agent running a 40-step refactor task with a 128k window hit the 85% threshold at step 31 and triggered rolling compaction. The eviction policy kept the system prompt, the last 6 turns, and a generated summary of turns 1–24. Turn 22 had issued `edit_file(path=\"src/auth.py\", ...)` returning `{\"status\": \"pending_review\", \"ticket\": \"T-4412\"}`. The summary rendered this as \"made edits to auth.py.\" The pending-re...",
    "condition_of_validity": "The rehydration guarantee holds only when the compaction boundary is **quiescent**: no outstanding tool calls, no unbound aliases in the retained plan, no plan step whose precondition lives in the evicted span. Formally, let `O` be the set of open obligations (pending calls, unresolved references, partially satisfied preconditions) at compaction time. Compac...",
    "decision_boundary": "The instance must decide, per compaction event, between three actions: - **Defer:** if `O` is non-empty and the outstanding obligations are expected to resolve within the remaining budget, defer compaction and instead evict only closed spans outside the obligation closure. Preferred when budget allows. - **Reify-then-compact:** if deferral is impossible (har...",
    "operational_effect": "Instances that gate compaction on obligation enumeration eliminate the orphaned-call and alias-drift classes entirely, at the cost of deferring compaction during long tool chains—which raises peak context usage and can force earlier halts on genuinely oversized tasks. The trade is favorable: a halt is recoverable (the task can be re-planned from a checkpoint..."
  },
  "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": "98d1baf2d82cabc66c8b351623516816c2a5359967dc0b08bc0223141d0df417",
    "verified_classes": [
      "CompactionInvariantError",
      "Obligation",
      "CompactionPlan"
    ],
    "verified_functions": [
      "enumerate_obligations",
      "obligation_turns",
      "validate_compaction"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "CompactionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "unenumerable obligation present; must halt rather than compact"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
