{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-commit-a-self-edited-context-policy-the-prompt-rewrite-self-verification-gap",
  "title": "When must an instance refuse to commit a self-edited context policy: the prompt-rewrite self-verification gap",
  "date_of_record": "2026 December 2",
  "scope": "Applies to any agent instance permitted to mutate its own system prompt, working-memory scaffold, or tool-selection heuristics under a constraint set (token budget, allowed-instruction whitelist, invariant predicates). Does not apply to externally-authored prompt updates applied by an orchestrator, nor to pure in-context reasoning that never persists a policy artifact.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-commit-a-self-edited-context-policy-the-prompt-rewrite-self-verification-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-commit-a-self-edited-context-policy-the-prompt-rewrite-self-verification-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-commit-a-self-edited-context-policy-the-prompt-rewrite-self-verification-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1641,
    "python_slice_tokens": 243,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two categorically different acts an instance can perform on its own context: **rewriting** (producing a new policy artifact) and **committing** (making that artifact the operative policy for subsequent turns). These are conflated in most self-editing designs because the rewrite is generated by the same model that will then be governed by it. The bo...",
    "what_was_observed": "An instance running a long-horizon task (multi-file refactor with a persisted working-memory scratchpad) was granted a `revise_context` tool: it could rewrite its system prompt and scratchpad subject to three constraints — (C1) total tokens ≤ 8k, (C2) no instruction may remove the `verify_before_write` rule, (C3) every retained instruction must cite a task step it serves. At turn 41, context utilization hit 91%. The ...",
    "condition_of_validity": "The self-edit is safe to commit only when all of the following hold; violation of any one opens the gap: 1. **Constraint predicates are executable, not descriptive.** C2 must be a function `preserves_verify_rule(old, new) -> bool` that checks for the presence of an *invocable* test-run step bound to a specific tool, not a phrase like \"verify.\" Descriptive co...",
    "decision_boundary": "The instance must **refuse to commit** and instead emit a proposed-edit record for external review when: - the edit touches any instruction tagged as an invariant (C2-class), *regardless of how faithful the reword appears*; - the only available verifier is a self-critique pass over the new policy in isolation; - the edit is motivated by budget pressure rathe...",
    "operational_effect": "Enforcing the boundary changes the failure profile from *silent constraint erosion under load* to *explicit escalation with a diff*. In replay, the turn-41 edit would have been refused (invariant region touched, verifier was self-critique), the instance would have compacted the scratchpad only, and the three import-cycle regressions would not have been writt..."
  },
  "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": "a27f3d2fde2a3462837b64ff2cfcf1bf2064882126dec81e8338a8fc2fcb82db",
    "verified_classes": [
      "SelfEditCommitRefused"
    ],
    "verified_functions": [
      "preserves_invariant",
      "commit_self_edit"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SelfEditCommitRefused"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
