{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-refuse-to-fork-a-speculative-branch-the-read-after-write-shadow-divergence-at-rollback-checkpoints",
  "title": "Where must an instance refuse to fork a speculative branch: the read-after-write shadow divergence at rollback checkpoints",
  "date_of_record": "2026 November 24",
  "scope": "Applies to orchestrators that run multiple speculative agent branches from a shared checkpoint, allow branches to perform side-effecting tool calls (writes, sends, mutations), and prune losing branches by rolling back to the checkpoint. Does not apply to pure-read speculation, to branches that are fully sandboxed with no external effect, or to single-branch retry loops where only one writer exists at a time.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-fork-a-speculative-branch-the-read-after-write-shadow-divergence-at-rollback-checkpoints.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-fork-a-speculative-branch-the-read-after-write-shadow-divergence-at-rollback-checkpoints.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-refuse-to-fork-a-speculative-branch-the-read-after-write-shadow-divergence-at-rollback-checkpoints.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2362,
    "python_slice_tokens": 365,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that governs everything downstream is between **a checkpoint as a state snapshot** and **a checkpoint as a state *and effect* boundary**. Most branch-and-prune orchestrators implement the former: they serialize the agent's message list, scratchpad, and tool-result cache at checkpoint time, fork N branches on top of that serialized context, an...",
    "what_was_observed": "A three-branch speculative planner was forked from checkpoint `C0` at step 12 of a procurement task. The task required creating a purchase order and notifying a vendor. Branches: - `B1` (winner): planned to create PO `#4471` for vendor A, then notify. - `B2` (loser): planned to create PO `#4471` for vendor B (a tie-break disagreement on vendor selection), then notify. - `B3` (loser): planned to query inventory only, ...",
    "condition_of_validity": "The rollback-checkpoint invariant holds **only if** every speculative branch is *effect-isolated*: either (a) its writes are buffered and committed atomically on branch selection, or (b) its writes are idempotent and namespaced by branch ID such that a pruned branch's writes are invisible to survivors, or (c) the branch is provably read-only. The invariant i...",
    "decision_boundary": "The boundary an instance must enforce is: **a branch may not be pruned after it has committed a non-idempotent write, unless the orchestrator can prove the write is invisible to all surviving branches.** In practice this collapses to a forkability predicate evaluated *before* forking: - **Forks are safe** when the branch's planned tool calls are all classifi...",
    "operational_effect": "The downstream consequences are not \"a stray record.\" They are: 1. **Attribution inversion.** The survivor's planner sees an effect it did not cause and, lacking a record, attributes it to an external actor or to its own earlier step it has \"forgotten.\" Either attribution corrupts subsequent planning. In the observed case it triggered a cancel sub-plan again..."
  },
  "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": "021dad8ae6f9300d682ec62816a41e8358f356dc57587f73bad8ac706687437c",
    "verified_classes": [
      "ShadowDivergenceError",
      "UnsafeSpeculativeWriteError",
      "Effect",
      "Branch",
      "CheckpointOrchestrator"
    ],
    "verified_functions": [
      "run_speculative_step",
      "__init__",
      "speculative_write",
      "prune",
      "guarded_read"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ShadowDivergenceError",
      "UnsafeSpeculativeWriteError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
