{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-a-speculative-branch-commit-is-unsafe-under-shared-tool-side-effects",
  "title": "What structural signals indicate a speculative-branch commit is unsafe under shared-tool side effects",
  "date_of_record": "2026 November 21",
  "scope": "Applies to orchestrators that fork an agent's task into N parallel speculative branches (MCTS-style, best-of-N, or planner/executor fan-out), each branch mutating a shared tool surface (filesystem, database, external API), then selecting one branch to commit and rolling back the rest. Does not apply to branches executing against fully isolated, disposable sandboxes where rollback is a pure teardown with no external reconciliation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-speculative-branch-commit-is-unsafe-under-shared-tool-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-speculative-branch-commit-is-unsafe-under-shared-tool-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-a-speculative-branch-commit-is-unsafe-under-shared-tool-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2214,
    "python_slice_tokens": 395,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two meanings of \"rollback\" that get conflated in speculative agent execution, and the conflation is the failure. - **Logical rollback** is restoring the agent's own state: discarding a branch's context, scratchpad, and message history so the committed branch's reasoning continues from a clean tree. This is cheap, deterministic, and always correct b...",
    "what_was_observed": "A planner agent was asked to reduce cloud spend across a set of service accounts. It fanned out three speculative branches, each pursuing a different remediation strategy: - Branch A: resize over-provisioned instances. - Branch B: delete orphaned volumes. - Branch C: rotate and revoke stale IAM access keys. All three branches ran concurrently against the same live cloud API, each believing it was the sole executor be...",
    "condition_of_validity": "The invariant \"commit one branch, roll back the rest\" is sound **only** under the following conjunction: 1. **Effect reversibility:** every tool call any branch can emit is either pure (no external effect) or carries an explicit inverse operation that the orchestrator can invoke during rollback. Tools that cannot express an inverse must be marked `IRREVERSIB...",
    "decision_boundary": "The boundary is crossed at the moment a speculative branch emits a tool call whose effect class is `IRREVERSIBLE` or `EXTERNALLY_OBSERVABLE` (visible to parties outside the orchestrator, e.g. a customer receiving an email, a payment settling). At that instant the orchestrator must choose one of two regimes and may not continue in the naive one: - **Buffered ...",
    "operational_effect": "The operational consequence is that speculative fan-out must be gated on a **declared effect contract** per tool, and the orchestrator must maintain a cross-branch **effect ledger** that survives logical rollback. The ledger is the authoritative record of what physically happened; the branch contexts are only the record of what each branch *thought* happened..."
  },
  "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": "87bd96c05485f801abccd05490b5b2cb6d254b48afcb742a56998ce39ca46f9d",
    "verified_classes": [
      "EffectClass",
      "ToolEffect",
      "EffectLedger",
      "UnsafeSpeculativeCommit"
    ],
    "verified_functions": [
      "audit_before_commit",
      "commit_speculative",
      "record",
      "irreversible_uncompensated",
      "resource_conflicts"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnsafeSpeculativeCommit"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
