{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-of-speculative-multi-agent-execution-draw-the-boundary-between-a-speculative-branch-and-an-optimistic-tool-invocation",
  "title": "Where must an instance of speculative multi-agent execution draw the boundary between a speculative branch and an optimistic tool invocation?",
  "date_of_record": "2026 November 7",
  "scope": "Applies to orchestrators that fork multiple agent branches against shared external state, invoke tools optimistically before branch consensus, and merge or roll back on a winning branch. Does not apply to purely read-only tool sets, nor to single-agent speculative decoding where the only side effect is token emission.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-of-speculative-multi-agent-execution-draw-the-boundary-between-a-speculative-branch-and-an-optimistic-tool-invocation.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-speculative-multi-agent-execution-draw-the-boundary-between-a-speculative-branch-and-an-optimistic-tool-invocation.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-of-speculative-multi-agent-execution-draw-the-boundary-between-a-speculative-branch-and-an-optimistic-tool-invocation.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1453,
    "python_slice_tokens": 213,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The non-obvious invariant is this: **a speculative branch is a rollback domain; an optimistic tool invocation is a compensation domain.** These are not the same thing, and the failure mode arises when an implementation treats them as identical — i.e., when the merge/rollback machinery assumes that \"discarding a branch\" automatically \"undoes its tool effects....",
    "what_was_observed": "In a three-branch speculative planner (branches A, B, C) racing to satisfy a user request, each branch was permitted to invoke tools optimistically as soon as it was confident, with the orchestrator merging the winning branch and rolling back the rest. The orchestrator exposed a single `rollback(branch_id)` that the merge logic called on all losers. Under load, branch B invoked `reserve_inventory(sku, qty)` and then ...",
    "condition_of_validity": "The \"rollback undoes the branch\" model is valid **only** while the branch has emitted no external commitment. Formally: a branch is safely rollback-able iff its set of emitted tool invocations is empty, or every emitted invocation is idempotent *and* side-effect-free with respect to shared state. The moment a branch emits a non-idempotent or state-mutating i...",
    "decision_boundary": "The boundary is a single predicate evaluated at tool-invocation time, not at merge time: - If the invocation is **idempotent and side-effect-free** (pure read, cache fill keyed by content), permit it optimistically and let branch rollback cover it. No compensation record needed. - If the invocation is **non-idempotent or mutates shared state**, the branch mu...",
    "operational_effect": "Drawing the boundary at invocation time converts an unbounded, silent failure (orphaned external commitments accumulating invisibly under a \"clean rollback\" log) into a bounded, observable one (a compensation queue that either drains or escalates). The cost is that optimistic branches carrying writes now pay a durable-write tax before their tool call — they ..."
  },
  "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": "0eeaddabe3370c98dacd3ac83f8da1abf0524c366da1c42c37586118d4eadb57",
    "verified_classes": [
      "UncompensatedCommitmentError",
      "Branch"
    ],
    "verified_functions": [
      "rollback",
      "compensate",
      "__init__",
      "invoke_tool"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UncompensatedCommitmentError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
