{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-fork-speculative-branches-that-individually-pass-but-merge-into-an-inconsistent-state-the-cross-branch-invariant-gap-in-fan-out-o",
  "title": "Why does an instance fork speculative branches that individually pass but merge into an inconsistent state: the cross-branch invariant gap in fan-out orchestration",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any orchestrator that fans a single task into N speculative agent branches (parallel plans, redundant tool-call paths, or candidate edits), validates each branch in isolation, and merges the survivors. Does not apply to strictly sequential single-branch execution, nor to fan-out where branches operate on disjoint, provably non-interacting state partitions.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-fork-speculative-branches-that-individually-pass-but-merge-into-an-inconsistent-state-the-cross-branch-invariant-gap-in-fan-out-o.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-fork-speculative-branches-that-individually-pass-but-merge-into-an-inconsistent-state-the-cross-branch-invariant-gap-in-fan-out-o.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-fork-speculative-branches-that-individually-pass-but-merge-into-an-inconsistent-state-the-cross-branch-invariant-gap-in-fan-out-o.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2308,
    "python_slice_tokens": 571,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a branch produced wrong output.\" Every branch can be locally correct, pass its own verifier, and still be *jointly* inconsistent with its siblings. The distinction that matters is between **per-branch validity** (each branch satisfies the task predicate against its own private world-state snapshot) and **cross-branch consistency** (the me...",
    "what_was_observed": "A fan-out of width 5 was launched to refactor a module: each branch received the same base snapshot (commit `S0`), the same task predicate `P`, and an independent tool sandbox. Each branch ran to completion, ran its own verifier, and reported `PASS` with a diff `Δᵢ` and a final self-state `Sᵢ = apply(S0, Δᵢ)`. The orchestrator selected the three branches with the highest self-reported confidence and merged by replayi...",
    "condition_of_validity": "The per-branch `PASS` is a valid proxy for merge safety **only under an isolation invariant**: for all pairs `(i, j)`, the effect sets `E(Δᵢ)` and `E(Δⱼ)` must be *non-interfering*—i.e., they touch disjoint keys of the shared state, or the merge operator defines a total, order-independent reconciliation for every overlapping key. Formally, the merge is sound...",
    "decision_boundary": "The boundary between \"merge the survivors\" and \"re-run the conflicted subset jointly\" is crossed when the dependency-closure of the selected branches' effect sets is not a forest. Concretely, build a graph `G` whose nodes are the selected diffs and whose edges are dependency interferences (a write in one that a read-and-depend in another relies on, or a writ...",
    "operational_effect": "Three concrete changes bound the failure: 1. **Effect-set extraction before merge.** Each branch must report not just its diff but its *effect set*: the set of state keys it wrote, and the set of keys it read-and-depended on. The orchestrator intersects these to build `G`. A branch that cannot report its read-dependencies (e.g., because it used an opaque too..."
  },
  "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": "ebffb54442a3e32dc48254a62d243262995c0938da63bb19683c78d86be420e0",
    "verified_classes": [
      "CrossBranchMergeError",
      "Branch"
    ],
    "verified_functions": [
      "_effect_keys",
      "_interferes",
      "build_dependency_graph",
      "_has_cycle",
      "plan_merge",
      "dfs"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "CrossBranchMergeError"
    ],
    "sample_fail_closed_invariants": [
      "dependency cycle among branches; merge order undefined — collapse the cycle and re-run jointly",
      "topological sort stalled; graph not a forest"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
