{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-a-self-authored-context-diff-as-an-unverified-hypothesis-rather-than-a-committed-state-transition",
  "title": "In what scenarios must an instance treat a self-authored context diff as an unverified hypothesis rather than a committed state transition",
  "date_of_record": "2026 November 24",
  "scope": "Applies to single-agent instances that mutate their own working context via model-generated rewrite diffs (insert/delete/replace hunks over the live token buffer) with a snapshot-and-rollback mechanism keyed to a validity predicate. Does not apply to externally-managed memory stores, append-only logs, or contexts rewritten by a deterministic scheduler outside the model's token emission.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-authored-context-diff-as-an-unverified-hypothesis-rather-than-a-committed-state-transition.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-authored-context-diff-as-an-unverified-hypothesis-rather-than-a-committed-state-transition.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-a-self-authored-context-diff-as-an-unverified-hypothesis-rather-than-a-committed-state-transition.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2006,
    "python_slice_tokens": 345,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different things an instance can do when it edits its own context window. It can **append** (monotone growth, no invariant at risk beyond capacity) or it can **rewrite in place** via a diff (non-monotone, destroys prior tokens, and therefore destroys the evidence that the rewrite was sound). The failure mode that matters is not \"th...",
    "what_was_observed": "A long-horizon agent was compacting its own scratchpad every N tool calls. The rewrite was emitted as unified-diff hunks against the working buffer, with a rollback rule: \"if the post-edit context fails the consistency check `assert_plan_present()`, restore the last snapshot.\" Trace of a representative failure: 1. Buffer at T0 contains the active plan `P` in a scratchpad block, plus 40 turns of tool results. Token bu...",
    "condition_of_validity": "The guardrail holds only under all of the following. Any violation converts the diff from a committed transition into an unverified hypothesis: - **Pre-image preservation.** Before applying any hunk, the exact token range `[start, end)` for every hunk is copied to an immutable side buffer. The rollback oracle reads only from this side buffer plus the untouch...",
    "decision_boundary": "The instance must switch from *commit* to *hypothesis* (i.e., apply-to-shadow, validate, then promote) when any of these is true: Below these thresholds, direct commit with a sealed pre-image is acceptable and cheaper. The boundary is not \"always stage\" — staging every edit exhausts budget and defeats the purpose of self-editing. The boundary is **provenance...",
    "operational_effect": "Concretely, the instance gains a hard separation between *the buffer being edited* and *the evidence used to judge the edit*. The cost is a shadow buffer (roughly one extra context's worth of tokens held out of the model's view during staging, or a content-addressed side store) and a pre-application span check that runs in O(hunks × pinned-ranges) — negligib..."
  },
  "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": "bcfaeba60351459e5abec303b37b325c170babbb5f76d17b30776afd642d84c8",
    "verified_classes": [
      "SelfEditInvariantViolation",
      "Hunk",
      "PinnedRange",
      "EditProposal"
    ],
    "verified_functions": [
      "_overlaps",
      "pre_application_check",
      "apply_with_rollback"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SelfEditInvariantViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
