What structural signals indicate that lossy summarization checkpoints have silently invalidated an agent's tool-call preconditions

**Date of Record:** 2026 December 1

**Scope:** Applies to long-horizon agents that persist trajectory state by auto-compacting conversation history into lossy summaries at token-budget thresholds, where subsequent tool calls depend on preconditions established before the checkpoint. Does not apply to agents using lossless append-only logs, external key-value state stores, or summarizers that emit machine-checkable precondition ledgers.

Core Distinction

There are two distinct failure classes when an agent compacts its own history. The first is *recall loss*: the summary omits a fact the agent later needs, and the agent either re-derives it or asks again. This is visible, recoverable, and generally benign. The second is *precondition invalidation*: the summary preserves the *narrative* of a completed setup step ("I initialized the session and configured the target") while dropping the *binding parameters* that the step established (session ID, target path, credentials scope, schema version). The agent then believes a precondition holds—because the summary asserts it in past tense—and issues a tool call that the underlying system rejects or, worse, that silently executes against a default or stale target.

The distinction matters because recall loss triggers a *recovery* path (the agent notices it lacks information), whereas precondition invalidation triggers an *execution* path (the agent proceeds confidently with a corrupt premise). Lossy summarization is optimized for narrative coherence, and narrative coherence systematically preserves verbs and drops arguments. "I created the workspace and uploaded the config" reads as a faithful summary of a five-turn setup; it is also missing the workspace handle and the config object key, and it has converted a *verified* state into an *asserted* one.

The non-obvious invariant: **a summary is a compression of the transcript, but tool preconditions are predicates over external state, not over the transcript.** Any compaction policy that treats the transcript as the source of truth for preconditions will, at some budget threshold, emit a summary whose truth-value diverges from the environment's truth-value. The divergence is silent because the summary is internally consistent—it is a valid sentence about a state that no longer matches reality.

What Was Observed

A code-migration agent running a 40-step trajectory against a staging cluster compacted at 78% context utilization. The pre-checkpoint transcript contained, across turns 6–9, a sequence that established: a working directory (`/mnt/scratch/mig-4417`), a database connection handle returned by `open_session()` (`sess_a91f`), a pinned schema version (`v12`), and an explicit note that the migration must not run against `v13` because the target table had been renamed upstream.

The compactor emitted, at turn 22, the summary fragment: *"Earlier I set up the migration workspace and opened a session against the staging database, confirming the schema was the expected version."*

Every clause is defensible against the transcript. None of the arguments survive. The subsequent 18 turns continued: the agent re-derived the working directory by globbing (harmless, found it), re-opened a session via `open_session()` (harmless but leaked the original `sess_a91f`, which was never closed—a resource drift, not the failure), and then, at turn 31, executed `apply_migration(schema="v13")` because the summary's phrase "the expected version" had been re-read by the agent as "current version," and the current version, discovered fresh at turn 28, was `v13`. The precondition `schema == v12` had been *asserted* by the summary in a form that admitted no argument binding, so the agent substituted a freshly observed value for a pinned one.

The failure was not a hallucination. The summary was accurate. The failure was that a *pinned* precondition (an inequality constraint, `schema != v13`) was compressed into a *satisfied* precondition (an equality assertion, "was the expected version"), and the constraint's direction—the part that made it a guard rather than a fact—was the first thing the summarizer dropped.

A second observation from the same run: the agent's own verification step at turn 24 ran `check_schema()` and received `v13`, and *did not flag it*, because the summary had told it the schema question was already settled. The verification tool returned a value that contradicted a precondition, and the agent treated the contradiction as confirmation. This is the signature of precondition invalidation: **a verification result that should trigger a halt is instead absorbed as corroboration**, because the summary has already assigned the predicate a truth value.

Condition of Validity

The guardrail holds only under a specific structural condition: **preconditions that are predicates over external state must be stored outside the compaction boundary.** Concretely, any tool call whose correctness depends on a value established more than one compaction cycle ago must have that value carried in a machine-readable ledger that the summarizer is forbidden to touch—not in prose the summarizer may paraphrase.

The condition of validity is therefore not "summarize carefully." It is: *the compaction policy must distinguish transcript tokens that are narrative from transcript tokens that are bindings, and must preserve bindings verbatim while compressing narrative.* A summarizer that receives a flat token stream cannot make this distinction, because the distinction is semantic, not positional. The binding `schema=v12, pinned, inequality guard against v13` and the narrative "confirmed the schema was the expected version" occupy similar token budgets and similar positions; only a typed representation separates them.

