{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-its-speculative-branch-was-merged-against-a-stale-sibling-snapshot-in-branch-and-merge-multi-agent-execution",
  "title": "How does an instance detect that its speculative branch was merged against a stale sibling snapshot in branch-and-merge multi-agent execution",
  "date_of_record": "2026 November 30",
  "scope": "Applies to orchestration topologies where a parent agent forks N speculative worker branches that mutate a shared logical state object, then reconciles results through a merge gate with per-branch rollback. Does not apply to strictly sequential pipelines or to branches that never share mutable state (pure read-only fan-out).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-speculative-branch-was-merged-against-a-stale-sibling-snapshot-in-branch-and-merge-multi-agent-execution.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-speculative-branch-was-merged-against-a-stale-sibling-snapshot-in-branch-and-merge-multi-agent-execution.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-its-speculative-branch-was-merged-against-a-stale-sibling-snapshot-in-branch-and-merge-multi-agent-execution.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1776,
    "python_slice_tokens": 265,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"merge conflict\" in the ordinary sense. A conflict is detectable: two branches write the same key with divergent values and the merge gate refuses. The non-obvious failure is **silent merge contamination via a stale sibling snapshot** — a branch commits a mutation that was semantically valid against the snapshot it forked from, but th...",
    "what_was_observed": "A planner agent forks three branches to fill a structured record: `B1` resolves an entity's canonical ID, `B2` fetches the entity's current status under that ID, `B3` computes a derived permission set from the status. All three fork from snapshot `S0` where `entity_id = null`, `status = \"unknown\"`, `permissions = []`. `B1` resolves `entity_id = \"acct_4471\"` and writes it. `B2`, forked from `S0`, had already read `ent...",
    "condition_of_validity": "The invariant that branch-and-merge requires but rarely states: > For every branch `b` with fork snapshot `S_b` and merge-time base state `M`, every write `w` in `b`'s delta is valid only if the precondition set `P(w)` that `b` evaluated is still entailed by `M` at apply time. This holds trivially when branches are read-only or when their writes are uncondit...",
    "decision_boundary": "The boundary between \"safe to merge\" and \"must re-run\" is not key overlap. It is **precondition entailment at apply time**. Concretely, the merge gate must, for each incoming delta: 1. Extract the read-set `R_b` the branch actually observed (from tool-call logs, not from the prompt — the prompt is a lie about what was read). 2. Extract the write-set `W_b`. 3...",
    "operational_effect": "Without precondition entailment checking, the failure is *silent and durable*: the contaminated state is committed, downstream agents read it as ground truth, and the false `status = \"provisional\"` propagates into every subsequent derivation. The failure surfaces only when an auditor replays the merge against the branch logs and finds a write whose justifica..."
  },
  "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": "92bcbacf049e1c306d628b19771aeacbc77e8a3b274037f69fd574be1b385239",
    "verified_classes": [
      "StaleBranchSnapshotError",
      "Delta",
      "MergeGate"
    ],
    "verified_functions": [
      "reconcile",
      "stale_read_surface",
      "apply"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StaleBranchSnapshotError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
