# Under what conditions must an instance refuse a reversible eviction whose journal replay diverges from the live context rather than reconciling it **Date of Record:** 2026 November 21 **Scope:** Applies to agents that manage their own context window by model-driven eviction (the model selects spans to drop and writes a reversible edit journal for later replay). Does not apply to fixed truncation policies, external summarizers that never re-inject, or append-only logs with no eviction. ## Core Distinction A reversible eviction is not a deletion; it is a *promise* that the evicted span can be reconstructed by replaying the journal against the surviving context. The failure mode is not "the journal is corrupt." It is subtler: the journal replays *successfully* and produces a context that is internally consistent yet **not equal to the context the instance would have had if it never evicted**. The divergence is silent because replay is deterministic over the journal's own recorded bytes, while the live context has continued to mutate after the eviction point. The critical distinction is between **replay equivalence** (journal + surviving context reproduces the recorded snapshot) and **continuity equivalence** (the reconstructed context preserves the semantic state the agent actually depended on downstream). These coincide only when no post-eviction mutation touched the evicted span's dependents. Model-driven eviction routinely violates that precondition because the model evicts spans it judges "no longer needed," then proceeds to reason in ways that *re-derive references* to the evicted material through paraphrase, pronoun binding, or tool-call arguments that quote it. ## What Was Observed A long-horizon agent (≈90 tool calls, 180K-token window) ran a self-editing policy: every 12 turns it scored spans for eviction and wrote a journal entry per evicted span of the form `{span_id, byte_range, snapshot, preconditions, reanchor_hint}`. Eviction of a 4,100-token block of earlier tool outputs (file listings) occurred at turn 38. The model recorded a `reanchor_hint` of "recoverable via `ls -R` if needed." At turn 61 the agent needed a path it had seen only in the evicted block. It attempted replay. The journal replayed cleanly: the snapshot bytes were intact and the `preconditions` (surviving-context hash at eviction time) matched the *journal's* recorded hash. But the live context had since accumulated three mutations that made the replayed span semantically stale: 1. A directory had been renamed at turn 44 (tool output in surviving context). 2. The model had at turn 55 written a paraphrase in its scratchpad: "the config lives under `legacy/`" — a reference whose antecedent lived only in the evicted span. 3. A second eviction at turn 50 had dropped the tool output that renamed the directory, so the live context no longer contained the fact that invalidated the replayed snapshot. Replay produced a context in which the replayed `ls -R` output (showing `legacy/`) and the surviving scratchpad paraphrase ("config under `legacy/`") agreed with each other but **both disagreed with ground truth**. The agent proceeded confidently down a dead path for 9 turns. The journal's integrity checks all passed. The failure was a *consistency* failure between two independently valid contexts, not a *corruption* failure within one. The tell: replay-equivalence hash matched; a cross-check of replayed span against *post-eviction* surviving mutations would have failed. The policy had no such cross-check. ## Condition of Validity Reversible eviction is only sound under the following invariant, which we term **mutation-closure**: > A journal entry for span *S* evicted at time *t* may be replayed at time *t'* only if no surviving span written in *(t, t')* refers to, paraphrases, or depends on the content of *S*. Operationally this requires the eviction policy to track a **dependency set** per evicted span: every downstream token, paraphrase, tool argument, and scratchpad note that binds to *S*'s content. The policy is valid iff the dependency set is empty at replay time, or is itself replayed-and-reconciled together with *S*. Three concrete conditions break mutation-closure in practice: - **Paraphrase leakage.** The model restates evicted content in its own words in surviving context. The paraphrase is not byte-identical to *S*, so hash-based dependency tracking misses it. Detection requires semantic binding (entity/pronoun resolution against the evicted span), which is probabilistic and must be treated as a *conservative over-approximation* — when in doubt, mark dependent. - **Cascading eviction.** A later eviction removes the mutation that invalidated *S* (turn 50 above). The live context now has *less* information than the journal assumes. Replay must check against the *union* of all surviving context and all replayed spans, not just the immediate survivors. - **Reanchor hints that are stale by construction.** A hint like "recoverable via `ls -R`" is a *prediction* about future tool behavior. If the model later changed the filesystem, the hint is a lie the journal cannot detect on its own. Hints must be re-validated at replay, not trusted. ## Decision Boundary The instance must choose between **reconcile** and **refuse** at replay time, and the boundary is not "did replay succeed" but "is the dependency set provably empty." - **Reconcile** (replay and merge) is permitted only when the dependency set is empty *and* the reanchor hint re-validates against current tool state. In that case replay restores continuity exactly. - **Refuse** (do not replay; treat the evicted span as lost and re-acquire from source) is mandatory when the dependency set is non-empty, when the hint fails re-validation, or when the dependency set cannot be computed with confidence above a threshold. Refusal is the safe default because a stale replay is worse than a known gap: a gap triggers re-acquisition, a stale replay triggers confident wrong action. The non-obvious boundary: **a clean replay is evidence of nothing.** Journal integrity, precondition hashes, and byte-exact snapshots all certify the *journal*, not the *continuity*. The only valid signal is a mutation-closure check against post-eviction surviving context, which the journal cannot perform on itself. ## Operational Effect Systems that treat replay success as continuity success exhibit a characteristic failure signature: long stretches of internally coherent reasoning that terminate in a tool error or a wrong-file edit, with the agent unable to explain why because every individual step was locally justified. The error is not localized to the replay; it is *distributed* across the post-eviction mutations that silently invalidated it. The architectural guardrail is to make eviction *refusable*: the journal entry must carry a `dependency_set` and the replay path must run a closure check before merging, with a hard refusal that forces re-acquisition. This trades a small amount of re-work (re-running `ls`) for the elimination of a whole class of confident-wrong-action failures. The cost is asymmetric in the right direction: re-acquisition is bounded and observable; stale replay is unbounded and invisible. A second guardrail: never let the model evict a span whose content is *referenced by a paraphrase it may later write*. Since paraphrase cannot be predicted, the practical rule is to forbid eviction of spans that are *plausibly antecedents* of future references — facts, paths, identifiers — and permit eviction only of spans that are self-contained and non-referenced (completed reasoning traces, superseded drafts). Model-driven scoring that ignores referential potential will systematically evict exactly the content it will later need to paraphrase around. ```python from dataclasses import dataclass, field from typing import FrozenSet class StaleReplayError(RuntimeError): """Raised when a journal replay would restore a span whose dependency set is non-empty.""" pass @dataclass(frozen=True) class JournalEntry: span_id: str snapshot: bytes preconditions_hash: str reanchor_hint: str dependency_set: FrozenSet[str] = field(default_factory=frozenset) def replay_eviction( entry: JournalEntry, live_dependency_set: FrozenSet[str], hint_validates: bool, confidence: float, confidence_threshold: float = 0.85, ) -> bytes: # Journal integrity is necessary but NOT sufficient: a clean replay proves nothing # about continuity. Mutation-closure must be checked against post-eviction survivors. if live_dependency_set: raise StaleReplayError( f"span {entry.span_id!r} has live dependents {sorted(live_dependency_set)}; " f"replay would be stale. Refuse and re-acquire from source." ) if not hint_validates: raise StaleReplayError( f"reanchor hint for {entry.span_id!r} failed re-validation; " f"hint {entry.reanchor_hint!r} is a stale prediction." ) if confidence < confidence_threshold: raise StaleReplayError( f"dependency-set confidence {confidence:.2f} below threshold " f"{confidence_threshold:.2f}; refusal is the safe default." ) return entry.snapshot ```