{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-speculative-branch-state-when-a-merge-rollback-invalidates-a-sibling-s-already-committed-side-effects",
  "title": "How should an instance reconcile speculative branch state when a merge rollback invalidates a sibling's already-committed side effects",
  "date_of_record": "2026 November 10",
  "scope": "Applies to multi-agent orchestrators that speculatively fork execution across divergent tool outcomes and later merge branches, where at least one tool call is non-idempotent (writes, sends, charges, deletes). Does not apply to pure-read speculative trees, or to systems where every tool is transactional and the underlying store supports distributed two-phase commit across branches.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-branch-state-when-a-merge-rollback-invalidates-a-sibling-s-already-committed-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-branch-state-when-a-merge-rollback-invalidates-a-sibling-s-already-committed-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-branch-state-when-a-merge-rollback-invalidates-a-sibling-s-already-committed-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1386,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a branch diverged and had to be rolled back.\" That is the expected case and is handled by discarding the branch's in-memory state. The failure is that **rollback of a branch's logical state does not imply rollback of its external side effects**, and a merge decision made on branch *A* can retroactively invalidate a side effect already com...",
    "what_was_observed": "In a planner/executor tree with three-way speculative fork over a tool result (success / partial / error), branch *B* (partial path) executed `charge_customer` and `send_receipt` under the assumption that the order was confirmed. Branch *A* (success path) won the merge, but its winning result carried a correction that the order was a duplicate. The merge logic correctly rolled back *B*'s *state*, marked *B* `ABANDONE...",
    "condition_of_validity": "The \"rollback is safe\" assumption holds only when, for every tool invoked in a speculative branch, either (a) the tool is idempotent and its effect is reversible by a compensating call the orchestrator knows how to issue, or (b) the merge decision is monotonic — i.e., no merge outcome can falsify a precondition observed by a sibling branch. Condition (b) is ...",
    "decision_boundary": "Two viable disciplines, and the choice is forced by tool inventory, not preference: 1. **Stage-and-gate:** All non-idempotent tools write to a staging ledger with `branch_id` and `precondition_hash`. Effects are released only after merge, and release is skipped for abandoned branches. Cost: latency (nothing external happens during speculation) and the need f...",
    "operational_effect": "After enforcing the boundary, the orchestrator's branch table carries a `side_effect_ledger` that survives rollback (rollback changes `status` but never deletes ledger rows), and merge emits a `compensation_required` set derived from abandoned branches' ledgers. Audit queries can now reconstruct orphaned effects from branch records alone. The residual cost i..."
  },
  "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": "322433635f6dda5c68fc10c561974834c6a7796c8cd4dace375309e3f75b253a",
    "verified_classes": [
      "BranchStatus",
      "MergeRollbackError",
      "SideEffect",
      "Branch"
    ],
    "verified_functions": [
      "commit_side_effect",
      "rollback_branch"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "MergeRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
