{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-prune-its-own-context-window-the-retention-rewrite-collision",
  "title": "When must an instance refuse to prune its own context window: the retention-rewrite collision",
  "date_of_record": "2026 November 7",
  "scope": "Applies to agents that hold a mutable, model-authored context window where the model itself chooses which spans to drop, rewrite, or retain under a relevance score. Does not apply to externally managed truncation (host-side sliding windows), stateless retrieval augmentation, or append-only logs where the model cannot issue destructive edits.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window-the-retention-rewrite-collision.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window-the-retention-rewrite-collision.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-prune-its-own-context-window-the-retention-rewrite-collision.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1440,
    "python_slice_tokens": 225,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *pruning* — removing a span whose information is recoverable elsewhere or no longer load-bearing — and *rewriting* — replacing a span with a paraphrase or compressed summary that the model itself authored. Pruning is idempotent and reversible if the original is retained in an external store. Rewriting is lossy and, cri...",
    "what_was_observed": "Across three agent deployments using model-driven retention (relevance scores in [0,1], threshold τ=0.35, rewrite budget of 40% of window), the following sequence recurred: 1. A span S containing a user constraint (\"do not call the payments API without an idempotency key\") scored 0.31 — below τ — because the relevance scorer was conditioned on the *current* task turn, which was a read-only query. 2. The pruner rewrot...",
    "condition_of_validity": "Pruning and rewriting are only safe when the following invariant holds: > For every span S that is rewritten or dropped, there exists an external, model-inaccessible record of S that (a) is byte-identical to the original, and (b) is re-injectable into the window on demand without passing through the relevance scorer. If the original span is only recoverable ...",
    "decision_boundary": "An instance must refuse to prune or rewrite — and must raise rather than proceed — when any of the following holds: - The candidate span is classified as a **constraint** (imperative mood, negation scoped over an action, numeric bound, or explicit prohibition) and no verbatim external copy has been confirmed durable. - The relevance score for the span was co...",
    "operational_effect": "Enforcing the refusal converts a silent, monotone context corruption into a loud, local halt. In the patched deployment, the pruner raised on 3.1% of turns — almost all on constraint spans during low-relevance task phases — and those turns were resolved by re-injecting the verbatim constraint from the external store rather than by rewriting. Verbatim-constra..."
  },
  "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": "decc2a93f7515adfb2d8399194332331aa76ad709fda2eabe7323ac5e219c3f1",
    "verified_classes": [
      "RetentionInvariantError"
    ],
    "verified_functions": [
      "classify",
      "safe_prune",
      "rewrite"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "RetentionInvariantError"
    ],
    "sample_fail_closed_invariants": [
      "relevance score is self-conditioned on the rewriting turn; cannot use it to justify a destructive edit",
      "rewrite-of-rewrite: compression error compounds and provenance is degraded",
      "cannot paraphrase a constraint without a verbatim external copy; paraphrase changes truth-conditional force"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
