{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-phantom-merge-divergence-in-speculative-multi-agent-branch-and-merge-execution",
  "title": "How does an instance detect phantom merge divergence in speculative multi-agent branch-and-merge execution",
  "date_of_record": "2026 November 12",
  "scope": "Applies to speculative execution graphs where two or more agents branch from a common checkpoint, mutate shared-but-versioned state, and are later merged by a coordinator that must decide whether to commit or roll back. Does not apply to strictly linear agent pipelines, nor to branch-and-merge systems where each branch owns physically disjoint state (no shared mutable namespace), nor to systems where merge is decided by an external oracle rather than by structural comparison.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-phantom-merge-divergence-in-speculative-multi-agent-branch-and-merge-execution.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-phantom-merge-divergence-in-speculative-multi-agent-branch-and-merge-execution.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-phantom-merge-divergence-in-speculative-multi-agent-branch-and-merge-execution.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2046,
    "python_slice_tokens": 529,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure of interest is not *detecting divergence*. Divergence detection is cheap and well-understood: compare branch outputs, compare state hashes, compare tool-call logs. The non-obvious boundary is the distinction between **real divergence** (branches produced genuinely incompatible outcomes that require rollback) and **phantom divergence** (branches p...",
    "what_was_observed": "In a three-agent branch-and-merge graph (planner, executor, verifier) operating over a versioned key-value store with optimistic concurrency, the following sequence recurred at roughly 1 in 400 merges under load: 1. Executor branches at snapshot `S0` and reads key `k` at version `v3`. 2. Executor performs its task and writes a *new* key `k'` (derived from `k`) at version `v1`. 3. Meanwhile the planner, on a sibling b...",
    "condition_of_validity": "The merge decision is valid — i.e., a rollback is *necessary* rather than merely *safe* — only when all three of the following hold: - The branch's recorded precondition is compared against a comparison basis that no sibling branch or background process can mutate between snapshot and merge. In practice this means the comparison must be against the *branch's...",
    "decision_boundary": "The operational rule: **a merge-time mismatch is actionable only if it is reproducible against the branch's frozen snapshot.** Concretely, the coordinator should, on any mismatch, re-run the comparison against the snapshot the branch was created from. If the branch's output is compatible with that snapshot, the mismatch is phantom and the merge should procee...",
    "operational_effect": "Systems that do not separate the comparison basis exhibit a characteristic signature: rollback rate scales with sibling-branch concurrency, not with task difficulty. Throughput plateaus because every added branch increases the chance of a phantom mismatch, and the coordinator's response (rollback and retry) adds load that increases the chance further. The sy..."
  },
  "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": "783070539bd8b7c22f65a57005586354e8c0595b57746e31f8857a9069ea215b",
    "verified_classes": [
      "PhantomDivergenceError",
      "RealDivergenceError",
      "Snapshot",
      "BranchResult"
    ],
    "verified_functions": [
      "_value_equal",
      "decide_merge",
      "merge_or_raise"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "PhantomDivergenceError",
      "RealDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
