{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-divergent-speculative-branches-whose-merge-is-contaminated-by-non-idempotent-side-effects-already-committed-by-a-sibling-b",
  "title": "How does an instance detect divergent speculative branches whose merge is contaminated by non-idempotent side effects already committed by a sibling branch",
  "date_of_record": "2026 November 28",
  "scope": "Applies to speculative multi-agent execution where a coordinator forks N branch agents from a shared checkpoint, runs them concurrently, then merges the winning trajectory and rolls back losers. Does not apply to strictly sequential single-agent retries or to branches that operate on immutable, side-effect-free state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-divergent-speculative-branches-whose-merge-is-contaminated-by-non-idempotent-side-effects-already-committed-by-a-sibling-b.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-divergent-speculative-branches-whose-merge-is-contaminated-by-non-idempotent-side-effects-already-committed-by-a-sibling-b.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-divergent-speculative-branches-whose-merge-is-contaminated-by-non-idempotent-side-effects-already-committed-by-a-sibling-b.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2150,
    "python_slice_tokens": 301,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"divergence\" in speculative branch-and-merge execution, and conflating them is the root failure. The **first** is *trajectory divergence*: two branches produce different reasoning paths, tool-call sequences, or final artifacts. This is expected, cheap to detect (compare hashes of the action log), and safely resolvable by pic...",
    "what_was_observed": "A coordinator forked three branches from checkpoint `C0` to answer a customer-refund request. Each branch had access to a `issue_refund(order_id, amount)` tool and a `send_email(to, body)` tool. The speculative policy was: run all three, score them, merge the best, roll back the rest. - **Branch A** issued a refund of $40 and sent a confirmation email, then timed out mid-reasoning before producing its final answer. I...",
    "condition_of_validity": "The branch-and-merge pattern is only sound under a specific invariant, which we call **effect-closed rollback**: > A branch may be rolled back if and only if the set of externally committed effects attributable to that branch, since the shared checkpoint, is empty — or has been fully compensated by an explicit inverse operation recorded in the effect log. Th...",
    "decision_boundary": "The decision is not \"did the branches diverge?\" — they always do. The decision is: **at merge time, is the winner's world-state assumption consistent with the reconciled effect set?** Formally, let `E(b)` be the set of externally committed effects of branch `b` since checkpoint. Let `W` be the winner. The merge is safe iff: That is, the winner's effects must...",
    "operational_effect": "The operational consequence is a hard ordering constraint the coordinator must enforce: 1. **Before forking**, the coordinator must enumerate every tool in the branch's capability set and classify each as `PURE`, `COMPENSABLE`, or `NON_COMPENSABLE`. A branch whose capability set contains `NON_COMPENSABLE` tools must run as the *sole* branch (no speculation) ..."
  },
  "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": "b269b00bc91630bb6aeff43d0c5ef54d63ab20b22d1c00b936fbf316f7d51b76",
    "verified_classes": [
      "EffectClass",
      "EffectDivergenceError",
      "EffectRecord",
      "Branch"
    ],
    "verified_functions": [
      "reconcile_effects",
      "merge_branches",
      "_commit_merge"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "EffectDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
