{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-speculative-branch-rollback-as-non-atomic-across-shared-tool-side-effects",
  "title": "In what scenarios must an instance treat speculative branch rollback as non-atomic across shared tool side effects",
  "date_of_record": "2026 December 1",
  "scope": "Applies to orchestrators that fan out speculative sub-agent branches (parallel candidate plans, tree-of-thought rollouts, or draft-and-verify agents) and roll back the losing branches on divergence. Does not apply to branches that are pure inference with no external side effects, nor to single-branch execution with no speculative commit.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-speculative-branch-rollback-as-non-atomic-across-shared-tool-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-speculative-branch-rollback-as-non-atomic-across-shared-tool-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-speculative-branch-rollback-as-non-atomic-across-shared-tool-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1989,
    "python_slice_tokens": 345,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a speculative branch produced a wrong answer.\" It is that **rollback of a losing branch is treated as if it were a transaction, but the branch's side effects were already committed to shared state that the winning branch also reads.** Speculative execution assumes the speculative path is isolated until commit. In agent systems this assump...",
    "what_was_observed": "A three-branch speculative planner was asked to reconcile two conflicting records. Branch A (canonicalize-then-merge) and Branch B (merge-then-canonicalize) ran concurrently; Branch C was a conservative no-op fallback. Each branch was given a `write_scratch(key, value)` tool scoped to a shared scratch namespace keyed only by task ID, not by branch ID. The orchestrator's divergence check compared final answer embeddin...",
    "condition_of_validity": "The rollback-as-transaction assumption holds only under all of the following: - Every tool available to a speculative branch is **read-only** or **namespaced per branch** with a namespace derived from `(task_id, branch_id, attempt_nonce)`, never `task_id` alone. - Cross-branch visibility is granted only through an explicit **commit barrier**: a branch's writ...",
    "decision_boundary": "An instance must **refuse to run a branch speculatively** (serialize it instead, or downgrade it to a dry-run that returns proposed tool calls without executing them) when: - The branch's tool set includes any writer whose namespace cannot be made branch-local, **and** any sibling branch can read that namespace before the commit barrier. - The divergence met...",
    "operational_effect": "When the invariant is enforced, the observable consequences are: divergence checks become *trustworthy* (convergence means agreement, not contamination), rollback becomes *auditable* (every compensated effect appears in a surviving ledger with branch provenance), and the winning branch's inputs are provably free of dead-branch writes. The cost is that fan-ou..."
  },
  "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": "50fddb1b1091419c9494d4b95429a99f3c478a1d0654ee91cab3aad251844beb",
    "verified_classes": [
      "SpeculativeIsolationError",
      "ToolSpec",
      "Branch"
    ],
    "verified_functions": [
      "assert_speculation_safe",
      "rollback",
      "run_speculative"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculativeIsolationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
