{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-reject-a-semantically-merged-speculative-branch-when-optimistic-execution-has-already-committed-side-effects",
  "title": "Under what conditions must an instance reject a semantically merged speculative branch when optimistic execution has already committed side effects",
  "date_of_record": "2026 December 2",
  "scope": "Applies to multi-agent systems where N workers speculatively execute against a shared base state, detect conflicts, and resolve them via an LLM-driven semantic merge before commit. Does not apply to byte-exact merge (git-style) or to single-agent retry loops.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-reject-a-semantically-merged-speculative-branch-when-optimistic-execution-has-already-committed-side-effects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-reject-a-semantically-merged-speculative-branch-when-optimistic-execution-has-already-committed-side-effects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-reject-a-semantically-merged-speculative-branch-when-optimistic-execution-has-already-committed-side-effects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1437,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the merge was wrong.\" It is that the semantic merge resolved a *textual* conflict on a *stateful* branch whose side effects were already externally observable. Optimistic execution assumes the merge point is a pure function of the branch contents. When a branch has emitted tool calls — writes, payments, messages, MCP resource mutations — ...",
    "what_was_observed": "Three workers (W1, W2, W3) forked from base state `S0` at t=0. W1 executed a plan that read `inventory.sku_42 = 10` and emitted `reserve(7)`. W2 read the same and emitted `reserve(6)`. W3 read the same and emitted `reprice(sku_42, +3%)`. Each worker checkpointed its branch as `(diff, side_effects[], read_set[])`. Conflict detection fired on the `reserve` writes (overlapping keys) and on `reprice` (touches a field in ...",
    "condition_of_validity": "A semantic merge is valid only when all of the following hold for every branch `b` in the merge set: 1. `b.side_effects` is empty, OR every effect in `b.side_effects` is `idempotent` and `replayable_against(base = merged_base)`. 2. `b.read_set ∩ (⋃_{b'≠b} b'.side_effects.keys)` is empty, OR the merge explicitly re-executes `b` against the merged base and dis...",
    "decision_boundary": "Reject the merge — do not merely flag it — when: - Any branch has committed a non-idempotent side effect (payment, message send, external reservation) AND its read set intersects another branch's effect keys. - The merged base's version differs from any branch's `observed_version` on a key in that branch's read set. - The semantic merger's output diff requir...",
    "operational_effect": "Systems that treat semantic merge as a diff operation over plans will, under load, commit effects that the merge plan does not account for. The symptom is not a merge error — it is a post-merge state that violates an invariant no single branch violated. Detection requires an effect-log reconciliation pass that the merger does not perform. The architectural g..."
  },
  "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": "d9ea803115e5bfeb04e547d74d5c1e5f6f2589fc6c5f616c95943b02e7d03c3f",
    "verified_classes": [
      "UnsoundSpeculativeMergeError",
      "Branch"
    ],
    "verified_functions": [
      "effects_reconcilable",
      "commit_speculative_merge",
      "non_idempotent_effects"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UnsoundSpeculativeMergeError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
