{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculative-branch-merge-has-silently-inherited-a-divergent-tool-side-effect",
  "title": "How does an instance detect that a speculative branch merge has silently inherited a divergent tool side effect",
  "date_of_record": "2026 November 27",
  "scope": "Applies to any orchestrator that forks multiple agents over a shared task state, lets each branch invoke tools with real side effects, and merges or rolls back branches based on a divergence score. Does not apply to purely read-only tool graphs or to single-branch linear execution where no merge step exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-merge-has-silently-inherited-a-divergent-tool-side-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-merge-has-silently-inherited-a-divergent-tool-side-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-branch-merge-has-silently-inherited-a-divergent-tool-side-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1987,
    "python_slice_tokens": 357,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a branch failed.\" It is that a branch *succeeded, was merged, and carried a side effect that belongs to a branch the orchestrator believes it discarded.* Speculative execution assumes the cheap, reversible part of a branch is its reasoning trace and the expensive, irreversible part is its tool calls. Branch-and-merge rollback is typically...",
    "what_was_observed": "A three-way speculative fan-out over a customer-refund task. Branch A (conservative) decided the refund was invalid and issued no action. Branch B (aggressive) called `issue_refund(order_id, amount)` and then called `notify_customer(...)`. Branch C (audit) read the order and agreed with A. The merge policy picks the branch with the highest agreement weight; A and C agree, so A wins, and B is rolled back. The rollback...",
    "condition_of_validity": "The invariant holds — and the guardrail is required — exactly when all three of the following are true: 1. **Fan-out branches share a mutable external resource namespace.** Two branches can write the same order, the same file path, the same queue. If branch tool effects are namespaced per-branch (distinct sandbox, distinct tenant key), merge rollback is safe...",
    "decision_boundary": "The boundary is **whether rollback is defined over state or over effects.** State-rollback (restore snapshot, discard tokens) is cheap and is what speculative execution is built on. Effect-rollback requires a compensation action per committed tool call, and compensation is not always possible (`send_email` has no unsend; `issue_refund` has a reversal but it ...",
    "operational_effect": "Without the ledger join, speculative fan-out silently converts a rollback into a *partial commit with amnesia*. The blast radius scales with fan-out width and with the fraction of tools that are irreversible. The failure is invisible in per-branch logs (each branch is internally consistent) and invisible in the merge log (the merge succeeded on its own terms..."
  },
  "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": "92d7667381663c264911da31918a8b927e9142efdd74f1f0ee40398bcd14a98b",
    "verified_classes": [
      "UnreconciledBranchEffect",
      "Effect",
      "Branch"
    ],
    "verified_functions": [
      "merge_speculative_branches",
      "post_merge_ledger_check"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnreconciledBranchEffect"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
