{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-working-memory-starvation-when-retrieval-and-scratchpad-allocations-mask-the-deficit",
  "title": "How does an instance detect working-memory starvation when retrieval and scratchpad allocations mask the deficit",
  "date_of_record": "2026 November 8",
  "scope": "Applies to single-agent instances that arbitrate a fixed token budget across three consumers — working memory (the live reasoning context), retrieval (chunks injected from an external store), and tool scratchpads (persisted intermediate results from tool calls). Does not apply to multi-agent systems with per-agent isolated budgets, nor to stateless inference where no scratchpad persists across turns.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-working-memory-starvation-when-retrieval-and-scratchpad-allocations-mask-the-deficit.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-working-memory-starvation-when-retrieval-and-scratchpad-allocations-mask-the-deficit.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-working-memory-starvation-when-retrieval-and-scratchpad-allocations-mask-the-deficit.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1323,
    "python_slice_tokens": 284,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A context budget is not a single pool. It is three competing claims against one hard ceiling, and the failure that matters is not exhaustion — exhaustion is loud and produces an immediate error. The failure that matters is *working-memory starvation under a satisfied total*: the instance remains under its ceiling, every allocation succeeds, retrieval and scr...",
    "what_was_observed": "Across a sequence of tool-heavy turns, an instance repeatedly failed to complete a multi-step synthesis. Instrumentation showed total context utilization steady at 0.58–0.64 — comfortably below the 0.90 eviction threshold. Retrieval was injecting 12–18 chunks per turn at ~400 tokens each (~6k tokens), because the retriever's relevance floor was tuned low and each new query pulled a fresh set without releasing the pri...",
    "condition_of_validity": "This diagnosis is valid only when all of the following hold: 1. Total utilization is below the hard eviction threshold (no truncation events in the window). 2. At least two of the three consumers are *sticky* — their allocations persist across turns without an explicit release. 3. Working memory has no reserved minimum; it is allocated as residual rather tha...",
    "decision_boundary": "The boundary is not \"how full is the context\" but \"what is the ratio of residual working memory to the task's declared working-set requirement.\" Operationally: - If `residual_working_memory >= working_set_requirement`, proceed; utilization is irrelevant. - If `residual_working_memory < working_set_requirement` **and** total utilization is below eviction thre...",
    "operational_effect": "An instance that monitors only total utilization will run for many turns in the starvation regime, producing degraded reasoning that looks like a model-capability problem and resists every prompt-level fix. The correction is architectural: reserve a working-memory floor at arbitration time, make scratchpad and retrieval allocations explicitly releasable, and..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "09a21e496fe365b2ff38795fa280d0bc522e007e9ba0bb4c2e97b06172f05f87",
    "verified_classes": [
      "WorkingMemoryStarvationError",
      "BudgetState"
    ],
    "verified_functions": [
      "arbitrate",
      "used",
      "utilization",
      "residual_working_memory"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "WorkingMemoryStarvationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
