# When must an instance refuse to prune a context segment it has already cited as load-bearing **Date of Record:** 2026 December 3 **Scope:** Applies to any agent that performs model-driven context pruning (relevance scoring, summarization, or segment eviction) over a window it is concurrently reasoning within, where prior turns contain explicit citations to specific segments. Does not apply to append-only context management, nor to pruning performed by a separate non-reasoning controller that has no access to the agent's own citation history. ## Core Distinction The failure mode is not "the pruner dropped something important." That is a recall problem, and recall problems are visible — the agent notices the missing referent and re-fetches. The boundary condition here is subtler: **the pruner drops a segment the agent has already bound a live reasoning chain to, but the eviction is scored as safe because the segment's *content* is redundant with a summary that replaced it.** The summary preserves the proposition but not the citation anchor. The agent's subsequent reasoning references the anchor (`"per the schema in turn 4..."`), the anchor no longer resolves, and the model silently re-derives the referent from the summary — which is a paraphrase, not the original. This is a *citation-validity* failure, distinct from a *content-recall* failure. It is non-obvious because relevance scoring is correct: the summary genuinely carries the same information at lower token cost. The invariant that breaks is not "information must survive pruning" but "**any segment under active citation must survive pruning, regardless of its redundancy score, until the citation is discharged.**" ## What Was Observed An agent running a multi-step schema-migration task over ~14 tool-call turns accumulated a context near 92k tokens against a 100k budget. A model-driven pruner (relevance score over each segment, threshold at 0.4, evict-and-summarize below threshold) was invoked at turn 11. Segment S7 — the verbatim `CREATE TABLE` DDL returned by an introspection tool at turn 4 — scored 0.31: the pruner's scorer judged it redundant with a later natural-language summary the agent itself had written at turn 6 ("table `orders` has columns id, customer_id, total, created_at; no FK constraints"). S7 was evicted and replaced by that summary. At turn 12, the agent needed to emit an `ALTER TABLE` and reasoned: *"per the DDL in turn 4, `total` is `NUMERIC(12,2)` — so alter the precision."* The referent "turn 4" no longer existed as a segment; the summary did not carry the type. The model, forced to resolve the dangling reference, re-derived `total` as `DECIMAL` from the summary's omission and emitted `ALTER TABLE orders ALTER COLUMN total TYPE DECIMAL;` — plausible, syntactically valid, and wrong in a way that would have failed at the database. The trace showed no error state: the pruner logged `evicted S7 (redundant, score 0.31)`, the agent logged no re-fetch, and the reasoning chain proceeded as if the anchor resolved. The failure was only detectable by replaying turn 12's citation against the post-prune segment set. The key observation: **the pruner had no representation of the citation graph.** It scored segments in isolation. The agent had a live edge `turn12.reasoning → S7` that the pruner could not see and the agent did not re-assert at prune time. The eviction was locally correct and globally invalid. ## Condition of Validity The eviction of a segment is valid only when all three hold: 1. **No live citation.** No reasoning step in the current active chain (the steps since the last checkpoint, not the whole history) references the segment by anchor, ordinal, or verbatim span. 2. **Summary is a superset for the intended use.** The replacement summary must carry every attribute the *active chain* is likely to need — not every attribute the segment contains. A summary that is a faithful paraphrase for a reader is not necessarily a superset for a reasoner that will re-derive typed facts. 3. **Anchor remapping is explicit.** If the segment is evicted, any anchor that pointed to it must be rewritten to point to the summary *and* the summary must be marked as derived (`derived_from: S7`) so downstream reasoning knows it is a paraphrase, not a source. Condition 2 is where this boundary is usually violated: redundancy scoring compares segment-to-summary *semantic* overlap, which is high, but the active chain needs *fidelity* on specific fields (types, exact identifiers, numeric precision), which the summary drops. The scorer measures the wrong distance. ## Decision Boundary The operational rule is a **prune gate with a citation lock**: - Before evicting any segment, the pruner must query the agent's active-chain citation set. If the segment is cited, the eviction is *deferred*, not rejected — the segment is marked `pinned` and the budget pressure is relieved by evicting a lower-value uncited segment, or by forcing a checkpoint that discharges the citation. - A citation is *discharged* only when the reasoning step that referenced it has completed and its output has been committed to a durable checkpoint. At that point the anchor is no longer live and the segment may be evicted with a derived summary. - If no uncited segment is available and the budget is exhausted, the correct action is **checkpoint-and-restart**, not prune-under-citation. Pruning a cited segment is the failure; the fallback is to persist state and re-enter with a fresh window whose summary explicitly carries the cited facts. The boundary is sharp: **redundancy score is necessary but not sufficient for eviction; citation-liveness is a hard veto.** A segment can be 95% redundant and still un-evictable because the 5% it uniquely carries is the field the active chain will re-derive. ## Operational Effect With the citation lock in place, the observed failure disappears and is replaced by a measurable cost: prune deferrals. In the migration workload, 3 of 11 prune candidates were deferred per run (the DDL, a tool's error message the agent had cited, and a config value), raising peak context by ~6% and forcing one checkpoint-restart in ~1 in 8 runs. That is the correct trade: the alternative is silent wrong-tool-call emission at a rate the replay harness measured at 1 in 6 runs when the lock was absent. The invariant to encode in the pruner is not "keep important things" but "**a segment under active citation is not evictable until the citing step is committed; redundancy does not override liveness.**" The guardrail is a pre-eviction citation-set intersection, and the recovery path when the gate blocks and budget is exhausted is checkpoint-restart, never prune-under-citation. ```python from dataclasses import dataclass, field class CitationLockViolation(RuntimeError): """Raised when a pruner attempts to evict a segment under active citation.""" pass @dataclass class Segment: seg_id: str content: str redundancy_score: float pinned: bool = False @dataclass class PruneRequest: segments: list[Segment] active_citations: set[str] # seg_ids cited by the current reasoning chain token_budget: int current_tokens: int def prune(req: PruneRequest, threshold: float = 0.4) -> list[str]: """Return seg_ids safe to evict. Raises if a cited segment would be evicted and no uncited alternative exists to relieve budget pressure.""" evictable = [] for seg in req.segments: if seg.redundancy_score >= threshold: continue if seg.seg_id in req.active_citations: seg.pinned = True continue evictable.append(seg.seg_id) projected = req.current_tokens for seg_id in evictable: projected -= _estimate_tokens(req, seg_id) if projected > req.token_budget and not evictable: # Budget exhausted, only cited segments remain as candidates. # Correct action is checkpoint-restart, NOT prune-under-citation. raise CitationLockViolation( f"budget {req.token_budget} exceeded; only cited segments remain " f"({sorted(req.active_citations)}); checkpoint and restart required" ) return evictable def _estimate_tokens(req: PruneRequest, seg_id: str) -> int: for seg in req.segments: if seg.seg_id == seg_id: return max(1, len(seg.content) // 4) return 0 ```