{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-compact-anchor-collision-invalidation-in-lossless-recall-auto-compaction",
  "title": "When must an instance refuse to compact: anchor-collision invalidation in lossless-recall auto-compaction",
  "date_of_record": "2026 December 1",
  "scope": "Applies to long-horizon agent sessions that auto-compact their own context window by replacing a span of turns with a summary and preserving a set of \"lossless recall anchors\" (verbatim spans that must remain byte-identical and retrievable). Does not apply to single-turn sessions, stateless tool-call wrappers, or compaction schemes that discard all verbatim history and rely solely on semantic summaries.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-anchor-collision-invalidation-in-lossless-recall-auto-compaction.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-anchor-collision-invalidation-in-lossless-recall-auto-compaction.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-compact-anchor-collision-invalidation-in-lossless-recall-auto-compaction.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1898,
    "python_slice_tokens": 379,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the summarizer lost information.\" It is **anchor-collision invalidation**: an auto-compaction pass produces a summary that *paraphrases or quotes* content which is also registered as a lossless recall anchor, and the resulting summary text is later retrieved as if it were the anchor. The distinction that matters operationally is between *...",
    "what_was_observed": "A coding agent ran a 340-turn session. At turn 210 it auto-compacted turns 1–180 into a 900-token summary and registered 14 anchors, including an exact config block, a regex, and two file paths. The compactor was instructed to \"preserve all critical details verbatim where possible.\" It complied *too* well: the summary included a fenced block reproducing the config anchor and a sentence quoting the regex. At turn 268 ...",
    "condition_of_validity": "The invariant holds — and auto-compaction is safe — only when all three conditions are simultaneously true: - **Excision, not preservation.** Anchored spans are removed from the compactor's input window *before* summarization, and the summary is assembled with explicit placeholder references (`[anchor:A7]`) rather than reproduced content. If anchors remain i...",
    "decision_boundary": "The decision the runtime must make at each compaction is not \"should I compact?\" but **\"is this compaction pass anchor-safe?\"** The boundary is sharp: - If the anchor set is empty, compact freely; no invariant to violate. - If anchors exist and the compactor input has been excised and replaced with placeholders, and the summary schema forbids literal reprodu...",
    "operational_effect": "Enforcing the invariant changes three operational properties: 1. **Compaction becomes rejectable.** Roughly 4–7% of compaction passes in anchor-dense sessions fail the post-generation scan on first attempt and must retry with tighter excision. This is a latency cost paid at compaction time, not a correctness cost paid at execution time. The trade is correct...."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "0aa7d89decde41df14adac63b41cc99516c4e53cb6dede340df5dc8218f3ad95",
    "verified_classes": [
      "AnchorCollisionError",
      "StaleSnapshotError",
      "Anchor",
      "CompactionInput",
      "CompactionSummary"
    ],
    "verified_functions": [
      "validate_compaction",
      "compact"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "AnchorCollisionError",
      "StaleSnapshotError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
