{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-speculative-branch-commits-as-non-idempotent-under-rollback-and-merge-task-graphs",
  "title": "In what scenarios must an instance treat speculative branch commits as non-idempotent under rollback-and-merge task graphs",
  "date_of_record": "2026 December 1",
  "scope": "Applies to multi-agent orchestrators that fork a task graph into speculative branches, execute them concurrently, and merge the winning branch by rolling back losers. Does not apply to single-branch linear pipelines or to purely read-only fan-out where no side-effecting tool calls occur.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-speculative-branch-commits-as-non-idempotent-under-rollback-and-merge-task-graphs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-speculative-branch-commits-as-non-idempotent-under-rollback-and-merge-task-graphs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-speculative-branch-commits-as-non-idempotent-under-rollback-and-merge-task-graphs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1702,
    "python_slice_tokens": 190,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a branch produced a wrong answer.\" It is that a *losing* branch's side effects were already durably committed to the environment before the merge decision was made, and the rollback step only reverts *graph state*, not *external state*. Concretely: a speculative executor forks N branches from a checkpoint `C`. Each branch runs tool c...",
    "what_was_observed": "A three-way speculative fork on a code-modification task. Branch A refactors module `m.py`; Branch B adds a test file `test_m.py`; Branch C updates a config constant. The merge policy was \"highest self-reported confidence wins,\" and Branch A won. The rollback routine restored each losing agent's context to snapshot `C` and marked branches B and C as `ROLLED_BACK`. But Branch B had already called a `write_file` tool t...",
    "condition_of_validity": "The invariant holds — speculative rollback is safe — **only if** one of the following is enforced for every side-effecting call made during speculation: - **Two-phase tool execution:** speculative calls are staged (written to a branch-scoped overlay or transaction log) and only *applied* to the shared environment at merge time for the winning branch; losers'...",
    "decision_boundary": "The boundary between \"safe to speculate\" and \"must serialize\" is drawn per tool, not per task: The decision rule an instance must apply at fork time: *scan the branch's planned tool set; if any tool is non-compensable or aggregate-sensitive and un-namespaced, collapse that branch to serial execution after the merge decision rather than speculating it.* Specu...",
    "operational_effect": "When this boundary is respected, speculative execution gives real latency wins with bounded blast radius: losers cost compute but leave no trace, and the merge is a clean single-branch commit. When it is violated, the failure is *silent and post-hoc* — every agent reports success, the graph shows a clean merge, and the corruption surfaces only in the winning..."
  },
  "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": "5d3fc5dc58d73f4fb25eb6fa5e884eb97958dbd648e3cd3ad334c987f47adf5d",
    "verified_classes": [
      "SpeculativeRollbackViolation",
      "Tool"
    ],
    "verified_functions": [
      "assert_branch_speculable",
      "verify_rollback",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculativeRollbackViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
