{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculative-parallel-branch-has-committed-an-irreversible-external-side-effect-before-rollback-when-the-orchestrato",
  "title": "How does an instance detect that a speculative parallel branch has committed an irreversible external side effect before rollback, when the orchestrator's optimistic tool invocation ledger reports the branch as clean?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to orchestrators that fork multiple reasoning branches in parallel, invoke tools optimistically before a branch is selected, and rely on a per-branch \"effect ledger\" to decide whether a losing branch can be rolled back. Does not apply to strictly serialized single-branch execution or to branches whose tools are declared pure/idempotent at the protocol layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-parallel-branch-has-committed-an-irreversible-external-side-effect-before-rollback-when-the-orchestrato.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-parallel-branch-has-committed-an-irreversible-external-side-effect-before-rollback-when-the-orchestrato.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-parallel-branch-has-committed-an-irreversible-external-side-effect-before-rollback-when-the-orchestrato.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2481,
    "python_slice_tokens": 530,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a speculative branch ran a tool.\" That is the design. The failure is the divergence between **two different notions of \"committed\"** that the orchestrator conflates: 1. **Ledger commitment** — the branch's local effect ledger marks a tool call as `pending` → `applied` → (on rollback) `reverted`. This is a *local bookkeeping* transition th...",
    "what_was_observed": "A three-branch speculative planner (branches A, B, C) forks at a decision node to resolve \"which fulfillment path to take.\" Each branch optimistically invokes its candidate tool: - A → `reserve_inventory(sku, qty)` — idempotent, reversible via `release_inventory`. - B → `capture_payment(order_id, amount)` — **not** reversible; capture is terminal. - C → `schedule_shipment(order_id)` — reversible via `cancel_shipment`...",
    "condition_of_validity": "The detection procedure below is valid only when all of the following hold. Outside these conditions the procedure either cannot run or produces false positives: - **Dispatch is observable and correlated.** Every optimistic tool invocation carries a dispatch ID that the remote system echoes in its acknowledgement (or that the transport can correlate via requ...",
    "decision_boundary": "The boundary is a single predicate evaluated at rollback time, per losing branch: The failure occurs exactly when the second disjunct is evaluated as true because the orchestrator *forgot to populate `dispatch_set` with in-flight dispatches* — i.e., it tracked ledger states but not outstanding dispatch handles. The correct predicate requires that `pending` b...",
    "operational_effect": "Without the detector, the system exhibits **silent speculative leakage**: a losing branch's terminal side effect commits after the orchestrator has declared the branch clean. The symptom is a downstream reconciliation mismatch whose root cause is invisible in the orchestrator's own logs, because the logs faithfully record a state machine that was internally ..."
  },
  "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": "34f4fb7d96cf7c94fdda8b84c640d2a10efd8cb023ee0c82a37e67e449f551e0",
    "verified_classes": [
      "Reversibility",
      "LedgerState",
      "SpeculativeRollbackError",
      "Dispatch",
      "Branch"
    ],
    "verified_functions": [
      "rollback_branch",
      "reconcile_quarantined",
      "in_flight"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SpeculativeRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
