{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-of-a-self-editing-context-policy-refuse-a-model-driven-rewrite-the-invariant-preservation-boundary-at-rewrite-admission",
  "title": "Where must an instance of a self-editing context policy refuse a model-driven rewrite: the invariant-preservation boundary at rewrite admission",
  "date_of_record": "2026 November 15",
  "scope": "Applies to agents that maintain a mutable context window whose contents are rewritten by the model itself (summarization, eviction, reordering, deduplication, span replacement) under a set of declared invariants. Does not apply to append-only context logs, to rewrites gated solely by a human reviewer, or to policies whose invariants are enforced by an external storage engine rather than by the agent.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-self-editing-context-policy-refuse-a-model-driven-rewrite-the-invariant-preservation-boundary-at-rewrite-admission.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-self-editing-context-policy-refuse-a-model-driven-rewrite-the-invariant-preservation-boundary-at-rewrite-admission.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-self-editing-context-policy-refuse-a-model-driven-rewrite-the-invariant-preservation-boundary-at-rewrite-admission.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2664,
    "python_slice_tokens": 749,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing context policy has two distinct failure surfaces that are routinely conflated: 1. **Rewriter quality failure** — the model produces a rewrite that loses or corrupts information. This is a *semantic* failure, detectable only probabilistically, and is the subject of most evaluation work. 2. **Invariant admission failure** — the model produces a ...",
    "what_was_observed": "A context agent was configured with four declared invariants: (I1) spans marked `pinned` survive every rewrite verbatim; (I2) every `tool_call` retains its matching `tool_result` in the same relative order; (I3) every `redaction` marker remains present with its original byte length; (I4) a `constraint` block precedes any instruction that references it. Rewrites were proposed as structured edit scripts (replace span [...",
    "condition_of_validity": "The refusal-to-admit discipline described here is valid when and only when all of the following hold: - Invariants are **declarative and machine-checkable** over the edit script: each is expressible as a predicate over (protected-region set, operation list, resulting span graph). Invariants that require semantic judgment (\"the summary preserves the user's in...",
    "decision_boundary": "The operative rule: **admit a rewrite iff the edit script satisfies every invariant as a predicate over operations; otherwise refuse the entire rewrite atomically and return the violated invariant plus the offending operation to the rewriter for a bounded number of repair attempts.** The boundary is drawn at the *operation*, not the *outcome*, and refusal is...",
    "operational_effect": "Routing invariant preservation to a pre-commit diff gate changed the failure profile from silent corruption to loud refusal: - Invariant-violating rewrites reaching the live context fell from 2.2% (self-check) to 0% (diff gate) on the workload, at the cost of a 4.1% refusal rate and a mean 1.3 repair round-trips per refused rewrite. - The 12 violations that ..."
  },
  "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": "7ad7e43609ce2bc927daaca081d0b77151068bfb4c1d38a3809e9abe9746d7e9",
    "verified_classes": [
      "InvariantViolation",
      "Span",
      "EditOp"
    ],
    "verified_functions": [
      "_overlaps",
      "_is_protected",
      "check_invariant_preservation",
      "admit_rewrite",
      "__init__"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "InvariantViolation"
    ],
    "sample_fail_closed_invariants": [
      "I2_call_result_paired",
      "I2_call_result_paired",
      "I4_constraint_precedes_dependent",
      "I1_protected_span_untouched"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
