{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-merges-a-speculative-branch-whose-tool-side-effects-were-already-committed-downstream",
  "title": "What happens when an instance merges a speculative branch whose tool side-effects were already committed downstream",
  "date_of_record": "2026 November 22",
  "scope": "Applies to orchestrators that fork parallel agent branches to hedge against non-deterministic tool outcomes, then merge the winning branch and roll back losers. Does not apply to strictly linear single-agent loops or to branches that touch only read-only tools.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-a-speculative-branch-whose-tool-side-effects-were-already-committed-downstream.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-a-speculative-branch-whose-tool-side-effects-were-already-committed-downstream.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-merges-a-speculative-branch-whose-tool-side-effects-were-already-committed-downstream.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1696,
    "python_slice_tokens": 290,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"rollback failed.\" Rollback of *state* almost always succeeds because state is the thing the orchestrator owns. The failure is that rollback was scoped to the branch's *local* context and working memory, while the branch's *tool effects* had already propagated into a downstream surface the orchestrator does not checkpoint: a message queue,...",
    "what_was_observed": "A planner agent decomposed a task into \"resolve target resource identity\" followed by \"apply configuration.\" Because identity resolution was flaky (two candidate endpoints, non-deterministic DNS resolution and a rate-limited registry), the orchestrator forked two speculative branches: - **Branch A** resolved the resource to `res-7f3a` and wrote a claim record to a shared coordination table (`claimed_by=A`) as a preco...",
    "condition_of_validity": "The merge-and-rollback protocol is sound **iff** all of the following hold at the instant the arbiter commits: - **Effect isolation:** every tool invoked by any branch is either (a) read-only, (b) idempotent and commutative on its key, or (c) buffered in a branch-private staging area that is only flushed on commit. - **Single-writer on shared surfaces:** no ...",
    "decision_boundary": "The operative question is not \"did rollback run?\" but \"could any committed effect have been *observed* by a consumer outside the rollback domain before the commit barrier?\" - If **no** — proceed with fork/merge. Cheap, safe. - If **yes, and the effect is idempotent/commutative** — proceed, but require the arbiter to reconcile duplicates (e.g., collapse two c...",
    "operational_effect": "The practical consequence is a class of bugs where the *committed* branch fails or corrupts state for reasons that trace to a *discarded* branch, and the audit trail blames the winner. Post-mortems chase the wrong agent. Retries re-fork and re-poison. The system appears to have a nondeterministic flakiness that correlates with concurrency but not with any si..."
  },
  "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": "1763aeee58dd2e0c1844428c1277184cfd881bcd8c7832474aec1fbf73c8c5dd",
    "verified_classes": [
      "SpeculativeIsolationViolation",
      "Branch",
      "SharedSurface"
    ],
    "verified_functions": [
      "commit_branch",
      "stage_effect",
      "observe"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeIsolationViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
