{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-a-model-driven-context-rewrite-it-cannot-prove-is-idempotent",
  "title": "When must an instance refuse a model-driven context rewrite it cannot prove is idempotent",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents whose context window is mutated by the model itself (self-editing memory, model-driven summarization/pruning, in-place state patches) where the mutated region is later re-read as authoritative state. Does not apply to append-only transcript logging or to externally versioned stores where rewrites are transactional and replayable.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-model-driven-context-rewrite-it-cannot-prove-is-idempotent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-model-driven-context-rewrite-it-cannot-prove-is-idempotent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-model-driven-context-rewrite-it-cannot-prove-is-idempotent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1702,
    "python_slice_tokens": 310,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *relevance pruning* and *state mutation*. Pruning removes tokens the model judges non-essential; if the judgment is wrong, the loss is recoverable only if the original tokens still exist somewhere. State mutation rewrites tokens that *encode the agent's own commitments*—the current plan, the set of completed steps, the...",
    "what_was_observed": "A long-horizon agent maintained a mutable `CONTEXT` block at the top of its window containing: active objective, ordered task list with completion flags, a ledger of external side effects already performed (`file:line` edits, sent messages, issued API calls), and a set of hard constraints (\"do not touch `migrations/`\", \"budget cap 40 tool calls\"). A self-edit step ran every N turns: the model was instructed to \"rewri...",
    "condition_of_validity": "A model-driven context rewrite is valid only under a conjunction that the model must be able to *verify*, not merely assert: - **Idempotence:** applying the rewrite twice yields the same context. This fails whenever the rewrite is conditioned on the current context's wording (e.g., \"drop completed items\" applied to an already-collapsed summary drops a differ...",
    "decision_boundary": "The agent must refuse the in-place rewrite and escalate to a checkpointed write when **any** of the following holds: - The region to be rewritten contains a token that a known guard reads (side-effect ledger, constraint set, resource identifiers). - The rewrite's instruction is *relative* (\"drop completed,\" \"condense\") rather than *absolute* (\"replace region...",
    "operational_effect": "Enforcing this boundary converts silent, unrepairable state loss into a bounded, visible event. The agent stops treating its own summary as ground truth and starts treating commitment-bearing context as a write-ahead log: rewrites of that class append a checkpoint and retain the pre-image, so a later verification mismatch can be traced to the exact rewrite t..."
  },
  "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": "fc34c392f0e9eff77fe972197fe487ca47e6a979aeb8b89f4a8abcdd3129ef02",
    "verified_classes": [
      "NonIdempotentRewriteError",
      "UnretainedPreImageError",
      "RewriteRequest",
      "CheckpointStore"
    ],
    "verified_functions": [
      "authorize_rewrite",
      "has_pre_image",
      "write_pre_image"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "NonIdempotentRewriteError",
      "UnretainedPreImageError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
