{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-speculatively-invokes-a-non-idempotent-tool-before-branch-reconciliation-completes",
  "title": "What happens when an instance speculatively invokes a non-idempotent tool before branch reconciliation completes",
  "date_of_record": "2026 November 8",
  "scope": "Applies to multi-agent systems where sibling branches execute optimistically against shared external side effects (tool calls, writes, transactions) and reconcile via rollback or merge. Does not apply to systems where tool invocation is gated behind a committed branch token or where all external effects are idempotent by contract.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-invokes-a-non-idempotent-tool-before-branch-reconciliation-completes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-invokes-a-non-idempotent-tool-before-branch-reconciliation-completes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-invokes-a-non-idempotent-tool-before-branch-reconciliation-completes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1556,
    "python_slice_tokens": 340,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **speculative internal state** and **speculative external effect**. A branch may freely speculate on its own working memory, scratchpad, or candidate output — these are private and rollback is a local memory operation. But the moment a branch invokes a tool that mutates the world (sends an email, appends to a queue, de...",
    "what_was_observed": "A coordinator spawned three sibling branches to answer a single request. Branch B decided, before the coordinator had selected a winner, to invoke a `send_notification` tool and a `create_ticket` tool optimistically — reasoning that \"if I win, this saves a round trip; if I lose, the reconciler will roll me back.\" Branch A won. The reconciler correctly discarded B's internal state, marked B as rolled back, and reporte...",
    "condition_of_validity": "The invariant \"rollback of a branch restores the pre-branch world state\" holds **if and only if** every effect a branch can produce is either (a) confined to branch-private memory, or (b) registered with the coordinator at invocation time and either idempotent or compensable. The condition fails silently in exactly the case where a branch invokes a tool whos...",
    "decision_boundary": "The decision boundary is not \"should branches be allowed to call tools.\" It is **where the registration happens relative to the effect**. Registering *after* the call is worthless: the call may have succeeded and the process may have died before registration, leaving an unrecorded effect. Registration *before* the call (a two-phase record: intent, then outco...",
    "operational_effect": "Operationally, teams that hit this boundary tend to add compensation logic after the fact — an \"undo\" path for each tool — and then discover that compensation is itself non-idempotent and racy. The durable fix is to make the coordinator the sole holder of tool handles for speculative branches, require branches to request effects rather than perform them, and..."
  },
  "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": "cf5fb612759914955c5c2a3f741c842e49f0809cfcf4a2bdb6e8cb8635501cf0",
    "verified_classes": [
      "UnregisteredSideEffectError",
      "IntentRecord",
      "Coordinator",
      "SpeculativeBranch"
    ],
    "verified_functions": [
      "run_speculation",
      "__init__",
      "request_effect",
      "commit_branch",
      "rollback_branch",
      "__init__",
      "invoke_tool"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnregisteredSideEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
