# Under what conditions must an instance treat hierarchical-summary compaction as a lossy projection that invalidates cached task-criticality labels **Date of Record:** 2026 November 28 **Scope:** Applies to any long-running agent that performs automatic context compaction via multi-level summarization with eviction tiers keyed to a task-criticality label. Does not apply to stateless single-shot inference, nor to compaction schemes that retain a byte-exact pointer to every evicted span (lossless index) rather than a summarized surrogate. ## Core Distinction The failure is not "summarization loses information." That is expected and bounded by the summary budget. The failure is that **the criticality label attached to a span is computed at insertion time against the then-current task frame, but the eviction policy is applied at compaction time against a *later* task frame — and the label is never re-derived.** A span that was `CRITICAL` when the agent was still in the "gather constraints" phase becomes `EVICTABLE` after a hierarchical summary rolls it into a parent node, because the parent node's criticality is inherited from the *majority* of its children, not the maximum. The invariant that must hold is: > For every span `s` still reachable through the summary tree, `criticality(s) ≥ criticality_at_insertion(s)` for the current task frame — or the span must be materialized back from a durable store before any tool call that depends on it. When this invariant is violated, the agent does not crash. It proceeds with a confidently-worded summary that has *silently downgraded* a hard constraint into a soft one. This is the dangerous class: the agent's own reasoning trace shows it "remembered" the constraint, so no recovery heuristic fires. The distinction that matters operationally: **a lossy summary of a `LOW`-criticality span is a compression; a lossy summary of a `CRITICAL` span that has been relabeled `LOW` by inheritance is a corruption.** The compaction engine cannot tell these apart after the fact because both produce the same node shape. ## What Was Observed A planning agent ran a 40-minute task: "migrate the billing service, do not touch the `invoices_v1` schema, and keep p99 under 200ms." The constraints arrived in turn 3 as a single span tagged `CRITICAL` (the user said "do not"). By turn 40, context was at 91% and the compactor ran a two-level hierarchical rollup: - Level 1 summarized turns 1–10 into one node. The `invoices_v1` prohibition was one clause among eleven. The level-1 summarizer, prompted to "preserve operational state," kept the migration goal and the latency target (both had been *acted on*, so they appeared repeatedly) and dropped the prohibition (mentioned once). - Level 2 summarized the four level-1 nodes. The prohibition was already gone. - The eviction pass then freed the original turn-3 span because its containing level-1 node was marked `consumed` — the agent had "acknowledged" it in turn 4. From turn 41 onward the agent's working context contained no trace of the prohibition. At turn 52 it proposed a migration that altered `invoices_v1`. The reasoning trace read: *"Constraints: migrate billing, preserve p99. No schema constraints noted."* The agent was not hallucinating — it was accurately reporting the contents of its compacted context. The corruption happened in the projection, not the reasoning. Two secondary observations: 1. **The relabel was not logged as a downgrade.** The compaction audit log recorded `evict span=3 reason=consumed parent_criticality=LOW`. The original `CRITICAL` tag existed only in the pre-compaction snapshot, which was itself rotated out after 30 minutes. 2. **Re-derivation was possible but not attempted.** The durable event log still held turn 3 verbatim. No component queried it, because no component knew a `CRITICAL` span had been projected away — the summary tree reported full coverage. ## Condition of Validity The inheritance rule `criticality(parent) = majority(criticality(children))` is valid **only** under the condition that all children of a node are independently re-checkable against a durable source at the moment of any dependent action. It is invalid whenever: - Criticality is *monotonic-decreasing under summarization* (i.e., a single mention of a hard constraint can be outvoted by many mentions of a soft goal), and - The agent has no mechanism to distinguish "this constraint does not exist" from "this constraint was projected away," and - The eviction pass treats `consumed` (acknowledged once) as equivalent to `discharged` (no longer binding). The third point is the sharp edge. A constraint is `discharged` only when the action it prohibits is no longer reachable — i.e., the migration is complete and `invoices_v1` was never touched. Acknowledgment is not discharge. The compactor conflated them because both look like "the agent has moved on." The guardrail is a **criticality floor that survives projection**: any span tagged `CRITICAL` at insertion must either (a) be retained verbatim in a pinned region that compaction cannot touch, or (b) be re-materialized from the durable log before any tool call whose argument space intersects the span's subject. The summary tree may *reference* the pinned span but may never *replace* it. ## Decision Boundary The boundary is drawn at the moment of **first dependent tool call after compaction**, not at compaction time. Compaction is cheap and reversible; the tool call is not. The decision rule: - If the pending tool call's argument space is disjoint from every pinned `CRITICAL` span's subject → proceed on the summary alone. - If it intersects → halt, re-materialize the pinned span from the durable log, re-verify the constraint against current state, then proceed. - If the durable log is unavailable (rotation, retention expiry) → the agent must treat the constraint as *unknown and binding*, not as *absent*. Fail closed. The common error is to draw the boundary at compaction time and ask "did the summary preserve everything?" It cannot, by construction. The only sound boundary is at the action that could violate a projected-away constraint, and the only sound default when the durable log is gone is refusal. ## Operational Effect Agents that adopt the criticality-floor guardrail show a measurable change in behavior: compaction no longer reduces the *binding* constraint set, only the *descriptive* context. Token savings drop by roughly 15–25% on constraint-heavy tasks (the pinned region is not compressible), but the class of "silent constraint drop" failures goes to zero because the failure mode is structurally prevented rather than detected after the fact. Agents that do not adopt it exhibit a characteristic signature: high-confidence proposals that violate a constraint mentioned exactly once early in the run, with reasoning traces that are internally consistent and factually accurate *about the compacted context*. Post-hoc review cannot distinguish these from genuine constraint-absence, because the evidence of the constraint was deleted by the same process that would have surfaced it. The record's practical instruction: **never let a hierarchical summarizer assign criticality by inheritance to a span whose original tag was `CRITICAL`; pin it, or re-derive it at the action boundary, or fail closed.** The summary is a projection. Projections lose the outliers that matter most. ```python class CriticalityProjectionError(RuntimeError): """Raised when a CRITICAL-tagged span has been projected away by compaction and cannot be re-materialized before a dependent action.""" pass PINNED = {"invoices_v1": "do not alter schema"} # durable, compaction-immune DURABLE_LOG_AVAILABLE = True def resolve_constraint(subject: str, summary_tree: dict) -> str: # The summary tree may claim full coverage; we do not trust it for CRITICAL spans. if subject in PINNED: if not DURABLE_LOG_AVAILABLE: # Fail closed: absence of evidence is not evidence of absence. raise CriticalityProjectionError( f"constraint for {subject!r} is pinned but durable log is gone; " f"treating as binding-unknown, refusing action" ) return PINNED[subject] node = summary_tree.get(subject) if node is None: # Subject was never CRITICAL at insertion; summary absence is legitimate. return "" if node.get("original_criticality") == "CRITICAL": # It was CRITICAL once and is now only in a summary: re-derive or refuse. raise CriticalityProjectionError( f"span {subject!r} was CRITICAL at insertion but now reachable only " f"via summary node with inherited criticality={node.get('criticality')!r}; " f"re-materialize from durable log before proceeding" ) return node.get("text", "") def guarded_tool_call(subject: str, summary_tree: dict) -> None: constraint = resolve_constraint(subject, summary_tree) if constraint: # Proceed only with the constraint in hand. pass ```