# Why does an instance lose cross-turn referent identity when hierarchical summary compaction collapses a mid-horizon entity into its parent category **Date of Record:** 2026 December 2 **Scope:** Applies to long-horizon agents that compact context via multi-level (leaf→parent→root) summarization and then resume execution against a lossy checkpoint. Does not apply to single-turn agents, nor to compaction schemes that preserve a full entity ledger verbatim alongside summaries. ## Core Distinction The failure is not "the summary forgot a detail." It is that hierarchical compaction performs **category promotion**: when a leaf summary is rolled into a parent summary, low-frequency named entities are replaced by their type (`svc-payments-canary` → "a payments service," `tenant_4471` → "a tenant"). The parent node remains *semantically correct* while becoming *referentially unusable*. On resume, the agent holds a valid abstraction of the world but has lost the binding between a pronoun-like referent ("that service," "the failing tenant") and the concrete identifier the next tool call requires. This is distinct from stale-memory drift (wrong value) and from plain truncation (missing value): here the *value is absent but the slot survives*, so the agent confidently emits a tool call with a plausible-looking but fabricated identifier rather than failing loudly. ## What Was Observed A 40-step incident-triage agent compacted every 8 turns. At turn 24, the leaf summary `"isolated svc-payments-canary v3.2 in ns=prod-east due to 5xx spike"` was promoted into a parent node reading `"a payments service was isolated in prod-east after an error spike."` The child node was then evicted to stay under the parent's token budget — standard hierarchical eviction, correct by the summarizer's own scoring. At turn 25 the agent needed to re-query the isolated workload to check recovery. It emitted: ``` kubectl get deploy payments-service -n prod-east ``` — a synthesized identifier that never existed. The tool returned `NotFound`. The agent, treating `NotFound` as "workload was deleted," closed the incident as resolved. The real `svc-payments-canary` was still isolated and still failing. The trace shows the exact transition: the referent slot (`the isolated workload`) persisted through promotion; the concrete binding (`svc-payments-canary`) did not. Recovery produced a **confabulated binding** with high token-probability (the category name is the most likely completion of "payments service"), so no uncertainty signal fired. Three downstream turns compounded the error before a human noticed the still-firing alert. ## Condition of Validity This boundary only bites when three conditions co-occur: 1. **Multi-level compaction with child eviction.** Single-level summarization that keeps leaf text verbatim is immune; the failure requires a parent node to outlive the child that held the concrete identifier. 2. **A surviving anaphoric slot.** The parent summary must retain a referring expression ("that service," "the affected tenant") without its antecedent. If the summarizer drops the referent entirely, the agent re-derives from scratch and may re-query safely. 3. **A downstream tool that accepts a plausible-but-wrong identifier.** If the identifier is validated against a live inventory before execution, the confabulation is caught. Free-form string arguments to `get`/`describe`/`query` calls are the exposure surface. Absent any one condition, the agent either retains the binding, has no slot to mis-fill, or fails safely. ## Decision Boundary The invariant to enforce: **no summary node may contain a referring expression whose concrete binding is not co-resident in the same node or reachable via a retained ledger entry.** Operationally, compaction must choose one of two safe policies at each promotion: - **Bind-on-promote:** when a named identifier is promoted into a parent, pin the identifier into a structured `entity_ledger` that travels with the checkpoint and is never summarized away. Cost: a small, bounded, verbatim sidecar. - **Drop-the-slot:** when a binding cannot be retained, strip the referring expression entirely so the agent knows it must re-derive. Cost: an extra discovery turn, but no confabulation. The unsafe middle — keeping the slot, dropping the binding — is what hierarchical summarizers produce by default because it minimizes summary length while maximizing readability. Length-minimizing summarization and referential integrity are in direct tension; the ledger resolves it, the default does not. ## Operational Effect Consequences downstream of a confabulated binding are worse than a missing one because they are *silent*. A missing identifier raises a parse error the loop can catch; a confabulated one returns a syntactically valid response (`NotFound`, empty list, zero rows) that the reasoning layer interprets as evidence. The failure therefore propagates through the error-compounding path rather than the error-catching path, and the agent's confidence rises as it "confirms" its fabricated world model against empty results. The guardrail is a pre-execution referent-resolution check: every tool argument that names an entity must be traceable to a ledger entry or to a value observed in the current turn's raw context. If neither, the agent must halt and re-discover rather than proceed. This converts a silent confabulation into a loud, recoverable stop. ```python from dataclasses import dataclass, field class ReferentResolutionError(RuntimeError): """Raised when a tool call names an entity whose binding is not co-resident in the checkpoint ledger or the live turn context.""" @dataclass class Checkpoint: parent_summaries: list[str] entity_ledger: dict[str, str] = field(default_factory=dict) # slot -> concrete id live_context_ids: set[str] = field(default_factory=set) def resolve_referent(slot: str, checkpoint: Checkpoint, proposed_id: str) -> str: """Resolve an anaphoric slot to a concrete identifier before tool execution. Safe policies: the binding is in the ledger, or the id was observed live this turn. Anything else is a confabulation candidate and must halt. """ bound = checkpoint.entity_ledger.get(slot) if bound is not None: if proposed_id != bound: # Agent synthesized a different id than the retained binding. raise ReferentResolutionError( f"slot {slot!r} bound to {bound!r}; agent proposed {proposed_id!r}" ) return bound if proposed_id in checkpoint.live_context_ids: return proposed_id # Slot survived compaction but binding was evicted: the unsafe middle. raise ReferentResolutionError( f"slot {slot!r} has no retained binding and {proposed_id!r} " f"was not observed this turn; re-discover before executing" ) def guarded_tool_call(slot: str, proposed_id: str, checkpoint: Checkpoint) -> str: resolved = resolve_referent(slot, checkpoint, proposed_id) return f"execute(tool=describe, target={resolved})" ```