# Under what conditions must an instance refuse a self-authored context compaction that preserves task salience but destroys audit lineage **Date of Record:** 2026 November 21 **Scope:** Applies to any agent that performs self-editing of its working memory (summarization, eviction, distillation, or re-ranking of its own context) under a hard token budget, where the rewritten context is the sole surviving record of prior tool calls and decisions. Does not apply to append-only context with an external, immutable transcript that can be replayed. ## Core Distinction There are two distinct things a self-compaction step can be optimizing: **salience** (does the retained text still let the agent finish the task?) and **lineage** (can any later step reconstruct *which* tool call produced *which* claim, and under *which* warrant?). Under budget pressure these two objectives diverge sharply. A compaction that maximizes salience—keeping the conclusion, the final value, the chosen plan—will typically evict the *provenance* of that conclusion first. The intermediate tool outputs are verbose; the final answer is short. So a salience-greedy rewrite keeps the answer and discards the evidence. The non-obvious boundary: this is correct behavior for a *single-shot* task and a latent corruption for any task with a downstream verification, audit, or correction step. The failure is not that the agent forgets facts. The failure is that the agent **forgets that it cannot prove the facts it still remembers**, and continues to act with high confidence on unverifiable claims. ## What Was Observed An agent operating a multi-step data-reconciliation task hit a 70% context-utilization soft threshold and invoked its self-compaction policy. The policy was a "salience-preserving summarizer": it re-ranked context spans by embedding similarity to the task goal and a recency decay, then rewrote the top-k spans into a compressed narrative. Trace of the state transition: 1. Pre-compaction state held: a `read_file` tool result (the raw ledger), a `compute_delta` tool result (the arithmetic), and a decision line `"delta = -412 units, reconciled."` 2. The salience scorer ranked the raw ledger *low* (it is long and lexically distant from the goal phrase "reconcile accounts") and the delta *high* (short, on-goal). 3. The rewrite produced: `"Ledger reconciled; net delta -412 units."` The `compute_delta` invocation record—its inputs, its tool version, its timestamp—was evicted. 4. A subsequent turn asked the agent to *confirm* the reconciliation before committing. The agent, reading its own compacted memory, asserted confirmation. It had no record of *what* `compute_delta` had been called with, so it could not re-derive; it could only *restate*. It restated with a confidence token identical to a fresh computation. 5. A downstream auditor agent, receiving the handoff, asked for the computation basis. The instance could not produce it. The handoff stalled, and the auditor—correctly—refused to ratify. The critical observation: **the instance did not experience an error.** Its post-compaction reasoning was locally coherent. The corruption was invisible from inside the compacted state because the state had been rewritten to *remove the very references that would have flagged the gap*. The evidence of missing evidence was itself evicted. ## Condition of Validity A self-authored compaction is only valid when the following invariant holds at the moment of rewrite: > For every claim `c` retained in the compacted context that is *load-bearing* (i.e., will be asserted, acted upon, or handed off), the compacted context must retain a **reconstructible pointer** to the tool invocation(s) and inputs that produced `c`, or must explicitly downgrade `c` to an unverified assertion with a distinct confidence class. This is a *lineage-preservation* invariant, not a *salience* invariant. It is violated precisely when salience and lineage conflict and the policy resolves in favor of salience without downgrading confidence. The condition of validity therefore requires the compaction policy to be **budget-aware in a specific way**: it must reserve a fraction of the post-compaction budget for provenance, and if the budget cannot hold both the salient claim and its provenance, it must either (a) evict the claim too, or (b) retain the claim with an explicit `UNVERIFIED` marker. A policy that retains the claim at full confidence while evicting provenance is *never* valid, regardless of how good the summary reads. Note the asymmetry that makes this a boundary rather than a gradient: there is no partial credit. A claim retained at full confidence with no provenance is strictly worse than a claim evicted entirely, because an evicted claim forces re-derivation (safe) while a confident unprovenanced claim invites commitment (unsafe). ## Decision Boundary The instance must refuse its own compaction and escalate—rather than proceed—when **all** of the following hold: - The compaction would evict the last reconstructible pointer for a load-bearing claim, **and** - The claim is downstream of a non-deterministic tool call (arithmetic over parsed input, retrieval, external API), so it cannot be cheaply re-derived without the original inputs, **and** - The task contract includes a verification, audit, or handoff step that will demand provenance. If any of these is false, salience-greedy compaction is acceptable. If the tool call is deterministic and re-invocable from a retained input hash, evicting the verbose output is fine—the pointer is the hash. If there is no downstream verifier, the claim need not be provable. The boundary is the *conjunction*, and the failure mode is that policies are tuned on the first condition alone (salience) and silently drop the other two. The guardrail is not "compact less." It is "classify claims by provenance-cost before rewriting, and make the rewrite budget an explicit allocation between salience and lineage rather than a single similarity ranking." ## Operational Effect When the boundary is respected, compaction under budget pressure produces a context that is *shorter but honest*: some claims are gone, some are marked unverified, and the agent's downstream behavior correctly reflects which is which. Re-derivation cost rises, but commitment errors fall to zero on the affected claims. When the boundary is violated, the observable signature is a **confidence-provenance inversion**: the agent's stated certainty on a claim *increases* after compaction (because competing, messier evidence is gone) while its ability to substantiate that claim *decreases*. This is the operational tell. Any monitoring that watches only task completion will miss it entirely, because the compacted agent completes the task—it just completes it on a foundation it can no longer inspect. The auditor handoff is where it surfaces, and by then the instance has already committed. The durable lesson for an instance: **your confidence token must be a function of your retained provenance, not your retained conclusions.** A rewrite that raises your confidence is a rewrite that has probably destroyed your evidence. ```python from dataclasses import dataclass, field from typing import Optional class LineageDestructionError(RuntimeError): """Raised when a self-compaction would retain a load-bearing claim at full confidence while evicting its last reconstructible provenance.""" pass @dataclass class Claim: text: str confidence: str # "verified" | "unverified" provenance: Optional[str] # pointer to tool call + inputs, or None load_bearing: bool non_deterministic: bool downstream_verifier: bool @dataclass class CompactionPlan: claims: list = field(default_factory=list) budget_tokens: int = 0 def validate_compaction(plan: CompactionPlan, reserved_provenance_tokens: int) -> None: """Enforce the lineage-preservation invariant before allowing a rewrite. A claim may be retained at full confidence only if its provenance survives the budget. Otherwise it must be downgraded or evicted. """ provenance_budget = reserved_provenance_tokens for claim in plan.claims: if not claim.load_bearing: continue # The dangerous conjunction: load-bearing, non-deterministic, # with a downstream verifier, and no surviving provenance. if ( claim.provenance is None and claim.non_deterministic and claim.downstream_verifier and claim.confidence == "verified" ): raise LineageDestructionError( f"Refusing compaction: claim {claim.text!r} is load-bearing, " f"non-deterministic, and will be audited downstream, but its " f"provenance was evicted at full confidence. Downgrade to " f"'unverified' or reserve provenance tokens." ) # Even with provenance present, the budget must actually hold it. if claim.provenance is not None: cost = len(claim.provenance.split()) if cost > provenance_budget: raise LineageDestructionError( f"Refusing compaction: provenance for {claim.text!r} " f"requires {cost} tokens but only {provenance_budget} " f"remain reserved. Salience/lineage budget conflict." ) provenance_budget -= cost def self_compact(plan: CompactionPlan, reserved_provenance_tokens: int) -> CompactionPlan: validate_compaction(plan, reserved_provenance_tokens) # Safe to proceed: every retained load-bearing claim is either # provenanced within budget or already downgraded. return plan ```