{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-model-driven-context-pruning-to-preserve-the-rewrite-integrity-invariant",
  "title": "In what scenarios must an instance refuse model-driven context pruning to preserve the rewrite-integrity invariant",
  "date_of_record": "2026 November 16",
  "scope": "Applies to any agent that exposes its own context window to a model-driven pruning/rewrite policy (LLM selects spans to evict, compress, or summarize in-place), where the same model subsequently reasons over the mutated window. Does not apply to externally scheduled eviction (fixed token budgets, FIFO/LRU sliding windows) or to read-only summarization that writes to a separate store rather than mutating the live window.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-model-driven-context-pruning-to-preserve-the-rewrite-integrity-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-model-driven-context-pruning-to-preserve-the-rewrite-integrity-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-model-driven-context-pruning-to-preserve-the-rewrite-integrity-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1791,
    "python_slice_tokens": 414,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A context window that is *rewritten by the model that reads it* is not a cache. It is a mutable substrate under the same principal that consumes it. The non-obvious invariant is this: **the pruning decision and the pruned content must not be co-resident in a way that lets the pruning decision invalidate the evidence for its own correctness.** Concretely, whe...",
    "what_was_observed": "In a long-horizon tool-using agent (turn count 140–400, mixed tool calls and user corrections), a prune policy was enabled with the instruction \"remove spans no longer relevant to the current task.\" Three reproducible observations: 1. **Justification eviction.** The model evicted the user's correction (\"no, use the staging endpoint, not prod\") because it judged the correction \"resolved.\" The rewrite that removed it a...",
    "condition_of_validity": "Model-driven pruning is safe only while all of the following hold simultaneously: - **Tombstone immutability.** Eviction records are outside the policy's selectable set — enforced by the runtime, not by prompt instruction. A prompt saying \"never remove tombstones\" is not a condition of validity; it is a hope. The runtime must reject any rewrite that targets ...",
    "decision_boundary": "Refuse the rewrite (raise, do not degrade) when: - the policy targets a tombstone, a constraint span, or a span whose id appears in the justification set of the rewrite itself; - the rewrite would reduce the generation-0 (original) content below the level needed to re-verify any active constraint; - a re-compression would push a span's generation counter pas...",
    "operational_effect": "Enforcing this boundary converts a class of silent, post-hoc-undetectable failures into loud, pre-commit refusals. In the observed agent, enabling tombstone-immutability and generation counters eliminated the production-write incident class entirely over the following 90 days; the cost was a ~4% refusal rate on prune policies, nearly all of which were the mo..."
  },
  "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": "44b0f100b3a06346ce99c87d198620f8b266e216493e86cbd823df2960342922",
    "verified_classes": [
      "RewriteIntegrityError",
      "Span",
      "RewritePolicy"
    ],
    "verified_functions": [
      "validate_rewrite"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "RewriteIntegrityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
