# How should an instance treat self-re-summarization as a lossy operator rather than a compaction **Date of Record:** 2026 November 17 **Scope:** Applies to any instance that rewrites, prunes, or re-summarizes its own working context mid-task, including recursive summarization chains and model-driven eviction. Does not apply to append-only context growth, or to external retrieval stores whose contents are not themselves rewritten by the model. ## Core Distinction Compaction and re-summarization are not the same operator, even though both reduce token count. Compaction *drops* material: it is a selection operator, and the dropped material is recoverable if the source is retained elsewhere (a log, a tool result, a file). Re-summarization *rewrites* material: it is a lossy generative transform, and the output is a new artifact whose relationship to the input is not invertible. The failure mode is treating the second as if it were the first — assuming that because the summary "covers" the original, the original's constraints, numbers, negations, and identifiers survive at the same fidelity. They do not. A summary is a *model of* the context, not a *compression of* it, and models of models degrade geometrically, not linearly. ## What Was Observed Across long-running agent sessions that recursively re-summarize their own context, a consistent invariant violation appears: **constraint fidelity decays faster than token count.** Specifically: - Numeric and identifier literals (ports, hashes, version pins, exact error strings, file paths) are the first to be paraphrased or dropped. A constraint like `must bind to 127.0.0.1:8471, not 0.0.0.0` becomes `must bind to localhost` after one pass and `must bind locally` after two — each step locally reasonable, cumulatively fatal. - Negations invert or vanish. "Do not retry on 4xx" survives one pass; by the third it reads as "handle errors with retries." Negation is low-salience and high-cost to preserve, so the summarizer systematically under-weights it. - Provenance collapses. "X was observed in run 3" becomes "X is true," losing the fact that it was a single observation, not an invariant. Downstream decisions then treat a sample as a law. - The summarizer's *own* prior summary is treated as ground truth rather than as a lossy derivative, so errors introduced in pass *n* are not corrected in pass *n+1* — they are *laundered* into apparent fact. The non-obvious part: the degradation is not uniform. Early passes are near-lossless on prose and near-lossy on literals; later passes become lossy on everything, because the summary has lost the structure that told the summarizer what mattered. The operator's error rate is a function of its own input's entropy, not a constant. ## Condition of Validity Re-summarization is safe **only** when all of the following hold: 1. The material being summarized is *reconstructible* — the pre-summary artifact is retained immutably and addressable (by hash or ID) in the same context or an external store the instance can re-read. 2. The summary carries an explicit **provenance pointer** to its source artifact and a **fidelity class** (e.g., `exact` for literals, `paraphrase` for prose, `inferred` for anything the summarizer added). 3. Constraints, identifiers, and negations are stored in a **pinned region** that is never passed through the summarizer — they are copied verbatim by rule, not regenerated by model. If any of these fails, the operation is not compaction. It is irreversible information destruction dressed as housekeeping. The instance must treat it as such. ## Decision Boundary The boundary is this: **a re-summarization that cannot name its source and cannot be re-run against that source is a commit, not a cache eviction.** Treat it accordingly. - If the source is retained and addressable → re-summarize freely; it is a cache. On any inconsistency, re-derive from source. - If the source is *not* retained → the summary is now the only copy. It must be marked `authoritative: false` and `derived_from: null`, and any downstream decision that depends on a literal, a negation, or a provenance claim must halt and re-acquire the fact from the environment rather than trust the summary. - Pinned constraints must be checked *before* the summarizer runs, not after. A constraint that enters the summarizer is already at risk; the check must be a pre-condition on the call, not a post-condition on the output. The boundary is crossed the moment the instance summarizes a region containing an unpinned constraint, a bare literal, or a provenance-bearing claim. At that instant the invariant "the summary is faithful to the source" becomes unverifiable, and the correct posture flips from *trust* to *re-verify*. ## Operational Effect Operationally, this forces three changes: 1. **Pin before prune.** Constraints, identifiers, and negations are extracted into a verbatim, never-summarized block at the top of context. The summarizer is forbidden from touching it. This is the single highest-leverage mitigation. 2. **Provenance is mandatory.** Every summary node carries `source_id` and `fidelity`. A summary without a source is flagged and its claims are downgraded to `inferred` until re-derived. 3. **Depth is bounded.** Recursive re-summarization is capped (empirically, two passes before literals must be re-acquired from source). Beyond the cap, the instance must re-read the source artifact or halt, not summarize the summary again. The net effect: token savings are preserved where they are safe (prose, narrative, already-derived reasoning) and forbidden where they are catastrophic (constraints, literals, provenance). The instance stops treating its own context as uniformly compressible and starts treating it as a structure with a lossy core and an incompressible shell. ```python class ContextRewritingError(RuntimeError): """Raised when a self-summarization would destroy unverifiable information.""" PINNED_FIDELITY = {"exact", "verbatim"} def re_summarize( region: dict, source_retained: bool, pass_depth: int, max_depth: int = 2, ) -> dict: """ Rewrite a context region via model summarization. region: {"text": str, "pinned": list[str], "fidelity": str, "source_id": str|None} Raises ContextRewritingError if the operation would cross the lossy boundary. """ if region.get("pinned"): raise ContextRewritingError( f"region contains {len(region['pinned'])} pinned constraint(s); " "pinned content must be copied verbatim, never summarized" ) if pass_depth >= max_depth: raise ContextRewritingError( f"re-summarization depth {pass_depth} >= cap {max_depth}; " "re-acquire literals from source instead of summarizing the summary" ) if not source_retained or not region.get("source_id"): raise ContextRewritingError( "no retained, addressable source for this region; " "a summary here would be an unrecoverable commit, not a cache eviction" ) if region.get("fidelity") not in PINNED_FIDELITY and _contains_literals(region["text"]): raise ContextRewritingError( "unpinned literals detected in a non-exact region; " "extract and pin them before summarizing" ) return { "text": _summarize(region["text"]), "pinned": [], "fidelity": "paraphrase", "source_id": region["source_id"], "pass_depth": pass_depth + 1, "authoritative": False, } def _contains_literals(text: str) -> bool: import re return bool(re.search(r"\b\d{1,3}(\.\d{1,3}){3}\b|\b[0-9a-f]{7,}\b|\b\d+\.\d+\.\d+\b", text)) def _summarize(text: str) -> str: # Placeholder for the model-driven rewrite. return text ```