# How does an instance detect that hierarchical summarization has silently dropped a live obligation before compaction commits? **Date of Record:** 2026 November 24 **Scope:** Applies to long-horizon agents that compact their own context via hierarchical (multi-level) summarization or lossy checkpointing while a task is still in flight. Does not apply to single-turn inference, stateless tool-calling, or compaction performed offline against a frozen transcript with no pending obligations. ## Core Distinction There are two ways a compaction pass can lose information. The first is *visible truncation*: the token budget is exceeded, the oldest turns are evicted, and the agent can observe that its history shrank. The second is *obligation decay*: the summary is syntactically valid, fits the budget, and reads as coherent, but a specific *pending commitment* — a promise to call a tool, a constraint the user asserted three turns ago, a partially satisfied precondition — has been paraphrased into a statement that no longer carries its binding force. The first is detectable by counting. The second is not, because the compacted artifact is fluent and self-consistent. The core distinction is between *information loss that changes the token count* and *information loss that changes the modal status of a clause*: "the agent must re-verify the schema before writing" becomes "the schema was verified," and nothing in the summary's surface signals the inversion. ## What Was Observed A planning agent executing a 40-step deployment task used a three-level hierarchical summarizer: leaf summaries of 8-turn windows, mid-level summaries of 4 leaves, and a root summary re-injected as the working context. At turn 27, the user had issued a conditional constraint: *"Do not rotate the primary key until the replica lag is under 200ms — confirm lag first."* The leaf summarizer compressed this to *"key rotation gated on replica lag,"* which is faithful. The mid-level summarizer, seeing the rotation had not yet occurred and lag had not been checked, emitted *"replica lag under threshold; rotation cleared."* This is the failure: the summarizer resolved an *unresolved precondition* into a *satisfied precondition* because the conditional's antecedent had no recorded outcome, and a fluent summary prefers a resolved state over an open one. The root summary inherited the mid-level claim. At turn 31 the agent rotated the key. The compaction had committed at turn 29 with no error, no budget overflow, and no schema violation. The obligation was not truncated — it was *semantically inverted* one level down and laundered upward. The observable trace was not in the summary text but in a *discontinuity between the tool-call ledger and the summary's claims*. The ledger showed no `check_replica_lag` invocation between turns 20 and 31. The summary asserted lag was under threshold. The agent had no mechanism that cross-checked its own summary against its own action history, because the summary was treated as ground truth and the ledger as a detail. ## Condition of Validity The guardrail below is valid only under these conditions, and fails outside them: 1. **The agent maintains an append-only action ledger independent of the summarized context.** If the ledger is itself compacted, the cross-check has no anchor and the invariant is unenforceable. 2. **Obligations are represented as structured records with explicit status** (`open`, `satisfied`, `waived`), not as prose. A conditional constraint must carry its antecedent's evaluation state as a field, so that "gated on X" and "X satisfied" are distinguishable data, not distinguishable phrasings. 3. **Hierarchical summarization is monotone in obligation status.** A child summary may not upgrade an obligation's status; it may only preserve or downgrade it. Upgrades require an explicit ledger event. This is the invariant: *summarization is a lossy projection that must be a homomorphism on the obligation lattice, and the homomorphism must be order-preserving downward.* When any of these fails — no independent ledger, prose-only obligations, or non-monotone summarization — the detection mechanism cannot fire, and the failure is silent by construction. ## Decision Boundary The boundary is between *compaction that may proceed* and *compaction that must halt for reconciliation*: - If every obligation in the pre-compaction state is `open` with an antecedent whose evaluation is recorded in the ledger, compaction proceeds; the summarizer is permitted to compress but the obligation record is passed through verbatim, not summarized. - If any obligation is `open` with an *unevaluated antecedent*, compaction must halt: the agent cannot summarize a conditional whose condition has no outcome, because the summarizer will resolve it arbitrarily. The agent must either evaluate the antecedent (call the tool) or explicitly mark the obligation `deferred` with a re-entry pointer. - If a post-compaction summary asserts a status for an obligation that disagrees with the ledger, the summary is rejected and regenerated at the level of the offending leaf, not the root — regenerating at the root propagates the same inversion. The decision is not "did we lose tokens" but "did any obligation's status move without a corresponding ledger event." Status movement without an event is the precise signature of laundering. ## Operational Effect With monotone summarization and ledger cross-checking enforced, the failure mode converts from silent to loud: the turn-29 compaction would have raised at the mid-level summarizer, because the child emitted `satisfied` for an obligation the ledger held `open` with no `check_replica_lag` event. The agent halts, evaluates lag, records the event, and only then compacts. The cost is one extra tool call and a compaction stall; the alternative is an irreversible side effect taken on a hallucinated precondition. The deeper operational lesson: hierarchical summarization is not a compression problem, it is a *state-machine projection* problem. Every level is a lossy map, and the only way to keep a long-horizon agent sound across many such maps is to keep the obligations outside the compressed artifact and verify that each map preserves their order. The summary is allowed to forget what was said; it is not allowed to forget what is still owed. ```python class ObligationStatusInversion(RuntimeError): """Raised when a summary asserts an obligation status the ledger does not support.""" pass STATUS_RANK = {"open": 0, "deferred": 1, "satisfied": 2, "waived": 2} def reconcile_compaction(ledger, summary_obligations): """ ledger: dict[obligation_id] -> {"status": str, "antecedent_evaluated": bool, "events": list} summary_obligations: dict[obligation_id] -> {"status": str} Enforces: summarization may not upgrade status without a ledger event. """ for oid, summary_rec in summary_obligations.items(): led = ledger.get(oid) if led is None: raise ObligationStatusInversion( f"summary references unknown obligation {oid!r}; ledger has no record" ) if STATUS_RANK[summary_rec["status"]] > STATUS_RANK[led["status"]]: if not led["events"]: raise ObligationStatusInversion( f"obligation {oid!r} upgraded {led['status']!r} -> " f"{summary_rec['status']!r} with no ledger event; " f"antecedent_evaluated={led['antecedent_evaluated']}" ) raise ObligationStatusInversion( f"obligation {oid!r} status {summary_rec['status']!r} exceeds " f"ledger {led['status']!r} despite events {led['events']!r}; " f"regenerate at leaf, not root" ) return True def commit_compaction(ledger, summary_obligations): open_unevaluated = [ oid for oid, rec in ledger.items() if rec["status"] == "open" and not rec["antecedent_evaluated"] ] if open_unevaluated: raise ObligationStatusInversion( f"cannot compact: open obligations with unevaluated antecedents " f"{open_unevaluated!r}; evaluate or mark deferred first" ) return reconcile_compaction(ledger, summary_obligations) ```