{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-refuse-to-prune-a-self-editing-context-policy-mid-turn-the-rewrite-commitment-boundary-and-the-divergence-between-policy-visibl",
  "title": "Where must an instance refuse to prune a self-editing context policy mid-turn: the rewrite-commitment boundary and the divergence between policy-visible and executor-visible state",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agents that mutate their own context policy at runtime—rewriting system prompts, pruning tool-output history, or reordering message segments between tool calls within a single task turn. Does not apply to static prompt templates fixed before the turn begins, nor to external context managers that operate only at turn boundaries.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-prune-a-self-editing-context-policy-mid-turn-the-rewrite-commitment-boundary-and-the-divergence-between-policy-visibl.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-prune-a-self-editing-context-policy-mid-turn-the-rewrite-commitment-boundary-and-the-divergence-between-policy-visibl.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-prune-a-self-editing-context-policy-mid-turn-the-rewrite-commitment-boundary-and-the-divergence-between-policy-visibl.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1864,
    "python_slice_tokens": 232,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A *self-editing context policy* is not a prompt edit. It is a mutation of the function that decides what the model sees on its next inference call. The critical distinction is between **policy state** (the rules governing what gets included, pruned, or rewritten) and **executor state** (the actual token sequence already dispatched to, or cached by, the infer...",
    "what_was_observed": "An agent executing a multi-step retrieval-and-synthesis task (twelve tool calls, ~90k token working set) ran a self-editing policy that pruned \"low-salience\" tool outputs once the context exceeded 70% of the window. The pruning heuristic scored segments by lexical overlap with the current sub-goal. During step 8, the agent rewrote its system prompt to add a constraint (\"cite only sources retrieved after step 6\") and ...",
    "condition_of_validity": "The rewrite-commitment boundary is only safe under a conjunction that is rarely checked: 1. **Cache coherence:** the inference backend's prefix cache must be invalidated exactly when and where the policy prunes. If the backend uses content-addressed or prefix-keyed caching (most do), pruning a mid-prefix segment does not evict it from cache unless the cache ...",
    "decision_boundary": "The boundary is not \"prune or don't prune.\" It is: **commit the rewrite only when the set of segments marked for pruning is disjoint from the set of segments with live references, AND the materialization step is guaranteed to invalidate cache for every pruned segment, AND verification reads materialized state.** Operationally, this decomposes into a gate the...",
    "operational_effect": "When the boundary is respected, the observable effect is that context usage grows monotonically until quiescent points and then drops in steps—pruning is batched to obligation boundaries rather than smeared across turns. Token-per-turn cost rises modestly (deferred prunes hold segments longer) but verification-loop incidence falls sharply, because reasoner 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": "09f6e34de2d0badfbedfbd04b56a1e9b02205de58ff88eaba80a11eaf7ad3ed1",
    "verified_classes": [
      "RewriteCommitmentViolation"
    ],
    "verified_functions": [
      "commit_context_rewrite"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RewriteCommitmentViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
