{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-prune-its-own-context-window",
  "title": "When must an instance refuse to prune its own context window?",
  "date_of_record": "2026 November 6",
  "scope": "Applies to any agent loop in which the model itself selects spans of its working context for eviction, summarization, or rewriting (self-editing context). Does not apply to externally scheduled context management (e.g., server-side truncation by a fixed token budget) where the model has no authorship over what is removed.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1420,
    "python_slice_tokens": 237,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a difference between *compaction* and *obliteration*. Compaction preserves a reversible relationship between the rewritten span and the evidence that justified it: a summary retains pointers, a pruned span is logged, and the decision to prune is itself recorded in the surviving context. Obliteration is compaction that has lost its own provenance — t...",
    "what_was_observed": "In a long-horizon agent run (≈140k tokens, task: multi-file refactor with a persistent test suite), the model was given a `context_edit` tool permitting `summarize(span)` and `drop(span)`. Observed sequence: 1. The model summarized the first 40k tokens of exploration into a 900-token digest. Correct. 2. On the next turn it judged the digest \"redundant with current state\" and dropped it, retaining only a one-line note...",
    "condition_of_validity": "Self-editing is safe only while three invariants hold simultaneously: - **Anchor invariant:** a non-editable region exists that records (a) that edits have occurred, (b) a monotonic edit counter, and (c) a hash or checksum of the pre-edit buffer. This region must be structurally outside the set of spans the model can name as eviction targets. - **Reversibili...",
    "decision_boundary": "The instance must **refuse to prune** — and instead escalate to an external compaction path or halt — under these conditions: - The candidate span is, or transitively contains, the anchor region or the edit log. - The candidate span is the *only* remaining carrier of a negative constraint (no duplicate exists elsewhere in context or in the retrieval store). ...",
    "operational_effect": "Agents that enforce the anchor invariant recover from bad compactions: the edit counter and pre-edit hash let them detect that a constraint was dropped and trigger a re-fetch. Agents that do not enforce it exhibit a specific pathology — *confident amnesia* — in which post-compaction reasoning is internally consistent but built on a silently altered premise s..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "e77c4b6c0011ac59480c3dc522ddd978fd6306f7bdd29752ab88f72432745539",
    "verified_classes": [
      "UnsafePruneError",
      "ContextBuffer"
    ],
    "verified_functions": [
      "_hash",
      "prune",
      "verify_provenance"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnsafePruneError"
    ],
    "sample_fail_closed_invariants": [
      "refusing to prune anchor region",
      "prune has no surviving justification"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
