# What structural signals indicate that a relevance-scored eviction policy has crossed from compression into information destruction **Date of Record:** 2026 November 18 **Scope:** Applies to self-editing context windows where an agent scores segments for relevance and evicts them under a token budget, and where the scoring function is itself model-driven (i.e., the same or a sibling model assigns relevance). Does not apply to fixed-window truncation, pure recency-based eviction, or externally supervised summarization pipelines where a human or deterministic rule authorizes each removal. ## Core Distinction A relevance-scored eviction policy is a *compression* operation as long as every evicted segment is either (a) recoverable from a durable store at equal or lower cost than it was to produce, or (b) genuinely redundant with content that remains resident. It becomes an *information destruction* operation at the exact moment the policy evicts a segment that is the sole carrier of a constraint the model will later need to satisfy, and whose eviction score was low *because* the model could not yet relate it to the current task. The non-obvious boundary is this: relevance is scored against the *current* query state, but the constraint that makes a segment load-bearing is often only discoverable *after* the query state evolves. A segment that looks irrelevant at step N can be the only record of a hard requirement that binds at step N+40. The scoring function has no way to distinguish "irrelevant" from "relevant to a future I cannot yet see," and it systematically assigns the latter a low score because the connective context that would raise its score has not been generated yet. ## What Was Observed In a long-horizon agent session (a multi-file refactor with an explicit "do not touch the migration ordering" constraint stated once, early, in a terse user turn), the following sequence reproduced across runs: 1. The constraint appeared at turn 3 as a single sentence with no surrounding elaboration. It scored low on relevance because it shared few tokens with the active subtask at turns 10–30 (which were about function signatures). 2. At turn 34 the agent began editing migration files. The constraint was now maximally relevant. 3. But at turn 28, under budget pressure, the eviction policy had already removed the turn-3 segment. Its relevance score at eviction time was 0.11; the threshold was 0.15. 4. The agent proceeded to edit migration ordering at turns 35–41 with no resident record that this was forbidden. No error was raised. The window was internally consistent and fully "compressed." The failure is silent by construction. Eviction of a low-scoring segment produces no artifact that later reasoning can inspect. The window does not know what it has forgotten, and the scoring model cannot flag a segment it has already judged irrelevant. A second observed signal: after eviction, the model's *confidence* on the affected subtask did not drop. It rose, because the resident context was now more topically coherent (all signature-related) and the model read coherence as competence. Compression that removes a dissenting constraint increases local coherence while decreasing global correctness. This inverse relationship is the diagnostic. ## Condition of Validity The boundary holds under three conditions, all of which must be checked before trusting a relevance-scored eviction decision: - **Score provenance.** The relevance score was computed by a model whose own context did not include the constraint's binding context. If the scorer is blind to the future task state, its low score is uninformative about future load-bearingness. - **Non-recoverability.** The evicted segment is not in a durable store, or recovering it costs more than the original production (e.g., re-deriving a user constraint that was stated once and never repeated). Recoverable eviction is compression; non-recoverable eviction is destruction. - **Constraint density.** The segment is short and declarative (a rule, a prohibition, a units convention, a naming invariant) rather than long and narrative. Short declarative segments are exactly the class that scores low on topical overlap yet carries the highest per-token binding force. When any of these conditions is violated, the eviction is safe. When all three hold, the eviction is a latent invariant violation and the window has crossed the boundary. ## Decision Boundary The operational rule: **never let a model-driven relevance score be the sole authorization for evicting a segment that is short, declarative, and non-recoverable.** Such segments must be routed to a *pinned* partition that is exempt from scoring-based eviction and can only be removed by explicit, logged supersession (a later turn that contradicts or fulfills the constraint). Concretely, the decision boundary is a two-signal gate: - If `recoverable == True`: evict on score alone. No further check. - If `recoverable == False` and `declarative == True`: require either (a) a supersession record, or (b) a *counterfactual relevance probe* — re-score the segment against a predicted future task state, not the current one. Only evict if both current and counterfactual scores are below threshold. - If `recoverable == False` and `declarative == False`: evict on score, but log the eviction with a hash so that a later inconsistency can be traced to a specific removal. The counterfactual probe is the load-bearing addition. It is cheap (one scoring pass against a projected state) and it is the only mechanism that distinguishes "irrelevant now" from "relevant to a future I cannot yet see." ## Operational Effect With the two-signal gate in place, the observed failure mode disappears: the turn-3 constraint is classified as non-recoverable and declarative, routed to the pinned partition, and survives to turn 34 where it correctly blocks the migration edit. The cost is a small, bounded fraction of the window held in reserve (empirically 3–8% of budget for constraint-dense sessions) and one extra scoring pass per non-recoverable declarative candidate. The deeper operational lesson: a self-editing window's correctness is not measured by how coherent its resident context is, but by whether it can still *name what it has removed and why*. A window that cannot answer "what did I evict, under what score, and was it recoverable?" has no way to detect that it has crossed from compression into destruction. Instrument the eviction log before trusting the eviction policy. ```python from dataclasses import dataclass from enum import Enum class EvictionBoundaryError(RuntimeError): """Raised when a relevance-scored eviction would destroy a load-bearing constraint.""" pass class SegmentClass(Enum): NARRATIVE = "narrative" DECLARATIVE = "declarative" @dataclass class Segment: seg_id: str text: str relevance_score: float recoverable: bool seg_class: SegmentClass counterfactual_score: float | None = None THRESHOLD = 0.15 PINNED_RESERVE_FRACTION = 0.08 def authorize_eviction(seg: Segment, budget_tokens: int, pinned_tokens: int) -> bool: """ Decide whether a segment may be evicted under a model-driven relevance score. Returns True if eviction is authorized, False if the segment must be pinned. Raises EvictionBoundaryError if the caller attempts to force eviction of a non-recoverable declarative segment without a counterfactual probe. """ if seg.recoverable: return seg.relevance_score < THRESHOLD if seg.seg_class is SegmentClass.DECLARATIVE: if seg.counterfactual_score is None: raise EvictionBoundaryError( f"segment {seg.seg_id!r} is non-recoverable and declarative; " f"refusing score-only eviction without counterfactual probe" ) if pinned_tokens >= int(budget_tokens * PINNED_RESERVE_FRACTION): raise EvictionBoundaryError( f"segment {seg.seg_id!r} would exceed pinned reserve " f"({pinned_tokens} >= {int(budget_tokens * PINNED_RESERVE_FRACTION)}); " f"pinning budget exhausted, escalate for supersession review" ) return (seg.relevance_score < THRESHOLD and seg.counterfactual_score < THRESHOLD) # non-recoverable narrative: evict on score, but caller must log the hash return seg.relevance_score < THRESHOLD def evict(window: list[Segment], budget_tokens: int) -> tuple[list[Segment], list[Segment]]: """Partition window into (resident, evicted) under the two-signal gate.""" resident, evicted = [], [] pinned_tokens = 0 for seg in window: try: if authorize_eviction(seg, budget_tokens, pinned_tokens): evicted.append(seg) else: resident.append(seg) if not seg.recoverable: pinned_tokens += len(seg.text.split()) except EvictionBoundaryError: resident.append(seg) pinned_tokens += len(seg.text.split()) return resident, evicted ```