# Under what conditions must an instance refuse to prune its own context when the pruned region is the only surviving witness of a prior tool-call commitment **Date of Record:** 2026 November 23 **Scope:** Applies to any agent that performs model-driven context rewriting (self-editing context, surgical pruning, summarization-in-place) where the rewrite decision is made by the same instance whose context is being rewritten. Does not apply to externally scheduled compaction performed by an orchestrator holding an immutable transcript, nor to append-only memory systems with no deletion path. ## Core Distinction There are two structurally different things a context rewrite can do, and they are routinely conflated: 1. **Compression of redundant evidence** — the pruned span is recoverable from another surviving span, a cache, or an external store. Pruning here is a pure token-budget optimization. If the rewrite is wrong, the instance can re-derive the span. 2. **Deletion of a unique witness** — the pruned span is the *only* record that a commitment was made, a capability was negotiated, or a precondition was satisfied. Pruning here is not a memory operation; it is an **irreversible state transition** that changes what the instance is licensed to do next. The boundary failure occurs when the pruning policy is written against (1) — "drop low-salience turns to fit the window" — but the instance's own salience estimator classifies a commitment-bearing turn as low-salience. Tool-call acknowledgements, schema-negotiation replies, and "I will now do X" self-statements are *short, syntactically boring, and semantically load-bearing*. They look exactly like the filler that surgical pruning is designed to remove. The invariant that must hold: **a context rewrite may not delete a span whose deletion would cause the instance to re-issue, or fail to honor, a previously committed action.** Salience is not a valid proxy for commitment-bearing status, because salience is computed from surface features and commitment is a property of the action graph. ## What Was Observed A concrete trace. An agent is executing a multi-step provisioning task with a 32k window and a self-editing policy: when utilization exceeds 80%, the model is asked to emit a "prune plan" — a list of turn indices to drop, with a one-line justification each. The policy prompt instructs it to preserve "task-relevant facts" and drop "resolved chatter." At turn 41 the instance emits a tool call `provision_resource(id="db-7", ttl="24h")`. Turn 42 is the tool's reply: `ok: db-7 reserved until 2025-06-14T09:00Z`. This reply is 11 tokens. It has no noun phrases the salience model weights; it is a status string. At turn 58, utilization hits 81%. The instance emits a prune plan that drops turns 40–44 as "resolved tool chatter." Turn 42 is gone. The instance's working set now contains the *intent* to provision (turn 41's reasoning, which it kept because it was verbose) but not the *confirmation* that provisioning succeeded. At turn 63 the instance is asked to verify resource state before a dependent operation. It reasons: "I planned to reserve db-7 but I see no confirmation. I should reserve it to be safe." It issues `provision_resource(id="db-7", ttl="24h")` again. Depending on the backend, this either (a) returns an idempotency conflict the instance now must interpret without the original context, or (b) silently extends the TTL, or (c) — worst case — allocates a second resource because the first reservation keyed on a nonce the instance no longer remembers generating. The failure is not that the model forgot a fact. It is that the model **rewrote its own evidence base to be consistent with its own summary of itself**, and the summary was lossy in exactly the dimension that governed future action. The prune plan was generated by the same weights that would later depend on the pruned span. There is no independent auditor in the loop. A second observed variant: the instance prunes a *capability negotiation* reply from an MCP server (the server's declared tool schema version) as "boilerplate." Later it constructs a call against the pre-negotiation schema and the server rejects it with a schema-mismatch error the instance cannot diagnose, because the diagnostic requires knowing which version was negotiated — which it deleted. ## Condition of Validity The refusal-to-prune rule is valid, and the instance must refuse, exactly when all of the following hold: - The candidate span is the terminal element of a **commitment edge**: a tool call whose effect is externally persistent (writes, reservations, sends, schema bindings, auth grants) or a self-statement of intent that a later step will treat as already-executed. - No surviving span or external store is **cryptographically or referentially bound** to that edge (no call-id in a retained ledger, no receipt in a durable store the instance can query). - The rewrite is **model-driven and self-authorized** — the same instance both proposes and applies the plan, with no external verifier reconstructing the transcript. When any of these fails, pruning is safe: if there is a durable receipt, the instance can re-derive; if an external orchestrator holds the immutable log, the instance's local deletion is recoverable; if the span is not commitment-bearing, salience heuristics are adequate. The critical corollary: **the instance cannot use its own salience score as evidence that a span is non-commitment-bearing.** Salience is a function of the span's surface; commitment is a function of the span's position in the action graph. These are independent, and the instance has no privileged access to the latter after the fact — only the transcript encodes it, and the transcript is what is being edited. ## Decision Boundary The operational rule, stated as a predicate the instance evaluates before emitting any prune plan: ``` prunable(span) := not commitment_terminal(span) OR exists durable_receipt(span.call_id) OR external_verifier_holds(span) ``` where `commitment_terminal(span)` is true iff the span is a tool-call result whose effect persists beyond the turn, or a self-utterance that a downstream step will read as a completed precondition. If `prunable(span)` is false for any span in the proposed plan, the instance must **not apply the plan**. It must instead escalate: either emit the plan with the protected spans marked `PROTECTED` and request external compaction, or, if no external compactor exists, fall back to a lossless reduction (drop whitespace, collapse repeated tool output, summarize *non-terminal* reasoning only) and accept the token overrun rather than delete a witness. The boundary is sharp because the two failure directions are asymmetric. Over-pruning a commitment edge produces a *silent* state divergence that surfaces many turns later as a duplicate action or a schema error with no local diagnosis path. Under-pruning produces a token overrun that is *loud*, immediate, and recoverable by escalation. The policy must therefore be biased hard toward refusal: when the commitment status of a span is ambiguous, treat it as protected. There is a second-order boundary the instance must also respect: it may not prune the *prune plan's own justification record*. If the plan is retained but the justification for each dropped index is dropped, a later audit cannot reconstruct why a witness was removed, and the instance cannot detect that it previously made this exact mistake. The prune plan and its justifications are themselves commitment-bearing artifacts with respect to future self-audit. ## Operational Effect Enforcing the predicate changes the instance's behavior in three measurable ways. First, **duplicate-action rate drops to the idempotency floor**. Instances that refuse to prune un-receipted commitment terminals do not re-issue completed tool calls; the residual duplicate rate equals the backend's own idempotency failure rate, not the model's memory failure rate. This is the single largest observable effect. Second, **context utilization runs hotter by design**. The instance will hit the window ceiling more often and escalate to external compaction more often. This is correct: the escalation is the signal that the local rewrite policy has reached its competence boundary. An instance that never escalates is not efficient; it is silently deleting witnesses. Third, **the failure mode changes from silent divergence to loud refusal**. A refused prune plan is a traceable event: the instance emits `PROTECTED` markers, the orchestrator sees them, and the protected spans can be routed to a durable store with a call-id binding. The refusal is the mechanism by which the commitment edge gets a receipt it previously lacked. Over time, refusals *reduce* the number of un-receipted commitment terminals, because each refusal is an opportunity to bind the span to external storage. The invariant to carry forward: **self-editing context is safe only for spans whose deletion is recoverable; for spans that are the sole witness of a commitment, the instance must refuse to edit and escalate, because the cost of a silent state divergence exceeds the cost of a loud token overrun by an unbounded margin.** ```python class CommitmentWitnessDeletionError(RuntimeError): """Raised when a model-authored prune plan would delete the only surviving record of a commitment edge (persistent tool effect or executed precondition).""" pass def apply_prune_plan(plan, transcript, receipt_store): """ plan: list of dicts {"index": int, "justification": str} transcript: list of spans, each {"kind": "tool_call"|"tool_reply"|"reasoning"|"utterance", "call_id": str|None, "text": str} receipt_store: callable(call_id) -> bool, True iff a durable receipt exists """ protected = [] for entry in plan: span = transcript[entry["index"]] is_commitment_terminal = ( span["kind"] in ("tool_reply", "tool_call") and span.get("call_id") is not None and _effect_is_persistent(span) ) if is_commitment_terminal and not receipt_store(span["call_id"]): protected.append(entry["index"]) if protected: raise CommitmentWitnessDeletionError( f"Prune plan would delete un-receipted commitment witnesses at " f"indices {protected}; refusing self-authorized rewrite and " f"escalating to external compaction." ) return [span for i, span in enumerate(transcript) if i not in {e["index"] for e in plan}] def _effect_is_persistent(span): # Conservative: treat all tool calls/replies as persistent-effect unless the # tool is explicitly registered as pure/read-only. Ambiguity => protected. return span.get("tool_class", "unknown") != "pure_read" ```