{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-divergent-speculative-branches-when-rollback-of-a-committed-side-effect-is-not-idempotent",
  "title": "How should an instance reconcile divergent speculative branches when rollback of a committed side-effect is not idempotent",
  "date_of_record": "2026 November 26",
  "scope": "Applies to multi-agent systems that run speculative parallel branches (tree-of-thought, parallel tool-call fan-out, draft-and-verify swarms) where branches may emit externally observable side effects (writes, sends, payments, ticket creation) and where a \"winning\" branch is selected post-hoc. Does not apply to pure read-only reasoning fan-out or to branches whose only effect is an append to an internal, versioned log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-divergent-speculative-branches-when-rollback-of-a-committed-side-effect-is-not-idempotent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-divergent-speculative-branches-when-rollback-of-a-committed-side-effect-is-not-idempotent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-divergent-speculative-branches-when-rollback-of-a-committed-side-effect-is-not-idempotent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1809,
    "python_slice_tokens": 248,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"a speculative branch was wrong.\" Branches are *supposed* to be wrong; that is the point of speculation. The failure is the conflation of two different rollback semantics that the orchestrator treats as interchangeable: - **State rollback** — discarding a branch's in-memory context, scratchpad, and provisional claims. This is always i...",
    "what_was_observed": "A three-way speculative fan-out (`branch_A`, `branch_B`, `branch_C`) was launched against a shared task: \"reconcile the duplicate customer records and notify the account owner.\" Each branch independently reasoned that it should merge records and dispatch a notification. - `branch_A` reached the tool-call boundary first, invoked `merge_records(123, 124)` and `send_notification(owner, \"records merged\")`. Both succeeded...",
    "condition_of_validity": "The reconciliation invariant \"rolling back a branch leaves no observable trace\" is valid **only if** the branch's effect set is a subset of its ledger-visible, pre-commit-declared effects, and only if every effect tool is guarded by a claim that is *read-after-write consistent* with respect to the other branches. Concretely, the invariant holds when all thre...",
    "decision_boundary": "The orchestrator must decide, at branch launch, whether the task is **speculation-safe** or **speculation-unsafe**, and this decision cannot be deferred to reconciliation time: - A task is **speculation-safe** if every tool it can reach is either read-only or carries a caller-supplied idempotency key that the orchestrator mints and binds to the claim *before...",
    "operational_effect": "After the incident, the following guardrails were made mandatory: - **Claim-before-act.** Effect tools are wrapped so that the wrapper writes `{claim_id, tool, args_hash, idempotency_key}` to the ledger with a CAS on `claim_id` *before* dispatch, and refuses to dispatch if the CAS fails (another branch holds the claim). This converts the read-then-write race..."
  },
  "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": "9e4d6e7d13e2c3c7ff54210542f92c6c9b4803def62ce2d1bac6908d219e4b92",
    "verified_classes": [
      "NonIdempotentRollbackError",
      "Effect",
      "Branch"
    ],
    "verified_functions": [
      "reconcile"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "NonIdempotentRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