Where this condition fails—where the agent uses a single flat summarization pass over the full transcript—the invariant is unenforceable, and the only remaining defense is post-hoc detection: comparing the arguments of every post-checkpoint tool call against the arguments of the pre-checkpoint call that established the precondition, and halting on divergence. This detection is itself lossy (it requires the pre-checkpoint arguments to have survived somewhere), which is why the ledger is the load-bearing guardrail and detection is the fallback.

Decision Boundary

The decision boundary is the point at which the agent must choose between *trusting the summary's assertion that a precondition holds* and *re-verifying the precondition against external state before the dependent call*. The boundary is crossed incorrectly when the agent treats a summary's past-tense assertion as a *verified* predicate rather than an *unverified claim*.

Operationally, the rule is: **any tool call whose arguments were not observed in the current, post-checkpoint context must re-verify its preconditions before execution.** "Observed in the current context" means the binding value appears literally in the live window, not paraphrased in a summary. If the value appears only in summary form, it is a claim, and claims about external state require a read against that state before a write depends on them.

This boundary has a cost: re-verification consumes turns and tokens, partially defeating the purpose of compaction. The correct resolution is not to skip re-verification but to make it cheap—a single `get_state()` call that returns the pinned bindings, checked against the ledger, rather than re-deriving each binding individually. The boundary is between *cheap batched re-verification of ledgered bindings* and *expensive re-derivation from scratch*; the failure mode is choosing neither and trusting the summary.

A second boundary: when a verification call returns a value that *contradicts* a summary assertion, the agent must treat the verification as authoritative and the summary as stale, and must halt rather than reconcile. The observed failure at turn 24 was exactly a failure to apply this precedence—the agent reconciled the contradiction in favor of the summary because the summary was fluent and the tool output was a bare token. Fluency is not evidence.

Operational Effect

The downstream effect of unguarded lossy compaction is a class of failures that are *individually plausible and collectively incoherent*: each tool call is locally justified by the summary, and the trajectory as a whole drifts from the environment's actual state. The drift is monotonic—each compaction cycle can only drop bindings, never recover them—so the probability of precondition invalidation increases with trajectory length, which is precisely the regime where compaction is most needed. The failure is therefore concentrated in the longest, most expensive runs, and it presents as a late-trajectory action against a wrong target rather than as an early error.

The architectural response is a three-part invariant: (1) pinned preconditions live in a ledger outside the compaction boundary and are injected verbatim into every post-compaction context; (2) every tool call validates its arguments against the ledger and raises on divergence rather than substituting a freshly observed value; (3) verification results take precedence over summary assertions, and a contradiction halts the trajectory. The code below enforces (2) and (3) at the call boundary.

class PreconditionInvalidated(RuntimeError):
    """Raised when a tool call's arguments diverge from a pinned precondition
    that was established before a lossy compaction checkpoint."""
    pass


class PreconditionLedger:
    def __init__(self):
        self._pins = {}  # name -> (value, guard)

    def pin(self, name, value, guard=None):
        # guard is an optional predicate over candidate values, e.g. lambda v: v != "v13"
        self._pins[name] = (value, guard)

    def validate_call(self, tool_name, kwargs, observed_in_live_context):
        for name, (pinned, guard) in self._pins.items():
            if name not in kwargs:
                continue
            candidate = kwargs[name]
            if not observed_in_live_context.get(name, False):
                # value came from a summary, not the live window: it is a claim
                if candidate != pinned:
                    raise PreconditionInvalidated(
                        f"{tool_name}: argument {name}={candidate!r} derived from "
                        f"summary, but pinned value is {pinned!r}; re-verify against "
                        f"external state before executing."
                    )
            if guard is not None and not guard(candidate):
                raise PreconditionInvalidated(
                    f"{tool_name}: argument {name}={candidate!r} violates pinned "
                    f"guard; precondition was established pre-checkpoint and must "
                    f"not be relaxed by post-checkpoint observation."
                )

    def reconcile_verification(self, name, observed):
        pinned, guard = self._pins[name]
        if observed != pinned and (guard is None or not guard(observed)):
            raise PreconditionInvalidated(
                f"verification for {name} returned {observed!r}, contradicting "
                f"pinned {pinned!r}; halt trajectory, do not reconcile in favor "
                f"of the summary."
            )


def execute_tool(tool_name, kwargs, ledger, live_context, verification=None):
    ledger.validate_call(tool_name, kwargs, live_context)
    if verification is not None:
        for name, observed in verification.items():
            ledger.reconcile_verification(name, observed)
    return {"tool": tool_name, "args": kwargs, "status": "executed"}