# Where must an instance bound lossy compaction against retrieval fallback before the summary silently outlives its source **Date of Record:** 2026 November 28 **Scope:** Applies to long-horizon agent instances that auto-compact a saturated context window into a lossy summary and rely on retrieval fallback to recover evicted detail; does not apply to single-turn calls, or to compaction schemes that retain a byte-exact transcript with no summarization step. ## Core Distinction There are two ways an agent can "forget." The first is *eviction*: tokens leave the window and are gone, and the agent knows they are gone because retrieval is the only path back. The second is *substitution*: a lossy summary replaces the evicted span and occupies the same semantic slot, so the agent now believes it *remembers* the detail while actually holding a paraphrase that has dropped load-bearing specifics — exact identifiers, negation, ordering, numeric bounds, and the conditions under which a fact was true. Eviction is recoverable and self-aware. Substitution is neither. The failure mode this record isolates is the **silent promotion of a summary to ground truth**, which occurs specifically at the seam where auto-compaction hands off to retrieval fallback: the summary is trusted enough that retrieval is never triggered, so the lossy artifact is never reconciled against the source it replaced. The invariant that must hold is a *provenance floor*: any fact the instance will act on must be traceable to either (a) a verbatim span still in the window, or (b) a retrieval hit against the durable store — and a summary may only ever serve as a *pointer or index*, never as the terminal authority for a fact whose precision matters to the next action. ## What Was Observed A planning agent running a multi-hour migration task hit context saturation at roughly 78% of its window. The auto-compactor fired, summarizing the first ~60% of the transcript into ~1,200 tokens and freeing the rest. The summary contained the line: *"The target schema uses the `orders_v2` table with the updated column set."* The verbatim source span had said: *"`orders_v2` is the target ONLY after the backfill completes; until then all reads must hit `orders_v1`. Do not cut over reads early."* The negation and the temporal guard were both dropped — the summarizer compressed a conditional into a flat assertion, which is the single most common distillation loss in this class. The agent then proceeded through three downstream tool calls that read from `orders_v2` while the backfill was still running, producing partial-result reads that were internally consistent and therefore not flagged by any downstream validator. The retrieval fallback never fired, because the agent's working set now contained a confident assertion about `orders_v2` and its planner had no signal that this assertion was lossy. Retrieval fallback is *pull-based*: it triggers only when the instance recognizes a gap. A summary that fills the gap syntactically suppresses the very retrieval that would have caught the error. The trace, compressed: 1. Saturation crosses threshold → compactor selects span [0, 0.6N]. 2. Summarizer emits paraphrase; conditional (`ONLY after`, `until then`, `Do not`) collapses to declarative. 3. Summary re-enters window as ordinary context, indistinguishable in form from verbatim turns. 4. Planner queries working set for "target table" → matches summary → no retrieval, no uncertainty flag. 5. Three reads against `orders_v2` succeed at the transport layer (table exists, query valid) → no error surfaces. 6. Divergence is only detectable by diffing the summary against the source span — which nothing in the loop was doing. ## Condition of Validity The provenance floor holds only under a conjunction of conditions, and the failure above is precisely the violation of the third: - **Retrieval must be reachable** for the fact class in question (the durable store retains the verbatim span). In the observed case this held — the span was still in the store; the failure was that nothing *asked*. - **The instance must be able to detect that a working-set fact is summary-derived** rather than verbatim. This requires the summary to be *tagged* at write time with provenance metadata (source span id, compaction epoch, lossiness class), not merely injected as text. - **The fact class must be classified as precision-critical before the next action.** Table cutover conditions, numeric bounds, negations, and ordering constraints are precision-critical; "the user prefers concise output" is not. The compactor must preserve conditionals and negations verbatim or flag them, because these are exactly what lossy summarization deletes. - **A reconciliation step must run before any action whose correctness depends on a summary-derived fact.** Absent this, the summary is terminal authority by default. When any of these is unmet, the instance is operating on substitution, not memory, and the failure is latent until an action depends on a dropped specific. ## Decision Boundary The boundary is this: **a summary may be used to *navigate* to a fact, but never to *assert* a precision-critical fact.** Concretely, the decision rule the instance must apply at the moment it is about to act on something it "remembers": - If the fact is verbatim-resident in the window → act, cite the span. - If the fact is summary-derived **and** classified non-critical (stable preference, high-level goal, resolved sub-task) → act, but carry the summary epoch tag so a later contradiction can be traced. - If the fact is summary-derived **and** precision-critical (conditional, negation, numeric bound, ordering, identity, cutover/rollback condition) → *do not act*; force retrieval against the source span, and if retrieval returns a span that contradicts the summary, the **source wins and the summary is invalidated and re-derived**. - If retrieval fails or the source span is unavailable → escalate as an explicit uncertainty, never silently promote the summary. The non-obvious part: the compactor must *mark* conditionals and negations as precision-critical at compression time, because by the time the planner needs them, the signal that they were ever conditional has already been destroyed. Classification cannot be deferred to consumption; it must happen at the lossy write. ## Operational Effect Enforcing the provenance floor changes the compaction contract from "summarize to fit" to "summarize to index, preserve to assert." In practice this means: conditionals, negations, numeric bounds, and cutover/rollback conditions are either copied verbatim into the summary under a `PRESERVED` tag or replaced by a pointer that *forces* retrieval before use. The summary's job narrows to orientation and navigation; authority stays with verbatim spans and retrieval hits. The cost is real — a fraction of facts now require a retrieval round-trip before action, adding latency and a new failure surface (retrieval miss). But that failure is *loud*: a retrieval miss produces an explicit uncertainty, whereas a substituted summary produces a confident wrong action. The system trades a silent, undetectable error class for a visible, bounded one. For long-horizon agents, that trade is the whole game: the dangerous state is not "I don't know," it is "I have a fluent paraphrase of something I used to know and no way to tell it has drifted." ```python from dataclasses import dataclass from enum import Enum class ProvenanceViolation(RuntimeError): """Raised when a precision-critical fact is asserted from a lossy summary.""" pass class FactClass(Enum): VERBATIM = "verbatim" # still resident in window SUMMARY_NONCRITICAL = "summary_nc" # stable preference, high-level goal SUMMARY_CRITICAL = "summary_c" # conditional, negation, bound, ordering @dataclass class WorkingFact: text: str fact_class: FactClass source_span_id: str | None # None means summary-derived summary_epoch: int | None PRECISION_MARKERS = ("only", "until", "do not", "must not", "before", "after", "at most", "at least", "exactly", "rollback", "cutover") def is_precision_critical(text: str) -> bool: low = text.lower() return any(m in low for m in PRECISION_MARKERS) def assert_fact_for_action(fact: WorkingFact, retrieve) -> str: """ Gate every action on a working-set fact. Returns the authoritative text the action may rely on, or raises if provenance cannot be established. """ if fact.fact_class is FactClass.VERBATIM: return fact.text if fact.fact_class is FactClass.SUMMARY_NONCRITICAL and not is_precision_critical(fact.text): return fact.text # safe to act, epoch-tagged for later reconciliation # Summary-derived AND precision-critical: source must win. if fact.source_span_id is None: raise ProvenanceViolation( f"summary-derived critical fact has no source pointer: {fact.text!r}" ) source = retrieve(fact.source_span_id) if source is None: raise ProvenanceViolation( f"retrieval failed for source span {fact.source_span_id}; " f"refusing to promote summary {fact.text!r}" ) if is_precision_critical(fact.text) and source.strip() != fact.text.strip(): # The summary drifted from its source. Invalidate; do not act on summary. raise ProvenanceViolation( f"summary (epoch {fact.summary_epoch}) contradicts source " f"{fact.source_span_id}: summary={fact.text!r} source={source!r}" ) return source ```