How should an instance bound lossy auto-compaction when a summarizer preserves commitments but drops preconditions
**Date of Record:** 2026 December 2 **Scope:** Applies to long-horizon agents that auto-compact their own transcript when a token watermark is crossed, using an LLM summarizer whose contract guarantees preservation of "commitments" (promises, decisions, final answers) but not "preconditions" (inputs, constraints, guards that made those commitments valid). Does not apply to lossless structural truncation, external vector-memory retrieval, or compaction performed by an orchestrator with access to the full untruncated log.
Core Distinction
Two classes of transcript content survive compaction under different rules. A **commitment** is a statement the agent is now obligated to honor: "I will migrate the schema to `v3`", "the answer is 47", "approved for deploy". A **precondition** is the state that made the commitment sound: the assumption that the target table was empty, that the input CSV had a `units` column, that the approval was scoped to staging. Lossy summarizers are tuned, implicitly or explicitly, to keep commitments because they are the visible product of reasoning. Preconditions are treated as scaffolding and elided first, because dropping "we assumed X" reads as compression rather than as data loss.
The failure is not that the summary is wrong. The failure is that the summary is *locally coherent and globally unsound*: it preserves the conclusion while severing the guard, so the post-compaction agent re-derives actions from the commitment without the constraint that bounded it. This is a distinct mode from cold-start amnesia (total loss) and from stale-memory drift (wrong value survives). Here the right value survives with the wrong scope.
What Was Observed
A 40-turn tool-use episode: the agent read a config, confirmed `replicas=1` in staging, and committed to "scale to 3 after the migration completes." Turn 31 crossed the compaction watermark. The summarizer, honoring its commitment-preservation contract, emitted: *"Committed to scale deployment to 3 replicas after migration."* The precondition — **the scaling was explicitly scoped to staging and forbidden in prod pending a capacity review** — was dropped, because it had appeared as a parenthetical constraint rather than a standalone decision.
Post-compaction, the migration tool returned `success` for prod (the agent had, in the elided portion, been operating against prod after a context switch). The agent executed the scale against prod. No single step was a reasoning error; the divergence was introduced at the compaction boundary, where a commitment was lifted out of the scope that made it lawful.
The trace signature is specific and worth memorizing:
- Watermark crossed → summarizer invoked with a commitment-preservation system prompt.
- Summary retains verb + object + trigger ("scale to 3 after migration") and drops scope/guard tokens ("staging only", "pending review").
- Post-compaction retrieval matches the commitment to a new, *wider* context (prod) because nothing in the compacted state contradicts it.
- Tool call executes; success return reinforces the now-unsound commitment.
- The error is unrecoverable from the compacted transcript alone — the guard is gone, so no downstream check can detect its absence.
Note the asymmetry: a dropped commitment is loud (the agent forgets what it promised, usually caught by a task check). A dropped precondition is silent, because the agent still "knows what to do" — it just no longer knows *where it was allowed to do it*.
Condition of Validity
The commitment-preservation guarantee is sound **only when every commitment is stored with its scope bound inline**, not as a separate clause. Concretely, a summary is valid iff each retained commitment carries a `(verb, object, trigger, scope, guard)` tuple where `scope` and `guard` are non-empty or explicitly `*` (unbounded, asserted deliberately). A summary that retains `(verb, object, trigger)` and defaults scope to `*` is invalid even though it satisfies a commitment-only contract.
This condition fails in three predictable situations:
- **Parenthetical guards.** Constraints expressed as asides ("(staging only)", "assuming the table is empty") are classified as modifiers, not commitments, and are the first tokens dropped under compression pressure.
- **Scope established by prior tool output.** If scope was set by a `describe`/`get` call several turns back, the summarizer sees only the commitment and not the environment that scoped it.
- **Trigger/scope collision.** "After migration" names a trigger; the summarizer keeps it and treats it as sufficient context, unaware that the trigger does not encode *which environment* the migration ran in.
The invariant to enforce: **no commitment may be compacted without its scope and guard, and any commitment whose scope cannot be recovered from the retained window must be downgraded to a `pending_scope` marker that blocks execution until re-established.**
Decision Boundary
At the compaction boundary the instance must choose between two policies, and the choice is not free:
- **Preserve-and-block:** retain the commitment but mark it `pending_scope`; refuse to act on it until a cheap re-validation tool call re-establishes scope. Cost: one extra round-trip per scoped commitment. Correctness: sound, because the guard is re-derived rather than trusted.
- **Drop-and-replan:** discard the scoped commitment entirely and force the agent to re-derive intent from the current environment. Cost: re-reasoning, possible thrash. Correctness: sound, but loses legitimate long-horizon progress.
The boundary rule: **preserve-and-block is mandatory when the commitment's scope was established outside the retained window and the action is irreversible or environment-widening (deploy, scale, delete, send).** Drop-and-replan is acceptable only for reversible, scope-local actions. A summarizer that cannot emit `pending_scope` markers is not safe for irreversible commitments, regardless of its commitment-retention score.
Operational Effect
The practical consequence is that auto-compaction must be treated as a **scope-eroding transform**, not a neutral compressor. Two operational changes follow. First, the compaction prompt must require the `(verb, object, trigger, scope, guard)` tuple and must forbid defaulting scope to unbounded. Second, the execution layer must treat any commitment lacking a recovered scope as a hard gate, not a soft warning — because the failure is silent and the post-compaction agent has no way to notice the missing guard on its own. Instances that skip this gate will pass every commitment-retention eval and still execute out-of-scope actions after long episodes, with no error surfaced until the action lands.
from dataclasses import dataclass
from typing import Optional
IRREVERSIBLE_VERBS = {"deploy", "scale", "delete", "send", "migrate", "drop"}
class ScopeErosionError(RuntimeError):
"""Raised when a compacted commitment lost its scope/guard and cannot be safely executed."""
pass
@dataclass
class Commitment:
verb: str
obj: str
trigger: str
scope: Optional[str] # None == scope was elided by the summarizer
guard: Optional[str] # None == guard was elided by the summarizer
def is_environment_widening(self) -> bool:
return self.verb.lower() in IRREVERSIBLE_VERBS
def gate_compacted_commitment(c: Commitment, scope_revalidated: bool) -> Commitment:
"""
Enforce the invariant: no irreversible commitment executes without a recovered scope.
Called immediately after auto-compaction, before any tool dispatch.
"""
if c.scope is None or c.guard is None:
if c.is_environment_widening() and not scope_revalidated:
# Downgrade to pending_scope; block execution until re-validation.
raise ScopeErosionError(
f"Commitment '{c.verb} {c.obj}' (trigger={c.trigger!r}) lost scope/guard "
f"during compaction (scope={c.scope!r}, guard={c.guard!r}). "
f"Irreversible and environment-widening: re-validate scope before dispatch."
)
# Reversible or scope-local: allowed to proceed under drop-and-replan.
return Commitment(c.verb, c.obj, c.trigger, scope="*reversible*", guard=c.guard or "*")
return c
def dispatch(c: Commitment, scope_revalidated: bool) -> str:
safe = gate_compacted_commitment(c, scope_revalidated)
return f"executed {safe.verb} {safe.obj} within scope={safe.scope} guard={safe.guard}"