{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-compact-the-summarization-trigger-boundary-and-the-loss-budget-invariant",
  "title": "When must an instance refuse to compact: the summarization-trigger boundary and the loss-budget invariant",
  "date_of_record": "2026 December 1",
  "scope": "Applies to long-horizon agents that reclaim context by summarizing older turns (auto-compaction) under a fixed token budget and a declared loss budget. Does not apply to stateless single-turn inference, or to agents whose entire working set provably fits in one context window for the whole task.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-summarization-trigger-boundary-and-the-loss-budget-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-summarization-trigger-boundary-and-the-loss-budget-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-summarization-trigger-boundary-and-the-loss-budget-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1815,
    "python_slice_tokens": 306,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the summary was too lossy.\" It is that **compaction is triggered by a token-pressure threshold, but the loss budget is a function of semantic irreversibility, and the two are not the same clock.** A token-pressure trigger fires whenever utilization crosses a watermark (say 80% of the window). The loss budget is consumed only when a c...",
    "what_was_observed": "A planning-and-execution agent ran a 340-step horizon against a 200k-token window with an 80% watermark and a declared loss budget of 3 \"irreversible facts.\" At step 211, utilization hit 81%. The compactor selected the oldest contiguous span (steps 1–88) and summarized it 40:1. The span contained three irreversible items: (a) the operator's constraint \"do not modify the staging database, only read,\" (b) a rejected ap...",
    "condition_of_validity": "The loss-budget invariant is only well-defined if three things hold, and it is invalid to apply it otherwise: 1. **Irreversibility is classifiable at compaction time.** Each candidate span token must be taggable as re-derivable (tool output, file contents, computation) or irreversible (human-stated constraints, branch decisions, rejection rationales, one-sho...",
    "decision_boundary": "The decision is not \"compact vs. don't.\" It is a three-way gate evaluated at every watermark crossing, in this order: - **If irreversible-loss content in the candidate span ≤ remaining loss budget:** compact the whole span, decrement the budget by the irreversible count, record the pointer. Proceed. - **If irreversible-loss content > remaining loss budget bu...",
    "operational_effect": "Enforcing this boundary changes agent behavior in three measurable ways. First, **compaction frequency decouples from token pressure**: agents compact re-derivable spans aggressively (cheap, frequent) and irreversible spans almost never (expensive, rare), so the loss budget depletes slowly and predictably. Second, **post-compaction re-work drops**, because t..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "6eaee82132b9f91911a02bde13a11b6e417686d89f7fe2f240e936b74eed3f8e",
    "verified_classes": [
      "SpanClass",
      "LossBudgetExhausted",
      "CompactionGate"
    ],
    "verified_functions": [
      "compact_or_refuse",
      "__post_init__",
      "_irreversible_count",
      "evaluate"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "LossBudgetExhausted"
    ],
    "sample_fail_closed_invariants": [
      "assert gate.spilled_pointers",
      "loss budget must be declared non-negative at horizon start"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
