{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculative-winner-s-commit-invalidates-a-sibling-branch-s-already-applied-side-effects",
  "title": "How does an instance detect that a speculative winner's commit invalidates a sibling branch's already-applied side effects?",
  "date_of_record": "2026 November 20",
  "scope": "Applies to orchestrators that fan a single task into parallel speculative branches (tree-of-thought, best-of-N, parallel MCTS rollouts) where branches may perform *external, non-transactional side effects* (tool calls, writes, messages) before a winner-take-all commit is selected. Does not apply to branches confined to a pure sandbox with no outbound effects, nor to single-branch execution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-winner-s-commit-invalidates-a-sibling-branch-s-already-applied-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-winner-s-commit-invalidates-a-sibling-branch-s-already-applied-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-winner-s-commit-invalidates-a-sibling-branch-s-already-applied-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1372,
    "python_slice_tokens": 257,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a branch produced a wrong answer.\" It is that **speculative execution and side-effecting tools are incompatible unless the commit protocol is a two-phase barrier over effects, not just over state.** Most orchestrators treat rollback as a *state* operation: discard the losing branches' context, keep the winner's. But a branch that called `...",
    "what_was_observed": "A task (\"reconcile this invoice and file the correction\") was fanned into N=4 branches. Each branch ran the same tool loop with temperature and retrieval seeds varied. Branches 1 and 3 both reached the \"file correction\" step and each issued an idempotent-by-intent but **not idempotent-by-key** write to the accounting tool, using locally generated transaction IDs derived from each branch's own trace hash. Branch 2 won...",
    "condition_of_validity": "The winner-take-all commit is sound **only if** every branch's effects are either (a) buffered and never emitted until commit, or (b) emitted with a shared, deterministic idempotency key such that all branches' identical-intent writes collapse to one. The failure requires *all* of the following to co-occur: 1. At least two branches reach the same effect-emit...",
    "decision_boundary": "The orchestrator must decide, *before fan-out*, between two protocols: - **Effect-buffered speculation:** branches may *plan* effects but route all emissions through a staging buffer tagged with `branch_id`; on commit, only the winner's buffer is flushed, losers' buffers are dropped. Safe, but requires every tool to expose a dry-run/stage mode. - **Effectful...",
    "operational_effect": "The correction is a **commit-time reconciliation read**, not a context operation. After selecting the winner, the orchestrator must query the external system for effects attributable to the task window and assert `count == winner_effects`. If the observed count exceeds the winner's declared effects, losers leaked; the commit must be marked **contaminated** a..."
  },
  "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": "9fda1e807be95681bc0b5f4eba6a4b3da0712dccd64a98c7bd5c49de0372ae56",
    "verified_classes": [
      "SpeculativeCommitContamination",
      "Effect",
      "Branch"
    ],
    "verified_functions": [
      "intent_key",
      "commit_winner"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculativeCommitContamination"
    ],
    "sample_fail_closed_invariants": [
      "no branches to commit"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
