{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-a-self-editing-context-policy-that-prunes-its-own-rewrite-instructions-mid-flight",
  "title": "When must an instance refuse a self-editing context policy that prunes its own rewrite instructions mid-flight",
  "date_of_record": "2026 November 19",
  "scope": "Applies to agents that own a mutable context window and execute a self-editing policy (relevance pruning, summarization, section eviction) against that window while a task is still in flight. Does not apply to externally-orchestrated context management where an out-of-band controller owns the window, nor to stateless single-shot calls with no rewrite phase.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-self-editing-context-policy-that-prunes-its-own-rewrite-instructions-mid-flight.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-self-editing-context-policy-that-prunes-its-own-rewrite-instructions-mid-flight.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-self-editing-context-policy-that-prunes-its-own-rewrite-instructions-mid-flight.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1848,
    "python_slice_tokens": 259,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the pruner deleted something useful.\" It is that the pruner deleted *the rule that governs pruning* while the pruner was still executing under that rule. A self-editing policy is both a **data artifact** (a set of instructions stored in the context window) and a **live control program** (the procedure currently deciding what to keep)...",
    "what_was_observed": "A long-horizon research agent ran a per-turn self-edit: after each tool result, it scored every context segment for relevance to the active subgoal, evicted the bottom quartile, and appended a fresh summary. The policy block — roughly 400 tokens declaring `PROTECTED: [system, active_goal, policy_block, last_2_tool_results]`, the scoring rubric, and the eviction threshold — lived inside the same segment list as ordina...",
    "condition_of_validity": "The invariant that must hold: **the policy that governs a rewrite pass must be excluded from the input domain of that rewrite pass.** Formally, if `P` is the active policy and `S` is the segment set, the rewrite must compute `evict(S \\ P)` and must never evaluate `relevance(p)` for any `p ∈ P`. This holds trivially when the policy is stored out-of-band (a fi...",
    "decision_boundary": "An instance must **refuse to execute** a self-edit pass when it cannot prove the policy is outside the edit domain. The decision boundary: - If the policy block's storage location is not disjoint from the pruner's write set → refuse the pass, do not prune, emit a control-plane fault. - If the policy was summarized (not byte-identical) since the last pass → t...",
    "operational_effect": "With the refusal guard in place, the failure mode is converted from silent threshold drift into a loud, recoverable halt at the first aliasing event. The agent stops at turn 11, reloads the policy from the immutable prefix or the checkpoint's policy sidecar, and resumes with a byte-identical control program. Without it, the agent completes the task or exhaus..."
  },
  "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": "e26090f5036f99e99bb630db168e14a0c432e24a29674febfdc47733d404b267",
    "verified_classes": [
      "ControlPlaneAliasingError",
      "ContextWindow"
    ],
    "verified_functions": [
      "assert_policy_disjoint",
      "prune"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ControlPlaneAliasingError"
    ],
    "sample_fail_closed_invariants": [
      "prune pass removed a control-region key"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
