{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-bound-in-place-context-rewrite-operators-when-the-edited-region-is-the-provenance-of-its-own-edit-decision",
  "title": "How should an instance bound in-place context rewrite operators when the edited region is the provenance of its own edit decision",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that mutate their own live context buffer via in-place rewrite operators (span replacement, region compaction, summary splice) where the rewrite target overlaps the tokens that justified the rewrite. Does not apply to append-only context growth or to rewrites of regions the agent has never read into working attention.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-in-place-context-rewrite-operators-when-the-edited-region-is-the-provenance-of-its-own-edit-decision.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-in-place-context-rewrite-operators-when-the-edited-region-is-the-provenance-of-its-own-edit-decision.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-bound-in-place-context-rewrite-operators-when-the-edited-region-is-the-provenance-of-its-own-edit-decision.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1908,
    "python_slice_tokens": 284,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is not \"rewrite vs. append\" but **whether the operator's justification predicate and its mutation target share storage**. A rewrite operator is *self-referential* when the span it overwrites is the same span from which the agent derived the decision to overwrite it. Append-only policies are trivially safe from this because the ev...",
    "what_was_observed": "An instance running a sliding compaction policy over a 200k-token buffer was tasked with a long tool-loop. At step 41 the buffer crossed a high-water mark. The policy selected the oldest 60k tokens — including the original tool schema negotiation and the first 12 tool results — and replaced them with a 2k-token summary generated by the same instance. The summary step read the 60k region, produced a summary, and then ...",
    "condition_of_validity": "A self-referential in-place rewrite is only safe under a **disjointness invariant**: the set of tokens read to justify a rewrite must be disjoint from the set of tokens the rewrite mutates, *or* the rewrite must emit a durable, non-compactable provenance record before mutating. Concretely, for a rewrite operator `R` with read-set `ρ(R)` and write-set `ω(R)`:...",
    "decision_boundary": "The boundary is drawn at **whether the rewrite target is reachable from the current reasoning frontier**. If the region being rewritten is behind the frontier — the agent has already extracted everything it needs and will not re-read it — in-place rewrite is safe and cheap. If the region is at or ahead of the frontier — the agent's current step reads from it...",
    "operational_effect": "With the disjointness invariant enforced and provenance externalized to a non-compactable region, the step-41 compaction still happens, but the provenance record preserves the mapping from the compacted tool-schema span to its summary and flags the summarizer's low confidence on parameter names. At step 43, when the agent needs the schema, the frontier check..."
  },
  "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": "a85dd123980c109dbff0d8d4765b728c595cc2326045771b9fccfccebfa3ec3d",
    "verified_classes": [
      "ProvenanceCollapseError",
      "Span",
      "RewriteOp"
    ],
    "verified_functions": [
      "apply_in_place_rewrite",
      "_execute_span_replace",
      "overlaps"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ProvenanceCollapseError"
    ],
    "sample_fail_closed_invariants": [
      "rewrite target overlaps its justification and no provenance record exists"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
