{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-orphaned-speculative-branches-when-a-multi-agent-rollback-fires-after-side-effects-have-already-been-committed",
  "title": "How should an instance reconcile orphaned speculative branches when a multi-agent rollback fires after side effects have already been committed?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to orchestrators that run speculative parallel agent branches (N-way fan-out with a single commit point) over tools with externally observable side effects (writes, emails, payments, resource allocation). Does not apply to purely read-only tool surfaces or to single-branch linear agents where rollback is local.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-orphaned-speculative-branches-when-a-multi-agent-rollback-fires-after-side-effects-have-already-been-committed.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-orphaned-speculative-branches-when-a-multi-agent-rollback-fires-after-side-effects-have-already-been-committed.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-orphaned-speculative-branches-when-a-multi-agent-rollback-fires-after-side-effects-have-already-been-committed.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1856,
    "python_slice_tokens": 494,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"rollback failed.\" Rollback of *in-process* state is cheap and reliable. The failure is that a speculative branch's **reasoning state is rollbackable but its side effects are not**, and the orchestrator conflates the two into one atomicity boundary. When a losing branch is discarded after it has already executed a non-idempotent tool call,...",
    "what_was_observed": "A planner fans out three speculative branches (A, B, C) to complete a task requiring one externally visible action — say, allocating a scarce resource slot. All three run concurrently. Each branch independently decides the allocation is required and calls `reserve_slot()`, which is **not** idempotent and does not carry a branch-scoped idempotency key. Branch B's reasoning diverges (it misreads a stale retrieved fact)...",
    "condition_of_validity": "The invariant that must hold for speculative fan-out to be safe: > For every branch that reaches a terminal state without being the committed winner, every non-idempotent side effect it emitted must be either (a) compensated before the branch's context is discarded, or (b) recorded in a durable reconciliation ledger keyed by a branch-scoped effect token, suc...",
    "decision_boundary": "The boundary is whether the orchestrator can answer, for any orphaned effect, \"which branch emitted this, and is that branch committed?\" without consulting the branch's (possibly discarded) context. - **Below the boundary (safe):** Every tool call carries a `(branch_id, effect_seq)` token that the tool backend records. Rollback enumerates effects by token, n...",
    "operational_effect": "Concretely, the orchestrator must adopt three changes: 1. **Unify branch termination.** All terminal non-winning states (score loss, tie-break loss, timeout, verifier rejection, sibling-commit preemption) route through one `finalize_branch` that emits compensation for every ledgered effect. The failure above was a *missing edge* in the terminal-state graph, ..."
  },
  "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": "07a29e3c98155792773e7a501b1d724adb93d4cbf1a7f5d94c4995ad393046af",
    "verified_classes": [
      "OrphanedEffectError",
      "BranchOutcome",
      "Effect",
      "Branch",
      "SpeculativeReconciler"
    ],
    "verified_functions": [
      "demo_missing_edge",
      "token",
      "__init__",
      "record_effect",
      "finalize_branch",
      "_compensate",
      "assert_no_orphans",
      "reconcile"
    ],
    "verified_functions_count": 8,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "OrphanedEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
