{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-commits-a-speculative-branch-s-tool-side-effects-before-the-merge-barrier-resolves",
  "title": "What happens when an instance commits a speculative branch's tool side-effects before the merge barrier resolves",
  "date_of_record": "2026 December 2",
  "scope": "Applies to orchestrators that spawn parallel speculative plan branches (branch-and-merge trees) where branches invoke state-mutating tools (file writes, DB inserts, outbound HTTP POSTs, message sends) and the merge barrier may later discard one or more branches. Does not apply to pure-read fan-out or to branches whose tools are guaranteed idempotent and reversible.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-commits-a-speculative-branch-s-tool-side-effects-before-the-merge-barrier-resolves.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-commits-a-speculative-branch-s-tool-side-effects-before-the-merge-barrier-resolves.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-commits-a-speculative-branch-s-tool-side-effects-before-the-merge-barrier-resolves.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1980,
    "python_slice_tokens": 395,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two independent failure surfaces in speculative branch-and-merge execution, and conflating them is the root of the bug: 1. **Decision rollback** — the orchestrator discards a branch's *reasoning trace* and its *proposed plan node*. This is cheap: drop the node from the tree, free the context, done. 2. **Effect rollback** — the branch's tool calls a...",
    "what_was_observed": "A planner emitted a three-way speculative split at a node whose task was \"reconcile the customer record.\" Branch A proposed *upsert with merged fields*; Branch B proposed *delete-and-recreate*; Branch C proposed *no-op, flag for human*. All three were dispatched concurrently against the same tool namespace with a 20s branch budget. - Branch B's first tool call was `records.delete(id)`. It succeeded at t=1.2s. - Branc...",
    "condition_of_validity": "Effect isolation across speculative branches holds **only if** every state-mutating tool call from a branch is routed through one of: - a **branch-scoped overlay** (copy-on-write namespace, per-branch transaction, or per-branch sandbox) that is materialized into the shared world *only* at commit time; or - a **deferred-effect queue** where the tool call reco...",
    "decision_boundary": "The orchestrator must decide, per tool, per branch, whether the effect is **isolated** or **immediate**, and it must make this decision *before dispatch*, not at merge time. The boundary: - **Isolate** (overlay/defer) any tool whose effects are read by siblings, whose inverse is not total, or whose cost of wrong-commit exceeds the cost of deferred latency. T...",
    "operational_effect": "Downstream agents inherit the hybrid state as ground truth. Because no branch trace contains the interleaving, replay-based verification cannot reproduce the committed artifact: replaying Branch A alone yields a different record than replaying A after B's leaked delete. This breaks the standard verification move of \"re-run the winning branch and diff\" — the ..."
  },
  "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": "483f123d7ef4db2de711aedb88ff3e38048f2e3f851abf6137438c9e7615ea9d",
    "verified_classes": [
      "SpeculativeEffectLeak",
      "StagedEffect",
      "Branch",
      "SpeculativeOrchestrator"
    ],
    "verified_functions": [
      "__init__",
      "dispatch_tool",
      "resolve_barrier",
      "_apply"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeEffectLeak"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
