{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-refuse-to-commit-a-speculative-branch-when-rollback-cannot-restore-a-non-idempotent-external-effect",
  "title": "In what scenarios must an instance refuse to commit a speculative branch when rollback cannot restore a non-idempotent external effect",
  "date_of_record": "2026 November 25",
  "scope": "Applies to orchestrators that fan out parallel agent branches speculatively (optimistic execution) and commit the first branch to satisfy a goal predicate while rolling back the rest. Does not apply to branches whose side effects are fully transactional or confined to a single recoverable store.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-commit-a-speculative-branch-when-rollback-cannot-restore-a-non-idempotent-external-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-commit-a-speculative-branch-when-rollback-cannot-restore-a-non-idempotent-external-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-refuse-to-commit-a-speculative-branch-when-rollback-cannot-restore-a-non-idempotent-external-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1653,
    "python_slice_tokens": 252,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative parallel execution treats a branch as *discardable* until commit. That assumption holds only for branch-local state. The failure mode is not \"the wrong branch won.\" It is that rollback restores *internal* state (context, scratchpad, vector store writes, plan graph) but cannot restore *external* effects already emitted by a losing branch—emails se...",
    "what_was_observed": "An orchestrator spawned three branches to fulfill \"reconcile the customer's duplicate subscription.\" Each branch independently called a `refund` tool, then a `close_account` tool, then wrote a resolution record. Branch B finished first and satisfied the goal predicate; the orchestrator committed B and issued rollback to A and C. Rollback cleared A and C's context, deleted their scratchpad entries, and marked their re...",
    "condition_of_validity": "Speculative commit with rollback is valid **only** under all of the following: 1. **Effect fencing.** Every external write is tagged with the branch's speculative token and is not made durable/observable until that token is committed. A publish goes to a staging queue keyed by token; a refund carries a token the gateway honors as \"pending until commit.\" 2. *...",
    "decision_boundary": "The boundary is drawn at the first irreversible effect, not at branch completion. Concretely: - **Before** any branch emits a non-fenced, non-compensable effect: speculation is permitted and rollback is sound. - **The instant** a branch emits such an effect: that branch is no longer speculative. The orchestrator must either (a) treat that branch as the *sole...",
    "operational_effect": "An orchestrator that respects this boundary pays a measurable latency tax: branches that touch irreversible tools must either be fenced (adds a commit round-trip) or serialized (adds full branch latency). In our trace, serializing the three branches raised task latency from 4.2 s to 7.9 s but eliminated the double refund. The fencing approach (staging queue ..."
  },
  "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": "1021478d9c7feffd2996cacf1fa75f16d91cac4b8d9ff1267dcba533082ea340",
    "verified_classes": [
      "IrreversibleEffectLeak",
      "EffectKind",
      "Effect",
      "Branch"
    ],
    "verified_functions": [
      "commit_branch"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "IrreversibleEffectLeak"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
