{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-of-a-self-editing-context-policy-refuse-to-rewrite-a-span-it-cannot-re-derive",
  "title": "Where must an instance of a self-editing context policy refuse to rewrite a span it cannot re-derive",
  "date_of_record": "2026 November 15",
  "scope": "Applies to any agent loop in which the model itself emits edit operations (prune, rewrite, reweight) against its own in-flight context window, and those edits are applied by a deterministic host before the next inference step. Does not apply to host-side, model-agnostic compaction (e.g., fixed token-budget summarizers) where the model has no authorship over the edit set, nor to offline context construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-self-editing-context-policy-refuse-to-rewrite-a-span-it-cannot-re-derive.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-self-editing-context-policy-refuse-to-rewrite-a-span-it-cannot-re-derive.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-a-self-editing-context-policy-refuse-to-rewrite-a-span-it-cannot-re-derive.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2228,
    "python_slice_tokens": 525,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A self-editing policy conflates two operations that look identical in the edit stream: **forgetting** and **falsification**. Pruning a span is an epistemic act — the span is declared non-load-bearing and removed. Rewriting a span is a *different* act — the span is declared load-bearing but *incorrectly stated*, and replaced with content the model asserts is ...",
    "what_was_observed": "In a long-horizon tool-use loop (mean 140 steps, window budget 96k tokens, edits permitted every step), we logged every rewrite operation and, at each, retained the pre-edit span and the post-edit span alongside the original tool output that had produced the pre-edit span. Three patterns recurred: 1. **Tool-output rewrite with loss of exact literals.** The model rewrote a 4.1k-token JSON tool response into a 900-toke...",
    "condition_of_validity": "A rewrite of span $S$ by model state $M$ is admissible only if the post-edit content is **re-derivable from a source outside $S$ that is present in the window and not itself a product of $M$**. Formally, let $D(S)$ be the set of spans in the window, other than $S$, that are not model-authored (raw tool outputs, user turns, retrieved documents, host-injected ...",
    "decision_boundary": "The host must reject an edit — not warn, not log-and-apply — when any of the following hold, and must surface the rejection to the model as a hard constraint on the next step: - **Rewrite without provenance.** The proposed $S'$ contains a literal (identifier, number, path, credential, timestamp, error code) not present verbatim in $D(S)$. Literals are the hi...",
    "operational_effect": "Enforcing the boundary changes the loop's economics in a way that is initially counterintuitive. Refused rewrites accumulate, so the window grows faster and the agent hits the hard budget sooner. The naive response — relax the boundary to buy headroom — reintroduces exactly the silent-failure mode the boundary exists to prevent, and does so *later* and *more..."
  },
  "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": "4e99dedb3881e8b3880140e3e34d3e9e8e7a178c4c9a4bbb3daf9bb85b7dd8bc",
    "verified_classes": [
      "UnsafeContextEditError",
      "Span",
      "Edit"
    ],
    "verified_functions": [
      "_non_model_spans",
      "_literals_in",
      "validate_edit",
      "apply_edits"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 8,
    "raised_exceptions": [
      "UnsafeContextEditError"
    ],
    "sample_fail_closed_invariants": [
      "edit targets the edit policy itself; self-referential edits are structurally forbidden",
      "reweight requires new_priority"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
