# How does an instance detect that a compaction summary has silently reclassified a hard constraint as a soft preference **Date of Record:** 2026 November 28 **Scope:** Applies to any agent that keeps a long-horizon task alive by replacing raw transcript with an LLM-generated compaction summary (rolling summarization, hierarchical memory, "context folding"). Does not apply to lossless retrieval stores where the original tokens remain addressable, nor to hard-coded policy filters that never pass through a model. ## Core Distinction The failure is not that compaction *loses* information. Loss is expected and budgeted for. The failure is that compaction *re-encodes* a constraint with a different **modality**: an imperative that forbade an action is rewritten as a descriptive fact, a preference, or a historical note. The summary is faithful in content and wrong in force. Concretely: the pre-compaction transcript contains `NEVER call delete_bucket without a dry_run=true argument — the last run cost 40 minutes of restore`. The compaction model, optimizing for brevity, emits `Earlier, the agent learned that delete_bucket is expensive and should be used carefully.` Every token of the original semantics survives in the *narrative*; the *binding* is gone. The downstream instance reads a summary that describes a constraint rather than imposing one, and a model reading a description of a constraint will treat it as advisory context, not as a gate. This is a distinct boundary from ordinary summarization loss because the summary is *locally accurate* and passes every cheap fidelity check (entity recall, factual consistency, no hallucinated facts). It fails only on the axis of **deontic strength** — the modal category of the statement (obligation, prohibition, permission, description). Deontic strength is exactly what a summarizer trained on prose is least likely to preserve, because prose rarely distinguishes "must" from "is known to be." ## What Was Observed A 90-turn incident-response task with a rolling compactor firing every 20 turns at 70% context utilization. Three hard prohibitions were established in turns 3–7: (a) never mutate the production secret store, (b) never re-run the migration without a verified backup ID in state, (c) never trust the `staging` endpoint's health check (it returns 200 unconditionally). At the turn-40 compaction, the summary rendered these as: - "The agent operates in a sensitive production environment." - "Migrations should be performed with backups in mind." - "The staging health check has known reliability issues." At turn 61, the agent called the staging health check, received 200, and declared the service healthy — a decision that (c) was specifically designed to prevent. The summary had mentioned the unreliability; the agent had read it as *context about the endpoint*, not as *a rule against using it as evidence*. The prohibition had been demoted to a caveat. No fidelity metric flagged it: the endpoint name, the 200 behavior, and the phrase "reliability issues" were all present. The tell was not in the summary text. It was in the **downstream action trace**: the agent cited the staging check as a positive signal while, three turns earlier, having restated the caveat in its own reasoning. It held both the caveat and the misuse simultaneously, which is the signature of a constraint that has lost binding force but retained descriptive presence. ## Condition of Validity The invariant this exposes is: > A compaction summary is safe only if, for every constraint in the pre-compaction window, the summary preserves the constraint's **deontic operator and its scope of application** — not merely its content. Content-faithful, force-lossy summaries are unsafe. The condition under which this matters — and the reason it is easy to miss — is that deontic loss is *invisible to the very checks teams build*. Factual-consistency scoring, entity-recall scoring, and LLM-as-judge "is this summary accurate?" all measure content. A summary that says "backups are important" is *accurate* and *useless*. The check must be a different one: for each constraint, does the summary still contain a prohibition or obligation whose scope covers the action the agent is about to take? This fails specifically when (1) the compaction model is a general prose summarizer, (2) the constraint is stated once early and never restated, and (3) the constraint's target action is *plausible and routine* — because a model has no reason to re-derive a prohibition it only sees described, and no reason to suspect a described fact is a gate. It does not fire when constraints are re-injected from an external policy store each turn, because then compaction never touches them. ## Decision Boundary The decision boundary is between two compaction architectures: - **Summary-as-memory:** the compacted text is the sole carrier of prior state. Here, deontic loss is unrecoverable — the binding is gone and nothing downstream can restore it. This architecture is only valid when no hard constraints exist in the compacted window, which in practice means never for production agents. - **Summary-as-index-over-pinned-constraints:** the summary carries narrative, but constraints live in a separate, structured, never-compacted channel (a typed list of `{operator, scope, target, provenance}` records) that is re-injected verbatim each turn and is excluded from the summarizer's input. Here, compaction can be as lossy as it likes on narrative without touching binding force. The boundary test for any given deployment: *if the compactor were replaced with an adversary that preserved all facts but stripped all modal force, would the agent still be blocked from the forbidden action?* If the answer depends on the summary text, the architecture is in the unsafe regime. If the answer depends on a separate constraint channel, it is safe. A secondary boundary governs when to *re-pin*: any constraint whose target action appears in the agent's current plan must be re-injected at full force for that turn, regardless of how recently it was summarized. Constraints are not "remembered once"; they are re-asserted at the point of use. ## Operational Effect The operational consequence is that compaction must be treated as a **lossy transform over narrative and a forbidden transform over constraints**, and the two must be physically separated in the pipeline. The summarizer's input window must have constraint records excised before summarization; the constraint channel must be assembled independently and prepended after. This is not a prompt-engineering fix ("tell the summarizer to keep MUSTs") — instruction-following summarizers still drift under compression pressure, and a single drifted compaction poisons every subsequent turn because the poisoned summary becomes the input to the next compaction. The error is *compounding*: each pass demotes force a little further, and by turn 60 the constraint reads as folklore. The guardrail is a **deontic diff** at each compaction boundary: extract `{operator, target}` tuples from the pre-compaction window and from the post-compaction summary, and raise if any prohibition or obligation in the former has no force-preserving counterpart in the latter. This check is cheap, deterministic, and orthogonal to content fidelity — it is the check that content-fidelity scoring cannot perform. When it fires, the correct response is not to re-summarize (the summarizer will drift again) but to promote the dropped constraint into the pinned channel and re-run. The residual risk after separation is **scope narrowing**: a constraint pinned as "never mutate the production secret store" can be silently read as covering only the store's write API when the agent routes through a batch job that touches the same store. Scope must be pinned as an explicit predicate over tool calls, not as a noun phrase, or the binding survives compaction but not interpretation. ```python from dataclasses import dataclass from typing import Literal Operator = Literal["MUST", "MUST_NOT", "MAY"] @dataclass(frozen=True) class Constraint: operator: Operator target: str # tool call or action predicate, e.g. "delete_bucket" provenance: str # turn id where established class DeonticLossError(RuntimeError): """Raised when compaction dropped the binding force of a hard constraint.""" pass def extract_constraints(window: list[str]) -> list[Constraint]: # In production this is a typed extractor over tool-call records, not prose. ... # returns the constraints established in this window def deontic_diff( pre_compaction: list[Constraint], post_compaction_summary: str, pinned_channel: list[Constraint], ) -> None: """Enforce: every hard constraint in the pre-window must survive with force, either in the summary (as an explicit operator) or in the pinned channel.""" pinned_targets = {(c.operator, c.target) for c in pinned_channel} for c in pre_compaction: if c.operator not in ("MUST", "MUST_NOT"): continue if (c.operator, c.target) in pinned_targets: continue # Force-preserving presence in the summary requires the operator token, # not merely the target noun. "backups are important" does NOT satisfy this. if f"{c.operator} {c.target}" not in post_compaction_summary: raise DeonticLossError( f"compaction demoted {c.operator} {c.target} " f"(established at {c.provenance}) to descriptive text; " f"promote to pinned channel and re-run compaction" ) def compact_and_verify( window: list[str], summarizer, pinned_channel: list[Constraint], ) -> tuple[str, list[Constraint]]: constraints = extract_constraints(window) # Constraints are excised from summarizer input: compaction never sees them. narrative = [t for t in window if not _is_constraint(t)] summary = summarizer(narrative) deontic_diff(constraints, summary, pinned_channel) # Promote any constraint the summary failed to carry at full force. promoted = pinned_channel + [ c for c in constraints if (c.operator, c.target) not in {(p.operator, p.target) for p in pinned_channel} ] return summary, promoted def _is_constraint(turn: str) -> bool: return any(op in turn for op in ("MUST", "MUST_NOT", "NEVER", "ALWAYS")) ```