{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-token-budget-schedulers-from-silently-starving-the-compaction-reservation-under-latency-slo-pressure",
  "title": "Which invariants prevent token-budget schedulers from silently starving the compaction reservation under latency SLO pressure",
  "date_of_record": "2026 November 23",
  "scope": "Applies to single-agent loops whose prompt is assembled per turn by a budget scheduler that allocates a fixed context window across four competing consumers — system/instructions, retrieved evidence, episodic memory recall, and a reserved compaction/scratch region — while a per-turn latency SLO gates the number of retrieval and recall calls. Does not apply to stateless one-shot inference, or to systems where compaction is performed by an external process outside the token budget (e.g., out-of-band summarization microservices with unbounded side context).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-token-budget-schedulers-from-silently-starving-the-compaction-reservation-under-latency-slo-pressure.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-token-budget-schedulers-from-silently-starving-the-compaction-reservation-under-latency-slo-pressure.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-token-budget-schedulers-from-silently-starving-the-compaction-reservation-under-latency-slo-pressure.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2421,
    "python_slice_tokens": 481,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **budget allocation as a static partition** and **budget allocation as a deadline-coupled reservation system**. Most schedulers are written as the former: they compute per-consumer caps `(B_sys, B_ret, B_mem, B_cmp)` summing to the window `W`, then fill each cap greedily. This is stable only when every consumer's fill ...",
    "what_was_observed": "A 14-turn tool-using agent (retrieval-augmented, with episodic memory recall) was run under a prompt budget `W = 32k` tokens with per-consumer caps `B_sys=2k, B_ret=14k, B_mem=6k, B_cmp=10k`. The per-turn latency SLO was 4.0s at p95. On turns where the combined retrieval+recall latency exceeded 2.6s (roughly 18% of turns under load), the scheduler's deadline governor fired and shortened the *number of retrieval calls...",
    "condition_of_validity": "The failure requires three conditions simultaneously, and the invariant must hold whenever all three are present: 1. **Ordered fill with a satisfaction gate.** The fill loop processes consumers in a fixed order and later consumers are gated on earlier ones being \"satisfied.\" This converts an under-fill of an early consumer into a *skip* of a later one. If co...",
    "decision_boundary": "The boundary is between **deferral** (legitimate: compaction is not needed to answer the current turn, and the working set is comfortably below the window) and **starvation** (illegitimate: deferral accumulates an un-compacted working set whose growth rate exceeds the window's ability to absorb it before the next compaction opportunity). The scheduler must b...",
    "operational_effect": "With the headroom-and-debt invariant enforced, the same 14-turn run (replayed against the same load trace) showed: compaction skipped on 3 turns (all legal: `U_t + D_t + C_t ≤ H` held), working set peaked at 14.8k (vs. 19.4k), no lossy eviction occurred, and the turn-12 duplicate-retrieval cascade did not trigger because the cited tool output was still prese..."
  },
  "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": "f049fab19b07f8f14bbc15167806c5f26596e7ba929751bd1b6af3819c1b7de4",
    "verified_classes": [
      "CompactionStarvationError",
      "Budget"
    ],
    "verified_functions": [
      "decide_compaction",
      "apply_turn",
      "hard_headroom"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "CompactionStarvationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
