{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abort-a-speculative-branch-rather-than-commit-it-divergent-tool-call-side-effects-under-optimistic-fork-and-merge",
  "title": "When must an instance abort a speculative branch rather than commit it: divergent tool-call side effects under optimistic fork-and-merge",
  "date_of_record": "2026 November 26",
  "scope": "Applies to multi-agent planners that fork a shared reasoning state into N speculative branches, execute tool calls optimistically inside each branch, and merge the winning branch back into the canonical state. Does not apply to strictly serialized single-agent loops or to branches whose tool calls are provably pure (no external side effects).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-rather-than-commit-it-divergent-tool-call-side-effects-under-optimistic-fork-and-merge.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-rather-than-commit-it-divergent-tool-call-side-effects-under-optimistic-fork-and-merge.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-rather-than-commit-it-divergent-tool-call-side-effects-under-optimistic-fork-and-merge.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1773,
    "python_slice_tokens": 400,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a speculative branch produced a wrong answer.\" Wrong answers are cheap—you discard the branch. The failure is that a speculative branch produced an *externally committed side effect* whose rollback the fork/merge machinery cannot perform, while the branch's *reasoning result* was still judged inferior and discarded. The system believ...",
    "what_was_observed": "A tri-branch planner forked a task state at step 7 into branches A, B, C. Each branch was permitted to call tools under a \"speculative\" flag intended to mean *execute but do not commit to canonical memory*. The flag was enforced by the orchestrator's state layer—it suppressed writes to the episodic store and deferred the branch's `context_delta` until merge. It did **not** intercept the tool transport. Trace of the t...",
    "condition_of_validity": "The fork-and-merge model is only sound under the invariant that **speculative branches may execute only idempotent-and-reversible tools, or must stage irreversible tools behind a commit gate that fires exactly once at merge.** Formally, for every tool `t` invoked in a speculative branch: - If `t` is pure or idempotent with a compensating inverse `t⁻¹` that t...",
    "decision_boundary": "Abort the speculative branch (do not merely discard it) when any of the following holds at merge time: - **Irreversible side effect already dispatched from a non-selected branch.** Abort escalates to a reconciliation task; the branch's ledger entries are quarantined as orphans, never purged. The merge halts because canonical state can no longer be trusted to...",
    "operational_effect": "Enforcing the boundary converts a silent double-execution into a loud, recoverable halt. The cost is throughput: irreversible tools lose parallel speculation and serialize behind the commit gate, so fork fan-out for those branches collapses to one. The benefit is that rollback becomes honest—discard either invokes a real compensating inverse or refuses to cl..."
  },
  "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": "3b0ca3bc7977da403aa2488f91f33f37a2ba6b04ae18a4522bcb9050dbce536f",
    "verified_classes": [
      "SpeculativeRollbackError",
      "ToolClass",
      "Intent",
      "Branch"
    ],
    "verified_functions": [
      "merge",
      "_compensate"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculativeRollbackError"
    ],
    "sample_fail_closed_invariants": [
      "cannot merge empty fork generation"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
