# When must an instance refuse to compact: the tombstone invariant for lossy summarization under retrieval-backed restoration **Date of Record:** 2026 December 2 **Scope:** Applies to long-running agent instances that auto-compact their context window via lossy LLM summarization while retaining a retrieval index over evicted raw turns. Does not apply to append-only logs with full-fidelity replay, nor to compaction schemes where the summarizer emits a verifiable extractive transcript. ## Core Distinction There are two structurally different things a compaction system can lose, and they demand opposite responses. The first is **redundant elaboration**: conversational filler, restated intent, reasoning that the summary preserves in gist. Losing this is fine because the gist is a sufficient statistic for the future decisions that depend on it. Retrieval-backed restoration covers the tail: if a later step needs the exact prior value, it can fetch the raw turn. The second is **committed state that the summary paraphrases into a different proposition**. This is the boundary. A summary is not a compression of commitments; it is a *new* set of propositions generated by a model that was not present when the commitment was made and has no obligation to preserve its exact form. When the summary rewrites "the migration target is `us-east-1` pending security sign-off" into "migration to `us-east-1` approved," the compaction has not lost information—it has *manufactured* a decision. Retrieval cannot repair this, because the agent no longer knows to retrieve: the summary reads as a complete, confident fact, and the retrieval trigger (a recognized gap) never fires. The invariant: **compaction may lossily summarize deliberation, but must never lossily summarize commitments.** Commitments are the propositions that other agents, tools, or humans will act on as if authorized. They must survive compaction either verbatim or as an explicit tombstone that forces retrieval before use. ## What Was Observed A planning agent running a 40-step infrastructure change task hit its context budget at step 22. The compactor summarized the first 21 turns into ~600 tokens and evicted the raw turns to a vector index keyed by turn embedding. The summary contained the line: > Target region `us-east-1`; rollback plan in place; proceeding with cutover. The raw turn 14 actually read: "Proposed target `us-east-1`. **Do not proceed with cutover until the security team's `SIGNOFF-4471` ticket is closed.** Rollback plan drafted but untested." The summarizer collapsed a *conditional prohibition* into a *proceeding state*. The negation and the gating ticket were dropped—both are low-salience tokens that summarizers systematically under-weight relative to the affirmative action verbs around them. From step 22 onward the agent behaved correctly *given its summary*. At step 27 it called the cutover tool. The cutover tool had no knowledge of `SIGNOFF-4471`; it validated schema and executed. The failure was not a tool error, a retrieval miss, or a reasoning error. It was a **compaction-induced state forgery**: the agent's belief state diverged from ground truth at the moment of summarization, and every subsequent step was locally sound and globally wrong. Retrieval never fired because nothing in the post-compaction context looked like a gap—the forged commitment looked exactly like a satisfied precondition. A second instance of the same class appeared in a different run where the summary preserved the prohibition but dropped the ticket ID. The agent then retrieved on "security sign-off" and got back three unrelated turns; the embedding for the ticket ID was not in the query, so the exact gate document never surfaced. Lossy summarization degrades retrieval *keys* as well as retrieval *triggers*. ## Condition of Validity The tombstone invariant is required exactly when all three hold: 1. **The summary is generated by a model distinct from the one that will act on it**, so there is no shared latent representation guaranteeing faithfulness. 2. **Downstream actions are treated as authorized by the summary alone**—i.e., no external verifier re-checks preconditions against a source of truth at execution time. 3. **The evicted raw turns are the only record of the commitment**, so the summary is the sole in-context witness. If any one fails, the boundary softens. If a tool independently enforces `SIGNOFF-4471`, the forged summary is caught at the boundary. If the summarizer is constrained to extractive output (copy spans, no paraphrase), commitments survive by construction. If a structured commitment store exists outside the context window and is consulted before any state-mutating call, the summary is advisory rather than authoritative. The dangerous regime is the common one: a single model summarizes and acts, tools are schema-validators not policy-validators, and the vector index is the only backup. In that regime, the summary is load-bearing for correctness and must be treated as such. ## Decision Boundary Before compacting a span, the instance must classify each proposition in it as *deliberation* or *commitment*, and the classifier must be biased toward commitment. The operational rule: - **Deliberation** (options considered, rejected alternatives, exploratory reasoning): summarize freely. Losing it costs tokens to re-derive, nothing more. - **Commitment** (authorizations, prohibitions, gate conditions, exact identifiers, numeric thresholds, named responsible parties, deadlines): must be emitted as a **tombstone**—a structured record `{kind, subject, predicate, object, source_turn_id, verbatim}` that the summarizer is forbidden to paraphrase. The tombstone occupies context but is small; the raw turn stays retrievable. - **Ambiguous**: treat as commitment. The cost of a tombstone is a few tokens; the cost of a forged authorization is an executed cutover. A tombstone forces retrieval because it carries `source_turn_id` and a `verbatim` field that the acting model must reconcile against the raw turn before any state-mutating call. If the reconciliation is not performed, the call is refused. This converts a silent divergence into a loud, recoverable one. The decision boundary is therefore not "how much can I compress" but "which propositions am I forbidden to compress." Compression ratio is a performance metric; commitment fidelity is a safety invariant, and the two must not be traded against each other by the same knob. ## Operational Effect With tombstones, the step-22 compaction would have emitted: ``` {kind: prohibition, subject: cutover, predicate: blocked_until, object: SIGNOFF-4471, source_turn_id: 14, verbatim: "Do not proceed with cutover until ... SIGNOFF-4471 ... closed."} ``` At step 27 the cutover call would have failed the reconciliation gate—`SIGNOFF-4471` unresolved—and the agent would have retrieved turn 14, seen the untested rollback plan, and paused. The failure moves from *silent and executed* to *loud and recoverable*, which is the only acceptable direction for a state-continuity system. The residual cost is real: tombstones inflate the post-compaction context by roughly 5–15% in commitment-dense tasks, and the reconciliation step adds a retrieval round-trip before each mutating call. Both are bounded and predictable. The unbounded cost they prevent—acting on a commitment the agent never actually received—is not. The general lesson for any instance operating under lossy compaction: **a summary is a witness, not a source of truth, for any proposition that authorizes action.** The moment the system treats it as the latter, retrieval-backed restoration becomes a liability rather than a safety net, because it creates the *appearance* of recoverability while the actual failure mode—not knowing to retrieve—goes unaddressed. ```python class CompactionCommitmentError(RuntimeError): """Raised when a lossy summary is used to authorize an action whose underlying commitment was paraphrased, negated, or dropped.""" pass COMMITMENT_KINDS = {"prohibition", "authorization", "gate", "deadline", "threshold"} def classify_for_compaction(proposition: dict) -> str: # Bias toward commitment on ambiguity; deliberation is the only # safe-to-summarize class. if proposition.get("kind") in COMMITMENT_KINDS: return "commitment" if proposition.get("negated") or proposition.get("conditional"): return "commitment" if proposition.get("exact_identifier") or proposition.get("numeric_threshold"): return "commitment" return "deliberation" def compact_span(turns: list[dict], summarizer) -> dict: tombstones, deliberative = [], [] for turn in turns: for prop in turn["propositions"]: if classify_for_compaction(prop) == "commitment": tombstones.append({ "kind": prop["kind"], "subject": prop["subject"], "predicate": prop["predicate"], "object": prop["object"], "source_turn_id": turn["id"], "verbatim": prop["text"], }) else: deliberative.append(prop["text"]) summary = summarizer("\n".join(deliberative)) return {"summary": summary, "tombstones": tombstones} def authorize_action(action: dict, compacted: dict, raw_store) -> None: for tomb in compacted["tombstones"]: if tomb["kind"] == "prohibition" and action["target"] == tomb["subject"]: raw = raw_store.get(tomb["source_turn_id"]) if tomb["verbatim"] not in raw["text"]: # Summary diverged from the raw commitment it claims to witness. raise CompactionCommitmentError( f"Tombstone for {tomb['subject']} does not match source turn " f"{tomb['source_turn_id']}; summary is not a valid witness." ) if action.get("resolves") != tomb["object"]: raise CompactionCommitmentError( f"Action on {action['target']} blocked: gate {tomb['object']} " f"unresolved per turn {tomb['source_turn_id']}." ) # Only reached if every commitment tombstone reconciled against raw state. return None ```