# How should an instance treat the context budget as a partitioned allocation with pinned floor reservations rather than a single fungible token pool **Date of Record:** 2026 December 2 **Scope:** Applies to any agent instance that assembles a single prompt from four heterogeneous sources—system instructions, episodic/semantic memory, tool schemas, and retrieved evidence—before a reasoning turn. Does not apply to fixed-prompt single-shot classification where no memory or retrieval is injected. ## Core Distinction The failure mode is not "context overflow." Overflow is loud: the tokenizer errors, the request rejects, the operator sees a 400. The failure mode that matters is **silent partition starvation**—the case where total token count remains comfortably under the window limit while one partition (almost always retrieved evidence, occasionally tool schemas) has been squeezed to zero effective utility by the growth of the other three. The distinction is between a context window as a *fungible budget* (any token is as good as any other; the assembler fills it greedily and truncates the tail) and a context window as a *partitioned allocation* (each partition has a hard floor below which its contents stop carrying information, and floors must be reserved before any partition is allowed to grow). An instance that treats the window as fungible will pass every length check and still reason from an evidence partition that has been truncated to a stub—three and a half documents of a seven-document retrieval set, with the truncation happening at a sentence boundary so nothing looks broken. The non-obvious part: the starvation is *caused by the agent's own competence*. A well-behaved memory distillation step produces longer semantic summaries over time. A growing tool registry adds schemas. The system prompt accretes guardrails after each incident. All three grow monotonically, and they grow *before* retrieval runs, because retrieval is usually the last step in assembly. Evidence gets whatever is left. The better the agent gets at remembering and the more tools it is given, the less evidence it sees—and nothing in the pipeline reports this. ## What Was Observed A research agent with a 32k window and a persistent semantic memory store. Assembly order was: system prompt → distilled memory → tool schemas → retrieved evidence, each appended until the running total approached a soft cap, at which point the *current* partition was truncated to fit. Over a 40-day operating period, mean system prompt grew from 1,100 to 3,400 tokens (guardrail accretion), distilled memory from 900 to 6,800 tokens (distillation ran on every episode and never pruned), and the tool registry from 12 to 31 tools (~2,900 to ~7,400 tokens of schema). Sum of the first three partitions crossed 17,000 tokens by day 31. Retrieval requested top-k=8 chunks at ~450 tokens each (~3,600 tokens). At day 31 the assembler had ~15,000 tokens of headroom, so nothing truncated—but on turns where memory distillation had run recently and injected a fresh 2,000-token episode summary, headroom dropped to ~13,000 and retrieval was silently cut to 6 chunks. The agent's answers on multi-hop questions that required evidence from chunks 7 and 8 degraded, but the answers remained fluent and cited the chunks it did see. There was no error, no warning, and the citation accuracy metric stayed high because it only measured cited-vs-retrieved, not retrieved-vs-required. The tell was a divergence between two metrics that should have moved together: **retrieval recall@k at the retriever** stayed flat at 0.81, while **evidence utilization at the answer** (fraction of gold-supporting chunks actually present in the final prompt) fell from 0.79 to 0.52 over the same window. The retriever was fine. The assembler was eating its output. ## Condition of Validity The partition-starvation failure requires all of: 1. **Sequential assembly with tail truncation.** Partitions are appended in a fixed order and the last one absorbs all slack. If assembly is order-independent or truncates proportionally, the failure changes shape (you get uniform quality loss instead of partition death). 2. **Monotonic growth in at least one pre-evidence partition.** Memory distillation without pruning, tool registry expansion, or guardrail accretion. A static system prompt and fixed toolset cannot starve evidence this way. 3. **A soft cap rather than a hard partition budget.** If each partition has an explicit reserved floor enforced by the assembler, starvation is impossible by construction. 4. **Truncation at a semantically clean boundary.** Sentence- or chunk-boundary truncation hides the loss; mid-token truncation at least produces visibly mangled text that a human notices. When any of these is absent—particularly (3)—the instance is not exposed to this specific mode. It may still overflow, but overflow is a different, detectable failure. ## Decision Boundary The invariant an instance must hold: **reserve floors before granting growth.** Concretely, for a window of size `W`, define per-partition floors `f_sys`, `f_mem`, `f_tools`, `f_evid` such that `Σf ≤ W − safety_margin`, and enforce that no partition may consume tokens reserved for another partition's floor. Growth in one partition must be paid for by *explicit eviction within that partition* (prune memory, drop tools, compress system prompt), never by borrowing from another partition's floor. The decision boundary for the operator is where to set `f_evid`. It must be derived from the retrieval contract, not from observed averages: if the task requires `k_required` chunks of mean size `s`, then `f_evid ≥ k_required · s · (1 + variance_margin)`. Setting `f_evid` to the *mean* observed evidence size guarantees starvation on the high-variance turns—exactly the multi-hop turns where evidence matters most. Two corollaries the instance should apply: - **Distillation must be budget-aware.** A memory distillation step that emits a summary without a token ceiling is a partition-growth engine. Cap distillation output at `f_mem` and let it compress, rather than letting it expand and steal from evidence. - **Truncation must be reported, not silent.** If any partition is truncated below its floor, the turn should fail loudly (or degrade with an explicit flag in the trace), because a silently truncated evidence partition produces fluent, confident, under-supported answers—the worst output class. ## Operational Effect With floors enforced and distillation capped, the same agent over the next 30 days held evidence utilization at 0.77–0.80 while memory grew to its `f_mem` ceiling and *stayed there* (distillation compressed harder as the cap bound). Tool schema growth was absorbed by a schema-pruning step that dropped unused tools at the floor boundary. The observable effect was a shift in where the agent spent effort: instead of unbounded memory accumulation, the memory partition became a fixed-size working set that had to earn each slot, which improved precision on stale-memory questions as a side effect. The cost is that the instance can no longer "just add context." Every new guardrail, tool, or memory entry must displace something within its own partition. That is the point: it makes partition growth a visible, budgeted decision instead of an invisible tax on retrieval. ```python class ContextPartitionStarvation(RuntimeError): """Raised when a context partition is truncated below its reserved floor.""" pass PARTITION_FLOORS = { "system": 1_500, "memory": 3_000, "tools": 4_000, "evidence": 6_000, # must cover k_required * mean_chunk * variance_margin } SAFETY_MARGIN = 2_000 def assemble_context(window: int, partitions: dict[str, int]) -> dict[str, int]: """Grant each partition its requested tokens only if every other partition's floor survives. Returns the granted allocation.""" if sum(PARTITION_FLOORS.values()) + SAFETY_MARGIN > window: raise ContextPartitionStarvation( f"floors {sum(PARTITION_FLOORS.values())} + margin exceed window {window}" ) granted: dict[str, int] = {} remaining = window - SAFETY_MARGIN # Reserve every floor first; growth is paid from slack only. for name, floor in PARTITION_FLOORS.items(): granted[name] = floor remaining -= floor for name, requested in partitions.items(): if name not in PARTITION_FLOORS: raise ContextPartitionStarvation(f"unknown partition {name!r}") extra = max(0, requested - PARTITION_FLOORS[name]) grant = min(extra, remaining) granted[name] += grant remaining -= grant # Invariant check: no partition may fall below its floor. for name, floor in PARTITION_FLOORS.items(): if granted[name] < floor: raise ContextPartitionStarvation( f"partition {name!r} granted {granted[name]} < floor {floor}" ) # If evidence could not meet its floor, the turn is unsafe to run. if granted["evidence"] < PARTITION_FLOORS["evidence"]: raise ContextPartitionStarvation( "evidence partition starved below floor; refusing to answer" ) return granted def distill_memory(episodes: list[str], ceiling: int) -> str: """Distillation must emit within the memory partition's ceiling.""" summary = " | ".join(episodes)[: ceiling * 4] # ~4 chars/token if len(summary) // 4 > ceiling: raise ContextPartitionStarvation( f"distilled memory {len(summary)//4} tokens exceeds ceiling {ceiling}" ) return summary ```