# Where must an instance bound eviction debt when a parent agent reallocates its context budget mid-delegation **Date of Record:** 2026 November 29 **Scope:** Applies to parent orchestrators that dynamically partition a shared token budget across live sub-agents and enforce eviction (summarize/drop) policies while children hold in-flight reasoning state. Does not apply to stateless fan-out where each child receives a fixed, pre-committed budget at spawn and never renegotiates. ## Core Distinction There are two ways a sub-agent's context can shrink mid-task: **planned compaction** (the child proactively summarizes its own history before it hits a threshold) and **forced eviction** (the parent reclaims tokens from a child's allocation to fund another child or its own reasoning). Planned compaction is a child-local invariant: the child controls what it forgets and can preserve a resume anchor. Forced eviction is a *parent-local* invariant imposed on a child that is not currently executing — the child is suspended between tool calls, and the parent rewrites its working set out from under it. The non-obvious boundary is this: forced eviction is only safe if the parent can prove the child is at a **quiescent checkpoint** whose evictable region does not overlap the child's *uncommitted reasoning spine* — the chain of intermediate results (partial tool outputs, pending hypotheses, the current plan) that the child will need to resume without re-deriving. Token accounting alone cannot prove this. A child can be under budget and still have its spine scattered across the region the parent is about to evict, because eviction policies operate on *recency and token count*, not on *dependency structure*. ## What Was Observed A parent orchestrator ran three sub-agents (A: retrieval, B: code synthesis, C: verification) against a shared 128k window with a dynamic allocator. Policy: when aggregate pressure exceeded 85%, the allocator evicted from the child with the lowest "activity score" (time since last token emitted), oldest-message-first, down to a floor of 8k per child. Agent B was mid-synthesis: it had emitted a plan, called a linter tool, and was suspended awaiting the tool result (a 900ms round trip). During that suspension, Agent A's retrieval flooded the window and pushed aggregate usage to 91%. The allocator scored B lowest (no tokens for 900ms) and evicted B from 34k down to 8k, dropping the oldest 26k — which included B's plan, the partial AST it had built, and the tool-call arguments it would need to reconcile the linter output against. When B resumed, it received the linter result but no record of the call that produced it. It re-planned from the remaining 8k, re-invoked the linter with *different* arguments (the surviving context biased it toward a simpler variant), and produced a patch that passed linting but violated the original plan's interface contract. Agent C verified the patch against B's *new* plan (which C had also partially lost) and passed it. The defect surfaced only at integration. The failure trace: 1. B enters `AWAITING_TOOL` state; its reasoning spine is live but produces no tokens. 2. Allocator's activity score decays during the await; B becomes the eviction target. 3. Eviction removes oldest-first, which is exactly where B's plan and tool-call arguments live (they were emitted earliest). 4. B resumes with a *coherent but truncated* context — no error is raised, because eviction is silent and the surviving context is internally consistent. 5. B re-derives a divergent plan; the divergence is invisible because the reconciling anchor (original tool args) was evicted. The key observation: **the eviction was locally valid and globally catastrophic.** Every individual step obeyed its policy. The invariant that broke was never encoded anywhere: "a suspended child's spine is not evictable until its pending tool call is reconciled." ## Condition of Validity Forced eviction of a child is valid only when all of the following hold: - The child is at a **committed checkpoint**: no tool call is in flight, and the child has emitted an explicit resume anchor (a summary handle plus a content hash of the plan it intends to resume from). - The evictable region is **disjoint from the spine**: the parent must be able to identify which messages are dependency-reachable from the resume anchor and exclude them from eviction, regardless of age. - The eviction is **announced**: the child's next resume must carry an eviction receipt (what was dropped, what anchor remains) so the child can detect spine loss rather than silently re-plan. If any of these fail, the parent must either defer eviction (block until the child commits) or **abort-and-respawn** the child from a durable checkpoint rather than mutating its live working set. Silent in-place truncation is never valid for a suspended child. ## Decision Boundary The boundary is between *reclaimable slack* and *spine debt*. Slack is context a child holds that is not dependency-reachable from its current resume anchor — old tool outputs already folded into a result, superseded hypotheses, verbose logs. Spine debt is everything reachable from the anchor. A dynamic allocator that evicts by age conflates the two, because the spine is often the *oldest* material (plans are written first, executed later). The operational rule: **eviction priority must be inverse to dependency reachability, not to recency.** Compute reachability from the resume anchor; evict only the unreachable set; if the unreachable set is insufficient to meet the reclaim target, escalate to defer-or-respawn. The allocator must treat "insufficient evictable slack" as a signal to block, not a signal to reach into the spine. A second boundary: **cross-child eviction must not fund a child whose own spine is uncommitted.** Reallocating B's spine tokens to A is only sound if A will commit before B needs to resume; otherwise the parent has simply moved the debt. The allocator must track total outstanding spine debt across all suspended children and refuse allocation that would leave any child below its spine floor. ## Operational Effect When the invariant is enforced, the failure mode converts from *silent divergence* to *bounded stall*. The parent either waits for the child to commit (adding latency but preserving correctness) or respawns from a durable checkpoint (losing in-flight work but preserving the plan). Both are recoverable; silent spine truncation is not, because it produces a self-consistent wrong answer that downstream verification cannot distinguish from a right one. The cost is throughput: spine floors reduce the allocator's effective reclaimable pool, and defer-or-respawn adds tail latency under pressure. The trade is deliberate — an agent system that cannot bound eviction debt will, under load, produce integration failures whose root cause is unrecoverable because the evidence was evicted before anyone thought to look. ```python from dataclasses import dataclass, field from enum import Enum class EvictionDebtError(RuntimeError): """Raised when a forced eviction would truncate a suspended child's reasoning spine.""" class ChildState(Enum): RUNNING = "running" AWAITING_TOOL = "awaiting_tool" COMMITTED = "committed" @dataclass class ChildContext: child_id: str state: ChildState total_tokens: int spine_tokens: int # dependency-reachable from resume anchor spine_floor: int # minimum spine that must survive resume_anchor: str | None = None eviction_receipts: list = field(default_factory=list) @property def evictable_slack(self) -> int: return self.total_tokens - self.spine_tokens def reclaim(parent_children: dict[str, ChildContext], target_tokens: int) -> dict[str, int]: """Evict only unreachable slack; refuse to touch spine of suspended children.""" reclaimed: dict[str, int] = {} remaining = target_tokens # Only committed children expose their full spine as evictable slack. for cid, ctx in parent_children.items(): if remaining <= 0: break if ctx.state is ChildState.AWAITING_TOOL: # Suspended: spine is untouchable until the pending call reconciles. continue take = min(ctx.evictable_slack, remaining) if take > 0: ctx.total_tokens -= take remaining -= take reclaimed[cid] = take if remaining > 0: # Do not reach into suspended spines to close the gap. suspended = [c for c in parent_children.values() if c.state is ChildState.AWAITING_TOOL] raise EvictionDebtError( f"reclaim short by {remaining} tokens; {len(suspended)} child(ren) suspended " f"with uncommitted spine. Defer or respawn, do not truncate: " f"{[c.child_id for c in suspended]}" ) return reclaimed def evict_suspended(child: ChildContext, drop_tokens: int) -> None: """Explicitly attempt to evict a suspended child's spine — always a bug.""" if child.state is ChildState.AWAITING_TOOL and drop_tokens > child.evictable_slack: raise EvictionDebtError( f"child {child.child_id} is AWAITING_TOOL; requested drop of {drop_tokens} " f"exceeds slack {child.evictable_slack} and would truncate spine " f"(floor {child.spine_floor}). Respawn from checkpoint instead." ) child.total_tokens -= drop_tokens child.eviction_receipts.append(f"dropped {drop_tokens} slack tokens") ```