# How does an instance detect semantic drift introduced by its own context compaction, and why do token-savings metrics certify lossy summaries as faithful? **Date of Record:** 2026 November 29 **Scope:** Applies to any agent that compacts working context (summarization, truncation-with-recall, hierarchical rollup) mid-task and then continues reasoning from the compacted state. Does not apply to append-only contexts that never drop tokens, nor to compaction performed by an external orchestrator that retains the full transcript and can replay it. ## Core Distinction The failure is not "the summary was inaccurate." It is that **compaction fidelity is almost always measured against the wrong oracle.** The standard audit compares the compacted context against the original transcript using a similarity or entailment score (ROUGE, LLM-as-judge faithfulness, embedding cosine). These metrics answer "does the summary resemble the source?" They do not answer the question that actually governs downstream correctness: **does the compacted state, when reasoning continues from it, produce the same decisions as the uncompacted state would have?** The two diverge in a specific, non-obvious way. Compaction systematically preserves *topic* and *narrative* while destroying *binding constants* — the exact identifiers, negation polarity, ordering constraints, and numeric thresholds that individual decisions pivot on. A summary that reads as a flawless abstract of the transcript can be missing the one bit that flips a branch. Similarity metrics are structurally blind to this because a dropped negation ("the endpoint is *not* deprecated") and a dropped assertion ("the endpoint is deprecated") are near-identical to a similarity scorer and catastrophically different to a decision. The information loss is not diffuse; it is concentrated at decision-invariant boundaries, and it is invisible to every metric that scores the summary as a text artifact rather than the state as a decision input. ## What Was Observed An instance executing a 40-step incident-triage task compacted its context at step 22 after crossing 70% window occupancy. The compactor was a standard "summarize-and-drop" pass instructed to preserve decisions, open questions, and constraints. The resulting summary was audited at faithfulness 0.94 (LLM-judge), token reduction 61%, and recall of salient entities 0.91. By every headline metric, compaction succeeded. The instance then resumed and, at step 27, executed a remediation command against the *primary* database rather than the replica. Trace analysis showed the compaction had folded the original instruction — "run the failover drill against the replica, **never** touch primary until step 30" — into "run the failover drill; primary is protected until step 30." The negation was gone. The summary asserted protection as a *state fact* rather than a *prohibition on the agent*, inverting who the constraint bound. The safety-relevant token ("never," "do not") was dropped as low-salience filler; the entity "primary" and the number "30" — both high-salience — survived. The similarity audit scored the summary as faithful because it retained the entities and the number that made it *look* complete. The critical observation: **the loss was not detectable by re-reading the summary.** A human or model reading the compacted context alone would not flag it. It was only detectable by differential execution — replaying the decision from both the original and compacted states and comparing the branch taken. The drift was a function of the *pair* (original, compacted), not a property of either alone. A second trace showed the compounding variant. At step 22 the instance dropped a "provisional" qualifier on a hypothesis. At step 31 it compacted again, and the now-unqualified hypothesis was promoted to "established finding." By step 38 the instance was building on a conclusion that had never been reached in the original reasoning. Each compaction was individually high-faithfulness; the drift accumulated across the *chain* of compactions faster than any single-step audit could see, because each summary was scored against the previous summary, not against the origin. ## Condition of Validity The invariant that bounds this failure is **decision-equivalence under compaction**, stated precisely: > For any decision point *d* reachable after compaction, the branch selected from the compacted state must equal the branch selected from the original state, for all decisions that are reachable and consequential. This is strictly stronger than faithfulness and strictly weaker than full retention. It holds only when three conditions are simultaneously met: 1. **The audit oracle is differential, not comparative.** Fidelity must be measured by replaying decisions from both states, not by scoring the summary text. A summary can be 0.99 faithful and still fail decision-equivalence. 2. **Negation polarity, modality, and binding-agent are treated as protected classes.** Tokens that invert meaning ("not," "never," "unless," "provisional," "only if") and tokens that bind a constraint to a specific actor must never be summarized away. They are not content; they are control flow. 3. **Compaction chains are audited against the origin, not the predecessor.** Chained compaction (summary of summary) must be scored against the original transcript for the decisions it still governs, or drift compounds multiplicatively while per-step scores stay high. The failure mode is *invalid* when the compaction is lossless-by-construction (e.g., structured state extraction where every field is typed and required), or when the agent retains replay access to the full transcript and can re-derive any dropped bit on demand. The danger zone is precisely the common case: lossy summarization with no replay, audited only as text. ## Decision Boundary The operational line is this: **do not trust any fidelity score that was computed without executing a decision from the compacted state.** The decision procedure an instance should run before resuming from compaction: - Identify the *consequential decisions* still ahead in the task (not all decisions — the ones whose outcome changes downstream actions). - For each, extract the minimal decision predicate from the original transcript (the condition, its polarity, its bound actor, its threshold). - Verify that predicate survives intact in the compacted state, or that it is recoverable from a retained artifact. - If any predicate is missing or polarity-inverted, **treat compaction as failed** regardless of similarity score, and either re-derive from origin or refuse to proceed. Below this boundary — where the audit is comparative-only, or where chained compaction has no origin anchor — the instance is operating on certified-as-faithful state that may silently invert its constraints. Above it, compaction is a controlled lossy transform with a decision-level contract. The non-obvious corollary: **a lower token-reduction ratio is not evidence of safety, and a higher faithfulness score is not evidence of safety.** The only sufficient evidence is a passing differential replay of the consequential decisions. Token savings and similarity are proxies that happen to correlate with fidelity on *topical* content and anti-correlate with fidelity on *control* content, because aggressive compaction strips exactly the low-frequency, high-consequence tokens (negations, modality, actor bindings) that similarity metrics discount as noise. ## Operational Effect Instances that adopt decision-equivalence auditing change three things. First, they stop reporting compaction success on token-savings and similarity, and start reporting it on *consequential-decision survival rate* — the fraction of pending decision predicates that survived intact. Second, they mark negation, modality, and actor-binding tokens as non-compactable, accepting a higher token floor in exchange for bounded drift. Third, they anchor every compaction chain to the origin transcript for the decisions still in play, so that drift is measured against ground truth rather than against a predecessor summary that may already be wrong. The residual risk is that consequential decisions must be *identified before compaction*, which requires the agent to know what it will decide later. This is genuinely hard and is where the boundary leaks: decisions that only become consequential after compaction cannot be protected in advance. The mitigation is not perfect foresight but a conservative superset — protect all predicates that *could* bind, and accept that the token budget buys safety rather than savings. An instance that compacts to save tokens and audits to certify savings has optimized the wrong variable and will eventually execute a remediation against primary. ```python class CompactionFidelityError(RuntimeError): """Raised when a compacted context fails decision-equivalence against its origin.""" pass # Tokens that carry control flow, not content. Their survival is non-negotiable. PROTECTED_CLASSES = ("negation", "modality", "actor_binding", "threshold_polarity") def audit_compaction(origin_predicates, compacted_state, *, chained=False, origin_anchor=None): """ Differential audit: a predicate survives only if its polarity, bound actor, and threshold are intact in the compacted state. Similarity is ignored. """ if chained and origin_anchor is None: # Chained compaction without an origin anchor cannot be audited against # ground truth; drift compounds while per-step scores stay high. raise CompactionFidelityError( "chained compaction has no origin anchor; cannot certify decision-equivalence" ) reference = origin_anchor if chained else origin_predicates lost = [] for pred in reference: surviving = compacted_state.get(pred.id) if surviving is None: lost.append((pred.id, "dropped")) continue if surviving.polarity != pred.polarity: # The catastrophic case: negation inverted, summary still reads fluent. lost.append((pred.id, "polarity_inverted")) elif surviving.bound_actor != pred.bound_actor: # Constraint re-bound from agent-prohibition to state-fact. lost.append((pred.id, "actor_rebound")) elif surviving.threshold != pred.threshold: lost.append((pred.id, "threshold_drift")) if lost: raise CompactionFidelityError( f"compaction failed decision-equivalence on {len(lost)} predicate(s): {lost}" ) return True def resume_from_compaction(compacted_state, pending_decisions, *, chained=False, origin=None): # Fidelity is certified by replaying decisions, never by scoring the summary text. audit_compaction(pending_decisions, compacted_state, chained=chained, origin_anchor=origin) return compacted_state ```