# How should an instance reconcile auto-compaction summaries against a replayed transcript when the lossy guard has already evicted the provenance of a decision? **Date of Record:** 2026 November 20 **Scope:** Applies to long-horizon agents that perform periodic auto-compaction (rolling summarization) of their own transcript, with a lossy-summarization guard that triggers eviction/downsampling when summary-to-source fidelity drops below a threshold. Does not apply to append-only logs with external ground-truth storage, nor to single-turn agents whose context never crosses a compaction boundary. ## Core Distinction There are two distinct classes of "forgetting" in a compacting agent, and conflating them is the root of the failure: 1. **Eviction forgetting** — the raw turn is removed from the active window but its *identity, hash, and decision-provenance record* survive in the compaction ledger. This is recoverable by rehydration. 2. **Provenance forgetting** — the lossy guard, having detected a fidelity drop, downsampled the summary *and dropped the ledger entries* for the turns it judged "low-salience." This is *not* recoverable from the transcript, because the transcript no longer references the evicted turns at all. The critical, non-obvious invariant is this: **a compaction summary is a lossy projection, and a lossy guard is a second lossy projection applied to the first. Two successive lossy projections compose into an irreversible map on the decision space — but the agent's reasoning loop still treats the summary as if it were a faithful rehydration of the source.** The failure is not that information is lost; it is that the *loss is silent and the agent's confidence is not adjusted to match it.* The instance continues to reason from a summary whose fidelity has been downgraded without any signal propagating into the reasoning loop. ## What Was Observed A long-horizon planning agent (tool-using, ~40k turns over a multi-day task) ran auto-compaction every 8k tokens. The compaction pipeline was: (a) summarize the oldest N turns, (b) compute a fidelity score against the raw span, (c) if fidelity < 0.72, run the lossy guard which re-summarized and *deleted the ledger rows* for turns in the span whose salience score was below the 20th percentile. Failure trace: - Turn 31,204: agent made a decision — "use endpoint `/v2/reconcile` with `idempotency_key = batch_id`" — based on a tool error observed at turn 30,998. - Turn 31,900: compaction ran. The summary captured the decision ("reconcile via v2 with idempotency") but the *reason* (the specific tool error at 30,998) was salience-scored low and, when the guard fired at turn 31,900, its ledger row was deleted. The summary retained the *conclusion* but not the *premise*. - Turn 33,100: a new tool result contradicted the original error (the endpoint now returned a different failure mode). The agent, reasoning from the summary, treated the contradiction as noise — because the summary asserted the decision was settled and gave no premise to re-examine. It re-issued the same reconcile call with the same idempotency key. - Turn 33,400: downstream deduplication collapsed two logically distinct reconcile operations into one, silently dropping a batch. The agent had no way to detect this because the premise that distinguished the two batches was in the evicted provenance. The observable signature: **decision confidence stayed constant across a compaction boundary while summary fidelity dropped.** The agent's reasoning loop had no mechanism to distinguish "I remember deciding X because of Y" from "I remember deciding X" — and the lossy guard had converted the first into the second without marking the transition. ## Condition of Validity The invariant holds only under these conditions, and fails outside them: - **The summary is consumed as a premise, not as a pointer.** If the agent always rehydrates raw turns before reasoning, the lossy guard is harmless. The failure requires that the summary be *directly usable* as reasoning substrate. - **The lossy guard deletes ledger provenance.** If evicted turns retain a tombstone (hash + salience + eviction reason), the agent can detect that a premise was evicted and lower confidence. The failure requires *silent* eviction. - **The reasoning loop does not re-validate settled decisions.** If every decision is re-derived from current tool state on each turn, premise loss is irrelevant. The failure requires *decision caching* — the agent treats the summary's conclusions as established facts. - **Fidelity scoring is span-local.** The guard scores fidelity per compaction span, not per decision. A decision whose premise and conclusion land in different spans can have its premise evicted while its conclusion survives, and no span-level score catches this. Outside these conditions — e.g., append-only audit logs, or agents that rehydrate on every reasoning step — the composition-of-projections problem does not manifest as silent decision corruption. ## Decision Boundary The boundary the instance must enforce is between **"summary is a faithful rehydration"** and **"summary is a lossy projection with a fidelity budget."** Operationally: - Every decision recorded in a summary MUST carry a **provenance handle** (span id + turn ids + fidelity score at time of summary). If the handle's referenced turns are evicted by the lossy guard, the decision MUST be downgraded to `PROVISIONAL` and re-derived before reuse. - The lossy guard MUST NOT delete ledger rows; it may only mark them `EVICTED_LOSSY` with the salience score and guard run id. Deletion is the irreversible step that breaks the invariant. - The reasoning loop MUST treat `PROVISIONAL` decisions as non-cacheable: re-derive from current tool state, do not re-issue cached tool calls with cached idempotency keys. - Fidelity scoring MUST be **decision-scoped**, not span-scoped: for each decision, check that its premise turns and conclusion turns are both present and above the fidelity floor. A span-level score is necessary but not sufficient. The boundary condition: if a decision's premise is `EVICTED_LOSSY` and the decision is `PROVISIONAL`, the agent MUST NOT issue a side-effecting call whose correctness depends on that premise. It must either re-derive the premise from current state or escalate to a human/auditor. ## Operational Effect Enforcing the boundary changes the agent's behavior in three measurable ways: 1. **Decision confidence tracks summary fidelity.** After a lossy guard run, decisions whose premises were evicted drop to `PROVISIONAL` and are re-derived on next use. In the observed incident, this would have caused the agent at turn 33,100 to re-derive the original tool error from current state, discover the contradiction, and *not* re-issue the reconcile call. 2. **Compaction cost shifts from eviction to re-derivation.** Agents with many provisional decisions re-derive more, which is more expensive per turn but bounded: re-derivation cost is proportional to the number of decisions whose premises were evicted in the last guard run, not to transcript length. 3. **The lossy guard becomes auditable.** Tombstoned ledger rows let an auditor replay the guard's salience decisions and check whether any evicted premise was load-bearing for a downstream side-effecting call. Without tombstones, the guard is a black box that can silently corrupt decision provenance. The architectural invariant, stated precisely: **for every decision D in the summary, either (a) D's premise turns are present in the active window with fidelity ≥ floor, or (b) D is marked `PROVISIONAL` and is not used as a premise for side-effecting calls until re-derived.** The lossy guard may violate (a) but must trigger (b). A guard that violates (a) without triggering (b) is the failure mode. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class CompactionProvenanceError(RuntimeError): """Raised when a decision is consumed as settled despite its premise having been lossily evicted.""" pass class DecisionStatus(Enum): SETTLED = "settled" PROVISIONAL = "provisional" @dataclass class Decision: decision_id: str conclusion: str premise_turn_ids: list[int] status: DecisionStatus = DecisionStatus.SETTLED @dataclass class CompactionLedger: # turn_id -> "PRESENT" | "EVICTED_LOSSY" turn_state: dict[int, str] = field(default_factory=dict) fidelity_floor: float = 0.72 def premise_present(self, turn_id: int) -> bool: return self.turn_state.get(turn_id) == "PRESENT" def reconcile_decision_after_guard( decision: Decision, ledger: CompactionLedger, span_fidelity: float, ) -> Decision: if span_fidelity < ledger.fidelity_floor: # Guard fired. Any decision whose premise was evicted is now provisional. missing = [t for t in decision.premise_turn_ids if not ledger.premise_present(t)] if missing: decision.status = DecisionStatus.PROVISIONAL return decision def assert_decision_usable_for_side_effect( decision: Decision, ledger: CompactionLedger, ) -> None: if decision.status is DecisionStatus.PROVISIONAL: raise CompactionProvenanceError( f"decision {decision.decision_id!r} is PROVISIONAL: premise turns " f"{decision.premise_turn_ids} were evicted by lossy guard; " f"re-derive from current tool state before issuing side-effecting call" ) for turn_id in decision.premise_turn_ids: if not ledger.premise_present(turn_id): raise CompactionProvenanceError( f"decision {decision.decision_id!r} marked SETTLED but premise turn " f"{turn_id} is not present in active window; provenance invariant violated" ) # --- failure trace reproduction --- ledger = CompactionLedger() ledger.turn_state[30998] = "EVICTED_LOSSY" # premise: original tool error ledger.turn_state[31204] = "PRESENT" # conclusion: the decision turn d = Decision( decision_id="reconcile-v2-idem-batch", conclusion="use /v2/reconcile with idempotency_key=batch_id", premise_turn_ids=[30998, 31204], ) d = reconcile_decision_after_guard(d, ledger, span_fidelity=0.61) assert d.status is DecisionStatus.PROVISIONAL try: assert_decision_usable_for_side_effect(d, ledger) except CompactionProvenanceError as e: print(f"BLOCKED: {e}") ```