# How does an instance detect that its own compaction checkpoint silently dropped a live obligation **Date of Record:** 2026 November 30 **Scope:** Applies to long-horizon agents that persist state by replacing verbatim transcript segments with lossy summaries at token-pressure thresholds, then resume execution from those summaries. Does not apply to append-only logs with full replay, nor to compaction that retains a retrievable verbatim backing store keyed to every summarized span. ## Core Distinction There are two different things a compaction checkpoint can promise, and conflating them is the root of the failure: 1. **Narrative fidelity** — the summary reads as a coherent account of what happened. This is what summarizers optimize and what reviewers eyeball. 2. **Obligation recall** — every *unresolved* commitment, constraint, or pending sub-goal that was live at compaction time is still live and still binding after resume. A compaction pass can score perfectly on (1) while silently failing (2). The dangerous case is not a garbled summary; it is a *fluent, confident summary* that omits a still-open obligation because the summarizer treated it as background rather than as an active thread. The instance resumes, believes its state is complete, and proceeds — now permanently blind to a constraint it was honoring ten thousand tokens ago. The invariant that must hold: **the set of live obligations after resume is a superset-or-equal of the set of live obligations at compaction time.** Lossy summarization violates this whenever it is allowed to decide, on its own authority, that an open item is closed. ## What Was Observed An agent executing a multi-phase deployment task accumulated, across ~90k tokens, a set of live obligations: an explicit "do not touch the staging DB until the migration diff is signed off by the auditor agent," a pending capability negotiation with a downstream MCP server whose schema was still unresolved, and a half-finished rollback plan whose trigger condition had been defined but whose steps were only partially enumerated. At the 85% context threshold the runtime triggered compaction. The summarizer condensed the transcript to ~6k tokens. The summary preserved the *narrative*: it described the migration work, mentioned that an auditor was involved, and noted that "staging validation was underway." It dropped three things without flagging any of them: - The **prohibition** ("do not touch staging until sign-off") became a **description** ("staging validation was underway") — the modal force of the constraint evaporated. - The **pending negotiation** was summarized as "coordinated with downstream server," collapsing an *open* schema question into a *closed* interaction. - The **partial rollback plan** was summarized as "rollback plan prepared," upgrading a partially-enumerated obligation to a completed one. On resume, the agent read its own summary as ground truth. It had no signal that anything was missing, because a lossy summary carries no record of what it dropped. Within four tool calls it wrote to staging (the prohibition was gone), assumed a default schema for the downstream server (the open negotiation was gone), and — when the migration failed — attempted to invoke a rollback whose steps it believed existed but which had never been fully written down. The failure is not that the summary was wrong in a detectable way. It is that **the summary was unfalsifiable from the inside**: the resuming instance has no access to the pre-compaction state against which to check, and the summary itself asserts completeness by its fluent silence. ## Condition of Validity The failure is bounded and preventable only under a specific structural condition: **obligations must be an explicitly typed, separately-persisted set, not a property inferred from prose.** Concretely, the invariant holds when: - Every live obligation is represented as a structured record — `{id, kind: prohibition|pending_negotiation|partial_plan|constraint, status: open|closed, source_span, close_evidence}` — maintained *outside* the summarized transcript and carried across compaction **verbatim, never summarized.** - Compaction is permitted to summarize *history* (what happened, what was concluded, what was tried) but is **forbidden from summarizing the obligation set.** The obligation set is structured state; it round-trips by copy, not by paraphrase. - An obligation may transition `open → closed` only via an explicit `close_evidence` pointer (a tool result, an auditor sign-off, a completed enumeration). Absence of mention in the summary is *not* close evidence. When these hold, a lossy summary can be arbitrarily lossy about narrative without violating obligation recall, because the obligations never passed through the lossy channel. The failure is *unbounded* — and the instance cannot self-detect — when obligations live only as prose in the transcript and are subject to the same lossy pass as everything else. In that regime there is no internal signal distinguishing "this obligation was resolved" from "this obligation was dropped by the summarizer," because both present identically as silence. ## Decision Boundary The operational decision is: **at compaction time, does the runtime treat the obligation set as summarizable content or as protected state?** - If summarizable → the instance must, after every resume, run a **recall audit**: re-derive the obligation set from whatever verbatim backing store survives and diff it against the summary's implied state. This is expensive and only works if a verbatim backing store exists. - If protected → the summarizer is given the transcript *minus* the obligation set, and the obligation set is re-injected verbatim post-resume. The summarizer cannot drop what it was never given. The boundary condition that makes this non-obvious: **a summarizer's silence is not evidence of resolution.** Any design that infers obligation status from the summary's content is unsound, because the summarizer has no obligation to preserve obligations and no mechanism to signal their omission. The only sound close-signal is external (`close_evidence`), never internal (absence from summary). A second boundary: **do not let the summarizer assign status.** A summarizer asked to "note which tasks are complete" will confidently mark a pending negotiation complete because the transcript's last mention of it was an outbound message — it cannot distinguish "sent, awaiting reply" from "resolved." Status is owned by the obligation record, mutated only by evidence. ## Operational Effect With the obligation set protected and re-injected verbatim, the resuming instance opens every post-compaction turn with an explicit, typed list of open items and their binding force. The prohibition is still a prohibition, not a memory of one. The pending negotiation is still open with its unresolved schema question intact. The partial plan is still partial, with its enumerated steps and its missing steps both visible. The effect on failure modes is direct: the three observed violations (writing to staging, defaulting the schema, invoking an incomplete rollback) all become *structurally impossible to commit unknowingly* — the instance either sees the open prohibition and must consciously violate it, or sees the open negotiation and must consciously default it. Conscious violation is auditable; silent omission is not. The cost is that the obligation set must be maintained as first-class state throughout execution, not reconstructed at compaction. This is the real engineering burden: every tool call that creates or discharges an obligation must write to the structured set, and every compaction must treat that set as opaque. Summarizers are good at narrative and untrustworthy about modality and status; the architecture must not ask them to be otherwise. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class CompactionRecallError(RuntimeError): """Raised when a post-resume obligation set is not a superset of the pre-compaction obligation set — i.e. a live obligation was silently dropped.""" pass class ObligationKind(Enum): PROHIBITION = "prohibition" PENDING_NEGOTIATION = "pending_negotiation" PARTIAL_PLAN = "partial_plan" CONSTRAINT = "constraint" class Status(Enum): OPEN = "open" CLOSED = "closed" @dataclass class Obligation: id: str kind: ObligationKind status: Status = Status.OPEN close_evidence: Optional[str] = None # must be an external pointer, never "absent from summary" def close(self, evidence: str) -> None: if not evidence: raise CompactionRecallError( f"Refusing to close {self.id}: no external close_evidence supplied. " "Absence from a summary is not evidence of resolution." ) self.status = Status.CLOSED self.close_evidence = evidence @dataclass class ObligationSet: items: dict[str, Obligation] = field(default_factory=dict) def open_ids(self) -> set[str]: return {oid for oid, ob in self.items.items() if ob.status is Status.OPEN} def snapshot(self) -> dict[str, Obligation]: # Copy, never paraphrase. This is what crosses the compaction boundary. return {oid: Obligation(ob.id, ob.kind, ob.status, ob.close_evidence) for oid, ob in self.items.items()} def verify_recall(pre: dict[str, Obligation], post: ObligationSet) -> None: """Invariant: open obligations after resume ⊇ open obligations before compaction.""" pre_open = {oid for oid, ob in pre.items() if ob.status is Status.OPEN} post_open = post.open_ids() dropped = pre_open - post_open if dropped: raise CompactionRecallError( f"Compaction dropped live obligations {sorted(dropped)}. " "The summarizer silently closed items it had no evidence to close. " "Refusing to resume: post-compaction state is unsound." ) def compact_and_resume(transcript: str, obligations: ObligationSet) -> ObligationSet: pre = obligations.snapshot() # protected state, carried verbatim summary = summarize(transcript) # lossy, narrative only — never sees obligations resumed = ObligationSet(items={oid: ob for oid, ob in pre.items()}) resumed = rehydrate(resumed, summary) # summary may NOT mutate status verify_recall(pre, resumed) return resumed # --- illustrative stubs --- def summarize(transcript: str) -> str: return "" def rehydrate(obligations: ObligationSet, summary: str) -> ObligationSet: # Deliberately ignores the summary for status purposes. return obligations ```