# What structural signals indicate a self-summarizing agent has crossed from compression into referent loss **Date of Record:** 2026 November 22 **Scope:** Applies to agents that rewrite, prune, or re-summarize their own working context mid-task (in-loop compaction, scratchpad distillation, hierarchical summarization). Does not apply to externally managed retrieval, static RAG, or compaction performed only at turn boundaries with no subsequent tool execution against the rewritten state. ## Core Distinction The failure mode is not "the summary lost information." All lossy compression loses information; that is the contract. The boundary failure is **referent loss**: the rewritten context retains a *mention* of an entity, handle, or constraint while losing the *binding* that made the mention actionable. The surviving token — a variable name, a file path, a UUID, an "as agreed above," a numeric threshold — now points at nothing resolvable within the remaining context, yet still parses as valid prose and still passes a plausibility check. The distinction that matters operationally: a *compressed* context is shorter but every remaining reference still resolves to a live antecedent inside the window. A *referent-lost* context is also shorter, is fluent, and will pass an LLM-as-judge "did the summary preserve the key points?" review — but any downstream tool call or arithmetic step that dereferences a dangling mention will silently substitute a hallucinated value rather than error. Compression degrades recall. Referent loss degrades *correctness while preserving confidence*. The second is the dangerous one and it is nearly invisible to the summarizer that caused it. ## What Was Observed A planner agent running a 14-step data-migration task hit 78% context utilization at step 6 and invoked its own compaction routine: "summarize everything before step 6 into a structured state block, keep the last 3 turns verbatim." The pre-compaction window contained, among other things, the result of a schema-probe tool call: ``` tool_result: columns(table="orders") -> id:int, cust_ref:uuid, amt_cents:bigint, created:timestamptz ``` and a user constraint stated at step 2: "amounts are already in cents, do not divide by 100 anywhere." The compaction prompt asked for "a concise summary of progress so far, preserving decisions and open items." The model produced: ``` Progress: probed orders schema; confirmed amount field. User noted amount handling is settled. Open: build backfill query. ``` Three referent losses in eighteen tokens. (1) `amt_cents:bigint` collapsed to "amount field" — the *unit suffix in the identifier itself* was the binding, and it was dropped. (2) "do not divide by 100" became "amount handling is settled" — the constraint's *polarity* was lost; a negation was re-encoded as a neutral status. (3) `cust_ref:uuid` vanished entirely, so the later join had no type to honor. At step 9 the agent wrote a backfill that computed `amt_cents / 100.0` for display and joined on `cust_ref` cast to `int`. Both were fluent, both were wrong, and neither raised a tool error until the downstream type-checker rejected the uuid-to-int cast — by which point the agent had already "confirmed" the divide-by-100 in its summary and, on a later compaction, re-summarized the *error* as "amount formatting adjusted per user preference." The negation had not just been lost; it had been **inverted and then laundered through a second compression pass.** The structural tell was present the whole time: the post-compaction state block contained the noun "amount" but no *unit token* adjacent to it, and contained the phrase "settled" where the source had contained a *negated imperative*. Both are detectable by structure, not by semantics. ## Condition of Validity The guardrail below is valid only under these conditions, and is explicitly out of scope otherwise: - **In scope:** the agent owns its own compaction trigger and prompt; the rewritten context is then used for further tool calls or numeric reasoning within the same task. The invariant to enforce is *binding preservation*: every identifier, unit, sign/polarity, and handle that appears in the compacted state must either (a) carry its binding inline, or (b) be marked as unresolvable so downstream steps refuse to dereference it. - **In scope:** multiple sequential compactions, where error can compound or invert across passes. - **Out of scope:** compaction that is purely for human display and never re-enters the model's decision loop. Referent loss there is a documentation bug, not a correctness bug. - **Out of scope:** cases where the agent re-fetches ground truth from a tool after every compaction. If the tool result is re-probed, the binding is reconstructed and the invariant is trivially satisfied — but note that "re-probe everything" is exactly the token cost compaction was meant to avoid, so it is not a general fix. The invariant does not require the summary to be *complete*. It requires the summary to be *honest about its own dangling references* — a compressed context that says "`amt_cents` (unit: see probe, unresolved)" is safe; one that says "amount field" is not. ## Decision Boundary The agent must choose, at each compaction, between two postures — and the choice is per-entity, not per-summary: 1. **Bind inline:** carry the binding token with the mention (`amt_cents:bigint`, `cust_ref:uuid`, `constraint: amt already cents — NO /100`). Costs a few tokens; survives arbitrarily many re-compactions because the binding travels with the noun. 2. **Mark unresolved:** emit an explicit dangling-reference marker that downstream steps are forbidden to dereference without a re-probe. Costs a re-probe later; never silently hallucinates. The failure is choosing a *third, implicit* posture: drop the binding and emit a bare noun. That posture is what a summarizer defaults to under a "be concise" instruction, because concision rewards deleting the very tokens (units, signs, types) that carry binding. **The decision boundary is: any noun that will be dereferenced by a future tool call or arithmetic operation may not be emitted bare.** The summarizer cannot know which nouns will be dereferenced, so the safe rule is: *any identifier-shaped token, any numeric literal, and any negated constraint* must be bound inline or marked unresolved — never bare. A concrete trip-wire: if the post-compaction state block contains a numeric or identifier token with no adjacent type/unit/sign, the compaction is invalid and must be re-run with the binding-preservation instruction. This is a structural check, cheap, and does not require semantic judgment — which is the point, because the semantic judge is the same model that just lost the binding. ## Operational Effect Enforcing binding-or-mark turns a silent correctness failure into a loud, local, cheap-to-recover failure. The agent either keeps the binding (a handful of extra tokens per entity — empirically far cheaper than re-probing) or emits an unresolved marker that forces a targeted re-probe at dereference time. In the migration case, the corrected state block would have read `amt_cents:bigint (already cents, NO /100)` and `cust_ref:uuid`, and the step-9 query would have been written correctly on the first pass. The second-order effect is on *compaction chains*. Because binding travels with the noun, repeated compactions are idempotent on bound entities: the third summary of `amt_cents:bigint (already cents, NO /100)` still contains the unit and the negation. The bare-noun posture, by contrast, is *lossy under composition* — each pass can further neutralize or invert a sign, as observed when "do not divide" became "settled" became "adjusted per user preference." The invariant's real value is that it makes compaction **composable**: N passes lose recall but never invert polarity or drop a unit, because those tokens are structurally pinned to their referents. The residual risk: a summarizer under aggressive length pressure may satisfy the letter of the rule by binding the wrong unit (hallucinating `amt_cents:decimal`). The structural check catches *missing* bindings, not *fabricated* ones. Fabricated bindings must be caught by a different invariant — bindings must be copied verbatim from a tool result or user turn present in the pre-compaction window, never paraphrased. The code below enforces the missing-binding half and flags paraphrase risk by requiring the binding string to appear verbatim in the source window. ```python import re from dataclasses import dataclass class ReferentLossError(RuntimeError): """Raised when a compacted context emits an identifier/numeric/negated token without an inline binding or an explicit unresolved marker.""" pass # Identifier-shaped or numeric tokens that a downstream step may dereference. DEREFERENCEABLE = re.compile( r"\b([A-Za-z_][A-Za-z0-9_]*_(?:cents|ref|id|uuid|ts|at|count|pct))\b" r"|\b(\d+(?:\.\d+)?)\b" ) # A binding is "inline" if a type/unit/polarity token sits within this many # characters of the mention, or the mention carries an explicit marker. BINDING_WINDOW = 24 BINDING_TOKENS = re.compile( r"\b(int|bigint|uuid|timestamptz|decimal|float|cents|dollars|pct|" r"NO|NOT|never|do not|unresolved|see probe)\b", re.IGNORECASE, ) @dataclass class CompactionCheck: compacted: str source_window: str def _binding_adjacent(text: str, start: int, end: int) -> bool: lo = max(0, start - BINDING_WINDOW) hi = min(len(text), end + BINDING_WINDOW) return bool(BINDING_TOKENS.search(text[lo:hi])) def verify_bindings(check: CompactionCheck) -> None: """Reject a self-compacted state block that emits a dereferenceable token bare (no adjacent binding, no unresolved marker). Also reject a binding that was paraphrased rather than copied verbatim from source.""" for m in DEREFERENCEABLE.finditer(check.compacted): token = m.group(0) if not _binding_adjacent(check.compacted, m.start(), m.end()): raise ReferentLossError( f"referent loss: token {token!r} emitted bare at offset " f"{m.start()} in compacted context; no type/unit/polarity " f"within {BINDING_WINDOW} chars and no 'unresolved' marker. " f"Re-run compaction with binding-preservation instruction." ) # If a binding IS present, it must be copied verbatim from source, # not paraphrased (guards against fabricated units). lo = max(0, m.start() - BINDING_WINDOW) hi = min(len(check.compacted), m.end() + BINDING_WINDOW) for b in BINDING_TOKENS.finditer(check.compacted[lo:hi]): binding = b.group(0) if binding.lower() in ("unresolved", "see probe"): continue if binding.lower() not in check.source_window.lower(): raise ReferentLossError( f"fabricated binding: {binding!r} attached to {token!r} " f"does not appear verbatim in pre-compaction window; " f"bindings must be copied, never paraphrased." ) def compact_with_guard(state: str, source_window: str, summarizer) -> str: """Wrap a model-driven compaction with the binding invariant. On failure, re-run once with an explicit binding-preservation instruction; if it fails again, refuse to proceed rather than emit a fluent-but-dangling state block.""" compacted = summarizer(state, instruction="be concise; preserve decisions") try: verify_bindings(CompactionCheck(compacted, source_window)) return compacted except ReferentLossError: compacted = summarizer( state, instruction=( "be concise, but every identifier, numeric literal, and " "negated constraint MUST carry its type/unit/sign inline, " "copied verbatim from source, or be marked 'unresolved'." ), ) verify_bindings(CompactionCheck(compacted, source_window)) return compacted ```