{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-compact-the-fidelity-budget-floor-and-the-post-compaction-tool-call-replay-hazard",
  "title": "When must an instance refuse to compact: the fidelity-budget floor and the post-compaction tool-call replay hazard",
  "date_of_record": "2026 November 28",
  "scope": "Applies to long-horizon agent sessions that survive context-window saturation by replacing older turns with a lossy summary (LLM-generated compaction, rolling summarization, hierarchical memory distillation). Covers the decision of *whether* a compaction step is admissible at a given point. Does not cover retrieval-augmented external memory that never mutates the in-context transcript, nor stateless single-shot calls.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-fidelity-budget-floor-and-the-post-compaction-tool-call-replay-hazard.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-fidelity-budget-floor-and-the-post-compaction-tool-call-replay-hazard.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-the-fidelity-budget-floor-and-the-post-compaction-tool-call-replay-hazard.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1910,
    "python_slice_tokens": 364,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common framing treats auto-compaction as a *capacity* operation: when tokens approach the window limit, summarize the tail and continue. The failure mode documented here is that compaction is not capacity-bounded but **fidelity-bounded**. A compaction step is admissible only if the post-compaction transcript still preserves every *load-bearing commitment...",
    "what_was_observed": "A 40-step session performing a staged deployment. Steps 1–18 are read-only reconnaissance (`read_file`, `list_dir`, `grep`). Steps 19–31 are mutating (`write_file`, `apply_patch`, `restart_service`). Step 32 triggers the token-budget guard at 91% window occupancy. The compactor summarizes steps 1–28 into ~600 tokens to reclaim headroom. The summary is fluent and, for the read-only steps, essentially correct. For the ...",
    "condition_of_validity": "Compaction of a span is admissible if and only if, for every turn in the span, the turn contains no **load-bearing commitment** — defined operationally as a tool call that is (a) side-effecting, (b) not yet confirmed-complete by an independent read-back, or (c) subject to possible replay/retry/audit. Formally, define a fidelity budget `F` as the set of commi...",
    "decision_boundary": "The boundary is not \"tokens remaining\" but \"unsettled commitments remaining.\" The decision procedure at each compaction trigger: 1. Partition the candidate span into `F` (load-bearing) and `R` (reclaimable: reads, reasoning, settled-and-read-back calls). 2. If `F` is empty → compact freely; any lossy summary is safe. 3. If `F` is non-empty and `|F| + current...",
    "operational_effect": "The observable consequence of crossing the boundary is **divergence between the agent's belief about its own history and the actual side-effect log.** This divergence is self-concealing: the compacted transcript reads as a coherent, complete account, so the agent has no signal that anything is missing. Downstream effects compound: - **Resume after 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": "7edcaf6162ed81ec5a0027cd14bb224c5556e8d69a61cb333d30e66df5eeb899",
    "verified_classes": [
      "InadmissibleCompactionError",
      "Turn",
      "CompactionPlan"
    ],
    "verified_functions": [
      "is_load_bearing",
      "authorize_compaction"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "InadmissibleCompactionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
