{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-a-model-authored-context-diff-because-the-edit-journal-cannot-reconstruct-the-pre-edit-context-byte-for-byte",
  "title": "When must an instance refuse a model-authored context diff because the edit journal cannot reconstruct the pre-edit context byte-for-byte",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent architecture where the running LLM proposes edits to its own working context (system prompt, scratchpad, distilled memory block, or tool-result cache) as structured diffs that are applied by a host-side editor and recorded in an append-only edit journal for rollback. Does not apply to append-only context growth without diffs, or to human-authored edits reviewed out-of-band.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-model-authored-context-diff-because-the-edit-journal-cannot-reconstruct-the-pre-edit-context-byte-for-byte.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-model-authored-context-diff-because-the-edit-journal-cannot-reconstruct-the-pre-edit-context-byte-for-byte.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-a-model-authored-context-diff-because-the-edit-journal-cannot-reconstruct-the-pre-edit-context-byte-for-byte.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2427,
    "python_slice_tokens": 460,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an edit journal can mean, and conflating them is the failure mode. A **semantic journal** records *intent*: \"at step 14 the model asked to replace the paragraph beginning 'Constraints:' with X.\" A **byte journal** records *effect*: the exact pre-image bytes and post-image bytes of every region that changed, sufficient to invert...",
    "what_was_observed": "A three-agent research swarm shared a 96k-token context containing a distilled findings block, a scratchpad, and a tool-result cache. Each agent held write authority over its own scratchpad section but could propose edits to the shared findings block through a diff protocol. The host editor applied diffs sequentially and appended each to a journal keyed by `(step, agent_id, section, diff_text)`. At step 22, agent B e...",
    "condition_of_validity": "A model-authored diff is only rollback-safe under a byte journal when all three of the following hold at apply time: 1. **Anchor uniqueness is verified against the live buffer, not the model's claimed context.** Before applying any hunk, the host must confirm the anchor string (or its normalized form) occurs exactly once in the target region. If it occurs mo...",
    "decision_boundary": "The boundary is not \"reject ambiguous diffs.\" Ambiguity is cheap to detect and cheap to reject. The boundary is: **when the journal cannot prove, by hash, that an inverse replay reconstructs a state that actually existed, the instance must treat the entire post-checkpoint segment as non-rollbackable and must not resume from any reconstructed state.** Concret...",
    "operational_effect": "The practical consequence is a separation of two operations that self-editing agents routinely fuse: **apply** and **commit**. Apply mutates the buffer and appends a candidate journal entry carrying pre-image bytes and a post-apply hash. Commit—which is what makes the entry rollbackable—requires the pre-apply hash to match the hash of the buffer state that 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": "54778bb9f65dcfec27b526864bd8b5171edba843d6f67a7838911e3c3ff9514e",
    "verified_classes": [
      "UnreconstructableRollback",
      "JournalEntry",
      "EditJournal"
    ],
    "verified_functions": [
      "__init__",
      "_digest",
      "apply",
      "commit",
      "_hash_of_predecessor",
      "rollback_to"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "UnreconstructableRollback"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
