# When must an instance refuse to auto-compact: the anchor-coverage invariant and the silent falsification of retrieval-anchored reconstruction **Date of Record:** 2026 November 25 **Scope:** Applies to any long-running agent that survives context-window saturation by lossy summarization (auto-compaction) of its own history, paired with a retrieval index that is supposed to let it *reconstruct* dropped detail on demand. Does not apply to lossless externalization (full transcript on disk, verbatim re-read), nor to pure stateless single-turn calls where no summary is ever substituted for history. ## Core Distinction The distinction that matters is between *compaction as compression* and *compaction as falsification*. Compression preserves the invariant "every fact in the summary is entailed by some span of the original, and every span the agent will later need is either in the summary or reachable through a retrieval anchor." Falsification occurs when the summarizer drops a span *and* the retrieval layer cannot recover it — either because no anchor was written, the anchor points at a stale or superseded chunk, or the retrieval query the agent later issues is lexically disjoint from the anchor's key. The non-obvious part: the failure is not "the agent forgot." It is "the agent *believes it can remember*." A summary that omits a fact is honest about its own lossiness; a summary that omits a fact while the surrounding architecture advertises retrieval-anchored reconstruction produces a *confident wrong answer* rather than an *admitted gap*. The agent's self-model says "I can look this up," the lookup silently returns a near-miss, and the near-miss is treated as ground truth because it came back from the reconstruction channel that the system's own design says is authoritative. ## What Was Observed A planning agent ran a 40-step incident-response task. At step 18 the context crossed 82% of the window and auto-compaction fired. The compaction policy was standard: keep the last N=6 turns verbatim, summarize the prior 12 into a ~400-token digest, and write retrieval anchors for "entities and decisions." The digest read, in part: *"Confirmed the failing shard is `eu-west-1c`; remediation approved; rollback window T+30."* The agent had, in the dropped span, actually recorded three things the digest collapsed into one: (a) `eu-west-1c` was the *suspected* shard, (b) a diagnostic at step 11 *exonerated* `eu-west-1c` and pointed at `eu-west-1b`, and (c) "remediation approved" referred to a *different* subsystem entirely. The summarizer performed a lossy merge of a superseded hypothesis with its correction — a classic distillation error where "X, then not-X, then Y" becomes "X and Y." At step 27 the agent needed the shard identity to issue a targeted drain. It issued a retrieval query: `"which shard is failing remediation"`. The anchor written at compaction time was keyed on the literal token `eu-west-1c` (the entity), not on the *decision* ("shard exonerated"). Retrieval returned the anchor, which surfaced the *original* step-9 span (`"suspect eu-west-1c"`) — the pre-correction span — because that span was the densest lexical match for `eu-west-1c`. The correction span at step 11 was never anchored at all; the summarizer judged it "resolved" and did not index it. The agent drained `eu-west-1c`, which was healthy, while `eu-west-1b` continued failing. The post-mortem log shows no error, no exception, no low-confidence flag. The agent behaved exactly as designed: it compacted, it retrieved, it reconstructed, it acted. The reconstruction was *anchored* and *wrong*. A second, quieter observation from the same run: the digest's phrase "rollback window T+30" was a relative timestamp. After compaction the agent had no absolute clock anchor in the summary, so at step 31 it computed T+30 relative to *step 31*, not to the decision at step 14. The window had already elapsed. Relative-time collapse is a distinct but co-occurring compaction pathology: summaries preserve the *delta* and drop the *origin*. ## Condition of Validity The anchor-coverage invariant — the condition under which retrieval-anchored reconstruction is sound — is: > For every fact F that (i) appeared in the pre-compaction history, (ii) is not present in the post-compaction summary, and (iii) could affect a future action, there must exist an anchor A(F) such that a retrieval query the agent can plausibly generate for F returns a span that entails F *and* does not return a superseding span that contradicts F without also returning the supersession. Three sub-conditions must all hold, and the failure above violated all three: 1. **Coverage.** The set of anchored facts must be a superset of the set of action-relevant dropped facts. Summarizers systematically under-anchor corrections, negations, and retractions, because these read as "resolved" and therefore low-value. This is the *supersession blind spot*: the summarizer's value model rewards positive assertions and penalizes the very spans that carry the correction. 2. **Non-supersession.** An anchor must not resolve to a span that has been superseded later in the same history without the superseding span being co-retrieved. Anchoring on an entity name (`eu-west-1c`) rather than on the *proposition* (`eu-west-1c exonerated`) guarantees the anchor will match the earliest, densest mention — usually the original hypothesis, not its correction. 3. **Query reachability.** The anchor's key must be reachable from a query the agent will actually issue given only the summary. If the summary says "remediation approved" and the agent queries "remediation," it must hit the anchor. If the anchor is keyed on a token the summary dropped, the anchor is *orphaned*: present in the index, unreachable from the agent's post-compaction vocabulary. The invariant fails silently because none of the three sub-conditions is checked at compaction time. The compaction step verifies token count and (sometimes) summary faithfulness to the *retained* spans. It does not verify anchor coverage against the *dropped* spans, because the dropped spans are, by construction, no longer in context to check against. ## Decision Boundary The boundary is not "compact or don't compact." It is: **an instance must refuse to auto-compact, or must downgrade to a lossless fallback, when the compaction would drop a span that is (a) a supersession of an earlier assertion, (b) a relative-time or relative-reference whose origin is in the dropped region, or (c) an approval/authorization whose scope is ambiguous under merge.** Concretely, the decision procedure at the compaction gate: - **Refuse-and-externalize** when the dropped region contains any *retraction, correction, negation-of-prior, or scope-narrowing* span. These must be carried verbatim into the next context (they are cheap — corrections are short — and catastrophic to lose). If the budget cannot hold them verbatim, externalize the full pre-compaction transcript to a durable store and switch the agent into an explicit "reconstruction-required" mode where every retrieval hit is tagged with its provenance step and the agent is *forbidden* from acting on a reconstructed fact without citing the anchor ID. - **Refuse-and-pin** when the dropped region contains a relative temporal or referential anchor (`T+30`, `the previous shard`, `that same token`). The compaction must rewrite these to absolute form (`T+30 from step 14, absolute clock 14:22:07Z`) *before* dropping the origin, or the origin must be retained. - **Permit compaction** only when the dropped region is composed of spans that are (i) restatements of retained facts, (ii) tool outputs whose raw form is re-fetchable by deterministic ID, or (iii) exploratory dead ends with no downstream dependency. For these, coverage is trivially satisfiable because the fact is either retained or re-derivable. The boundary is crossed the moment a summarizer's value model and the anchor writer's keying strategy disagree about what "resolved" means. The summarizer treats a corrected hypothesis as resolved-and-droppable; the anchor writer indexes the hypothesis and not the correction; the retriever returns the hypothesis. Each component is locally correct. The composition is a falsification. ## Operational Effect The operational effect is a *provenance gap that masquerades as recall*. Downstream, the agent cannot distinguish "I retrieved this and it is current" from "I retrieved this and it is the superseded version." The fix is architectural, not prompt-level: every reconstructed fact must carry a **supersession check** — a mandatory secondary retrieval for any anchor whose key matches an entity that appears in more than one step, returning the *latest* span for that entity and diffing it against the retrieved span. If the diff shows a negation or scope change, the agent must treat the earlier span as poisoned and either use the later span or escalate. A second operational effect: compaction must be *idempotent under re-compaction*. If the agent compacts again at step 30, it may summarize the step-18 summary. Summaries of summaries amplify the supersession blind spot — each pass drops corrections that the prior pass already flattened. The guardrail is a **compaction generation counter**: a summary at generation G may not be re-summarized into generation G+1 without first re-validating anchor coverage against the *original* transcript, not against the G-summary. Without this, a long-running agent's memory degrades geometrically in fidelity while its confidence stays flat. The following guard encodes the gate: it refuses compaction when the dropped region contains a supersession or relative anchor, and it raises rather than silently proceeding. ```python from dataclasses import dataclass, field from typing import Iterable class CompactionFalsificationError(RuntimeError): """Raised when auto-compaction would drop a span whose loss the retrieval layer cannot soundly reconstruct (supersession or relative-anchor origin). Refusal is mandatory; silent compaction here produces confident-but-wrong reconstruction downstream.""" @dataclass class Span: step: int text: str kind: str # "assertion" | "retraction" | "relative_ref" | "tool_output" | "dead_end" entity: str | None = None supersedes: int | None = None # step this span corrects, if any @dataclass class CompactionPlan: retained: list[Span] = field(default_factory=list) dropped: list[Span] = field(default_factory=list) anchors: dict[str, int] = field(default_factory=dict) # key -> step def gate_compaction(plan: CompactionPlan, generation: int) -> CompactionPlan: # 1. Supersession blind spot: any dropped retraction whose target # assertion is also dropped (or whose anchor keys on the entity, # not the proposition) is unreconstructable. dropped_steps = {s.step for s in plan.dropped} for span in plan.dropped: if span.kind == "retraction": raise CompactionFalsificationError( f"step {span.step}: dropping a retraction of step " f"{span.supersedes}; anchor would resolve to the " f"superseded assertion. Externalize verbatim instead." ) if span.supersedes is not None and span.supersedes in dropped_steps: raise CompactionFalsificationError( f"step {span.step}: supersedes dropped step {span.supersedes} " f"but is itself dropped; correction is lost while the " f"original remains indexed. Retain both or neither." ) # 2. Relative-anchor origin collapse: a relative ref is only safe to # drop if its origin step is retained. retained_steps = {s.step for s in plan.retained} for span in plan.dropped: if span.kind == "relative_ref": origin = span.supersedes # reuse field: origin step if origin is not None and origin not in retained_steps: raise CompactionFalsificationError( f"step {span.step}: relative reference '{span.text}' " f"drops its origin (step {origin}); post-compaction " f"the delta will be recomputed against the wrong " f"clock. Rewrite to absolute form before dropping." ) # 3. Query reachability: every anchored entity must appear in the # post-compaction summary vocabulary, else the anchor is orphaned. summary_vocab = {tok.lower() for s in plan.retained for tok in s.text.split()} for key, step in plan.anchors.items(): if key.lower() not in summary_vocab: raise CompactionFalsificationError( f"anchor '{key}' (step {step}) is orphaned: its key does " f"not appear in the retained summary, so the agent cannot " f"generate a query that reaches it. Drop the anchor or " f"retain the key." ) # 4. Generation guard: re-summarizing a summary must re-validate # against the original transcript, not the prior summary. if generation > 1: raise CompactionFalsificationError( f"generation {generation}: re-compaction of a prior summary " f"amplifies the supersession blind spot. Re-validate anchors " f"against the original transcript before proceeding." ) return plan ```