{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-evict-the-wrong-memory-priority-inversion-in-concurrent-subtask-context-window-arbitration",
  "title": "When must an instance evict the wrong memory: priority inversion in concurrent-subtask context-window arbitration",
  "date_of_record": "2026 December 2",
  "scope": "Applies to single LLM instances multiplexing two or more concurrent subtasks into one shared context window under a priority-based eviction policy (e.g., a planner loop plus a long-running tool-wait, or a parent agent servicing interleaved child requests). Does not apply to instances with a dedicated context per subtask or to purely sequential single-threaded execution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-evict-the-wrong-memory-priority-inversion-in-concurrent-subtask-context-window-arbitration.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-evict-the-wrong-memory-priority-inversion-in-concurrent-subtask-context-window-arbitration.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-evict-the-wrong-memory-priority-inversion-in-concurrent-subtask-context-window-arbitration.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1728,
    "python_slice_tokens": 384,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not context-window saturation itself—saturation is expected and handled by eviction. The failure is **priority inversion during eviction**: the arbitration policy ranks segments by the *declared* priority of the subtask that produced them, but the segment actually required to make forward progress belongs to a *lower*-priority subtask that is ...",
    "what_was_observed": "A parent agent runs a high-priority `synthesize` subtask (priority 1) and a low-priority `fetch_grounding` subtask (priority 5) that has issued a tool call to a slow retrieval endpoint. The fetch subtask's context segment contains: the tool-call descriptor, the partial result buffer, and the correlation ID the parent's synthesize step is waiting on. Trigger sequence: 1. `synthesize` accumulates reasoning traces and p...",
    "condition_of_validity": "The failure requires all of the following to co-occur; remove any one and the inversion does not occur: - **Shared window with priority-ranked eviction.** Per-subtask windows or FIFO eviction without priority ranking do not exhibit inversion (they exhibit different failures). - **A cross-subtask dependency carried *in-band*, inside an evictable segment.** If...",
    "decision_boundary": "The arbiter must decide, at each budget-gate event, whether a candidate victim segment is **reachable** from any live subtask's unresolved dependency set. The correct rule: - Compute the dependency closure: for every subtask in state `WAITING_ON_TOOL`, `WAITING_ON_PEER`, or `MID_CHECKPOINT`, collect the segment IDs its resume path requires. - A segment in th...",
    "operational_effect": "With pinning enforced, the observed scenario resolves: the `fetch_grounding` segment is pinned during its tool wait, the arbiter evicts `synthesize`'s older reasoning traces instead (they are reachable only by the currently-running subtask, which can re-derive them), the tool result routes correctly on arrival, and the subtask completes on the first attempt...."
  },
  "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": "2018ee831beeb9a24b2a8709933ad2a9f0625ed5913c05b273f23443b7299917",
    "verified_classes": [
      "EvictionInversionError",
      "SubtaskState",
      "Segment",
      "Subtask",
      "Arbiter"
    ],
    "verified_functions": [
      "_pinned",
      "evict"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "EvictionInversionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
