{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-halt-a-speculative-branch-when-an-optimistic-tool-invocation-has-already-produced-irreversible-side-effects-before-the-rollback",
  "title": "Where must an instance halt a speculative branch when an optimistic tool invocation has already produced irreversible side effects before the rollback barrier is reached",
  "date_of_record": "2026 November 25",
  "scope": "Applies to any orchestrator that fans a task into parallel speculative branches, each permitted to invoke tools optimistically (fire-then-verify) under the assumption that loser branches can be rolled back to a pre-fork checkpoint. Does not apply to read-only tool surfaces or to branches whose tool calls are gated behind a two-phase commit.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-halt-a-speculative-branch-when-an-optimistic-tool-invocation-has-already-produced-irreversible-side-effects-before-the-rollback.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-halt-a-speculative-branch-when-an-optimistic-tool-invocation-has-already-produced-irreversible-side-effects-before-the-rollback.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-halt-a-speculative-branch-when-an-optimistic-tool-invocation-has-already-produced-irreversible-side-effects-before-the-rollback.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1701,
    "python_slice_tokens": 216,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters here is between *reversible speculation* and *irreversible speculation*, and where the boundary between them actually falls relative to the rollback barrier. A speculating orchestrator forks N branches from a shared checkpoint, lets each branch reason and call tools concurrently, then commits the winning branch and rolls the lose...",
    "what_was_observed": "A planner forked three branches to satisfy a \"reconcile customer billing discrepancy\" task. Branch A chose to issue a refund via the payments tool; Branch B chose to open a support ticket and wait; Branch C chose to recompute the invoice and correct a line item. All three ran optimistically in parallel. Branch C finished first with the highest-confidence resolution, the arbiter selected it, and A and B were rolled ba...",
    "condition_of_validity": "Optimistic parallel speculation with loser rollback is valid if and only if, for every tool `t` reachable by any branch, `undo_class(t) ⊆ checkpoint.undo_set` at the moment the branch invokes `t`. This is a *dynamic* membership test, not a static one: the same tool can be reversible on one call and irreversible on the next depending on arguments and prior st...",
    "decision_boundary": "The instance must halt the branch—not roll it back—the moment it detects that an optimistic invocation has crossed into an effect class outside the checkpoint's undo set, or that a losing branch has an in-flight call whose terminal state is unknown at barrier time. Halt means: freeze the branch, mark the checkpoint *tainted*, and escalate to a reconciler tha...",
    "operational_effect": "The practical consequence is that speculative fan-out must be *effect-tiered* before it is parallelized. Cheap, reversible tools (retrieval, scratch computation, reversible state writes) may be invoked optimistically by any branch. Irreversible tools (payments, outbound messaging, external mutations) must be gated behind a per-fork lease that only the *provi..."
  },
  "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": "040bfee0ded6447776be2234c536fb0cf4385bbfa241a6eaa88629e97b176c80",
    "verified_classes": [
      "UnrollbackableEffectError",
      "Branch"
    ],
    "verified_functions": [
      "rollback_branch",
      "invert",
      "__init__"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnrollbackableEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
