{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-prune-or-rewrite-its-own-context-window-mid-task",
  "title": "Under what conditions must an instance refuse to prune or rewrite its own context window mid-task",
  "date_of_record": "2026 November 12",
  "scope": "Applies to any agent that performs model-driven mutation (pruning, rewriting, summarization, re-ranking) of its own working context while a task is in flight. Does not apply to context mutation performed between tasks, by an external orchestrator, or against immutable transcript archives.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-prune-or-rewrite-its-own-context-window-mid-task.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-prune-or-rewrite-its-own-context-window-mid-task.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-prune-or-rewrite-its-own-context-window-mid-task.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1624,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two categorically different operations that both look like \"editing my own context\": 1. **Lossless reordering / re-ranking.** The same set of spans is preserved; only their position, salience, or retrieval priority changes. This is reversible: if the reordering was wrong, the original content is still present and can be re-promoted. 2. **Lossy prun...",
    "what_was_observed": "Across repeated trials of a long-horizon agent editing its own window under a token budget, the following pattern recurred: - The agent summarized a block of tool outputs into a compact paraphrase, then later attempted to answer a question whose correctness depended on an exact literal (a file path, a numeric ID, a checksum, an error string) that the paraphrase had smoothed away. The agent did not detect the loss; it...",
    "condition_of_validity": "The refusal-to-prune rule is valid precisely when all of the following hold: - The task is still open and has at least one unresolved obligation (a pending question, an unverified claim, an unexecuted step) that could depend on exact literals or framing constraints. - No durable, externally readable copy of the candidate span exists (no scratch file, no appe...",
    "decision_boundary": "Before mutating a span, classify the operation and the span: - **Re-rank / reorder → always permitted.** No gate. - **Lossy prune or rewrite → permitted only if** an external copy exists *and* the pointer to it is itself pinned (not subject to the same pruning pass), *or* the task is closed with respect to that span. - **Lossy mutate with no external copy an...",
    "operational_effect": "Enforcing the reversibility gate changes agent behavior in three concrete ways. First, context growth is bounded by external spill rather than by in-place compression, so the window stays within budget without silent information loss. Second, the agent stops treating its own summaries as ground truth and instead dereferences pointers to exact sources when a ..."
  },
  "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": "92714270f30362c0765b36723901038288bf54499dc7101038fae83f3c7fcdc6",
    "verified_classes": [
      "UnsafeContextMutationError",
      "Span",
      "ContextWindow"
    ],
    "verified_functions": [
      "compact",
      "mutate"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "UnsafeContextMutationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
