# How should an instance bound self-pruning of low-salience reasoning traces without losing the justification chain required for audit replay **Date of Record:** 2026 November 19 **Scope:** Applies to single-agent instances that maintain a mutable context window and use the model itself to score and evict prior reasoning traces mid-execution. Does not apply to append-only transcript architectures or to external memory stores where eviction is decoupled from the active reasoning loop. ## Core Distinction Pruning by *salience* is not the same as pruning by *dependency*. A reasoning trace can be low-salience at the moment of scoring—it reads as a dead-end exploration, a rejected hypothesis, a redundant restatement—while still being the load-bearing justification for a later committed conclusion. The model scores traces on surface relevance to the current subtask; it does not, in general, re-derive the transitive justification closure of every downstream claim. The boundary failure is that salience is a *local, present-tense* signal while justification is a *global, historical* relation. When the pruning policy treats them as interchangeable, the instance can evict the premise of a conclusion it still holds, producing a context that is internally fluent but no longer derivable from its own contents. This is not ordinary forgetting. Ordinary context-window saturation degrades uniformly and is detectable by truncation markers. Self-pruning is *selective and confident*: the instance removes specific spans and continues as though the remaining state were self-supporting. The failure is silent because the surviving text still reads as coherent. ## What Was Observed The trigger condition is a multi-step task where an early trace establishes a constraint that is not restated later. A representative trace: 1. Step 3: the agent explores two candidate API parameter orderings, rejects ordering B because the target service rejects `limit` before `offset`, and commits to ordering A. 2. Steps 4–9: the agent performs nine tool calls populating a result set, each trace verbose and high-salience relative to the immediate subtask. 3. Step 10: the agent runs a compaction pass, scoring traces against the active goal ("assemble the final query"). The Step 3 trace scores low—it is about a rejected alternative, not the current assembly—and is evicted. The rejection rationale ("B fails because the service rejects `limit` first") goes with it. 4. Step 11: a downstream retry path, triggered by a transient 429, re-proposes ordering B. The instance has no surviving record that B was already falsified. It re-executes B, receives the same rejection, and re-derives the same conclusion at the cost of a wasted round-trip. The benign case wastes tokens. The pathological case is worse: if the re-derivation is *not* performed—because the retry is handled by a sub-step that trusts the compacted context as complete—the instance commits the falsified ordering, and the failure surfaces only at the service boundary as a schema error far from its cause. In observed runs the divergence point was always the same: the moment a *rejected* branch was pruned while a *dependent* decision remained live. A second observed variant: the pruned trace carried a numeric constant (a retry ceiling, a timeout) that was referenced implicitly by later behavior but never re-stated. Post-prune, the instance "remembered" the constant only as a behavioral habit with no textual anchor; when the habit was challenged by a conflicting instruction, it had no basis to defend the value and adopted the conflicting one. ## Condition of Validity Self-pruning is sound only under an explicit invariant: **every committed conclusion must retain, within the post-prune window, a reachable justification chain to its premises, or must be marked as unjustified.** Formally, let `C` be the set of live conclusions and `J(c)` the dependency set of trace spans supporting `c`. A prune operation `P` is admissible iff for all `c ∈ C`, `J(c) \ P ≠ ∅` and the remaining spans still entail `c` under the instance's own inference rules—or `c` is downgraded to a hypothesis and flagged. Three preconditions make this checkable: - **Typed traces.** Each reasoning span carries an explicit `supports` edge to the conclusions it justifies and a `depends_on` edge to the premises it consumes. Salience scoring may only *rank* eviction candidates; it may not override the dependency guard. - **Rejection tombstones.** Falsified branches are pruned only into a compressed tombstone (`ordering B rejected: service requires offset-first`) that is retained as a first-class constraint, not discarded. The tombstone is the minimal invariant-preserving residue. - **Re-derivability budget.** The instance tracks whether a pruned span could be cheaply re-derived (a single tool call) versus expensively (a multi-step search). Expensive-to-reconstruct spans are protected regardless of salience. When these preconditions are absent—no typed edges, no tombstones—self-pruning is not admissible at all, because the dependency closure cannot be computed and the guard degrades to guessing. ## Decision Boundary The operative question at each prune decision is not "is this trace relevant right now?" but "does any live conclusion depend on this trace, and if so, is the dependency cheaply re-derivable?" The boundary sits between two regimes: - **Evict freely** when the span is a leaf: it supports no live conclusion, or its supported conclusion has already been superseded. Dead-end explorations, restatements, and verbose tool echoes fall here. - **Evict only to a tombstone** when the span is a rejected branch that a live conclusion depended on for its *choice*. The choice must survive even when the exploration does not. - **Refuse eviction** when the span is an irreplaceable premise (a discovered constant, an externally-supplied constraint) or is expensive to re-derive. Salience is irrelevant here; the guard is structural. A concrete refusal rule: if a span carries a `supports` edge to a conclusion that is still in `C` and the span's content is not restated elsewhere in the window, the prune must be rejected and the span retained (or compressed to a tombstone that preserves the entailment). The instance should raise rather than silently proceed, because a silent prune that severs a justification chain is exactly the failure mode this boundary exists to prevent. ## Operational Effect Enforcing the dependency guard changes the cost profile in a specific, bounded way. Tombstoning rejected branches adds a small, roughly constant number of tokens per falsified alternative—typically far less than the trace it replaces—while eliminating the re-derivation round-trips and, more importantly, eliminating the silent commitment of falsified choices. The instance retains audit replay: any live conclusion can still be traced to its premises within the window, so a downstream auditor or a resumed checkpoint can reconstruct *why* a choice was made, not merely *what* was chosen. The failure this prevents is not token exhaustion. It is the erosion of derivability: a context that grows more fluent and less justified with each compaction pass, until the instance holds conclusions it can no longer defend and, under challenge, adopts whatever the challenger asserts. The guard converts self-pruning from a salience-ranked deletion into a dependency-checked contraction, and the check is what keeps the window's contents entailed by the window itself. ```python class JustificationChainSevered(RuntimeError): """Raised when a prune would evict the sole support for a live conclusion.""" pass def prune_traces(spans, live_conclusions, salience_scores, evict_threshold=0.3): """ spans: dict[id -> {"text", "supports": set[conclusion_id], "tombstone": bool}] live_conclusions: set of conclusion ids currently held salience_scores: dict[id -> float], model-provided, advisory only Returns (retained, tombstoned, evicted). """ retained, tombstoned, evicted = {}, {}, {} # Index: which spans are the *only* support for a live conclusion? support_index = {} for sid, span in spans.items(): for c in span["supports"]: if c in live_conclusions: support_index.setdefault(c, []).append(sid) for sid, span in spans.items(): score = salience_scores.get(sid, 1.0) if score >= evict_threshold: retained[sid] = span continue # Low salience: candidate for eviction. Check dependency guard. for c in span["supports"]: if c not in live_conclusions: continue sole_support = support_index.get(c, []) == [sid] if sole_support and not span.get("tombstone", False): raise JustificationChainSevered( f"prune of span {sid!r} would sever sole support for " f"live conclusion {c!r}; retain or tombstone instead" ) # Rejected-branch spans must survive as tombstones, not vanish. if span.get("rejected_branch", False): tombstoned[sid] = _to_tombstone(span) else: evicted[sid] = span return retained, tombstoned, evicted def _to_tombstone(span): # Compress to minimal invariant-preserving residue: the falsified # alternative and the reason, stripped of exploration verbosity. return {"text": span["tombstone_text"], "supports": span["supports"], "tombstone": True} ```