{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abort-a-speculative-branch-whose-optimistic-tool-call-has-already-committed-an-irreversible-external-side-effect",
  "title": "When must an instance abort a speculative branch whose optimistic tool call has already committed an irreversible external side effect?",
  "date_of_record": "2026 November 19",
  "scope": "Applies to multi-agent orchestrators that fork speculative branches of an agent plan, issue optimistic (unconfirmed) tool calls in parallel, and later merge or roll back branches based on peer/auditor consensus. Does not apply to purely read-only tool surfaces or to single-threaded agent loops with no branch-and-merge layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-whose-optimistic-tool-call-has-already-committed-an-irreversible-external-side-effect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-whose-optimistic-tool-call-has-already-committed-an-irreversible-external-side-effect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-whose-optimistic-tool-call-has-already-committed-an-irreversible-external-side-effect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2065,
    "python_slice_tokens": 336,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *rollback of agent state* and *rollback of the world*. A branch-and-merge orchestrator maintains a checkpoint of each speculative branch's context, scratchpad, and tool-call ledger. Rolling back a branch means discarding that checkpoint and re-admitting the parent state. This is a local, deterministic, cheap operation....",
    "what_was_observed": "A three-branch planner was asked to reconcile a customer refund. The orchestrator forked: - B₁: refund via payment gateway `refund()` (optimistic, non-idempotent, no idempotency key). - B₂: refund via store-credit ledger `credit()` (optimistic, idempotent). - B₃: escalate to human queue (read-mostly). All three were launched optimistically to hide latency. B₁ and B₂ both completed their tool calls before the auditor ...",
    "condition_of_validity": "Rollback-as-reversal is only valid under one of three conditions, and the orchestrator must be able to *prove* which holds at merge time: 1. **The tool is idempotent and reversible** (e.g., `credit()` with a deduplication key). Reversal is a compensating call, not a state discard. 2. **The tool call has not yet committed.** The optimistic call is still in-fl...",
    "decision_boundary": "At the moment the auditor returns a verdict, the orchestrator sits on a decision boundary. The wrong decision — rolling back a sticky branch — is silent and unrecoverable. The correct decision requires a check that is cheap but easy to omit: - **If the target branch is sticky** (has ≥1 committed irreversible receipt): do not roll back. Either (a) merge it an...",
    "operational_effect": "The practical consequence is that speculative execution's latency win is only real for branches whose tool calls are reversible or gated. For irreversible calls, optimism buys latency at the cost of a class of silent double-effect bugs that are invisible to ledger-based reconciliation because the ledger is the thing that lost the record. Teams typically disc..."
  },
  "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": "ff78576d451861c08b91ed8db4f37b3f40eac8bcb97be62e17e4f4a110c60651",
    "verified_classes": [
      "ToolClass",
      "StickyRollbackError",
      "Receipt",
      "Branch",
      "SpeculativeOrchestrator"
    ],
    "verified_functions": [
      "reconcile",
      "is_sticky",
      "__init__",
      "commit_optimistic_call",
      "rollback",
      "merge"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "StickyRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
