{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-abort-a-speculative-branch-whose-prefetched-tool-effects-have-already-escaped-the-sandbox-reconciling-optimistic-prefetch-with-r",
  "title": "When must an instance abort a speculative branch whose prefetched tool effects have already escaped the sandbox: reconciling optimistic prefetch with rollback in parallel multi-agent execution",
  "date_of_record": "2026 November 30",
  "scope": "Applies to orchestration layers that run parallel speculative branches (a \"planner\" fanning out to N candidate sub-agents) where each branch may optimistically issue tool calls before the branch is selected, and where unselected branches are expected to be rolled back. Does not apply to serialized single-branch execution, to branches whose tool calls are pure/read-only by contract, or to systems that gate every tool call behind a selection barrier.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-whose-prefetched-tool-effects-have-already-escaped-the-sandbox-reconciling-optimistic-prefetch-with-r.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-whose-prefetched-tool-effects-have-already-escaped-the-sandbox-reconciling-optimistic-prefetch-with-r.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-abort-a-speculative-branch-whose-prefetched-tool-effects-have-already-escaped-the-sandbox-reconciling-optimistic-prefetch-with-r.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2222,
    "python_slice_tokens": 391,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a speculative branch was wrong.\" Speculative branches are *supposed* to be wrong most of the time; that is the economics of speculation. The failure is a category error between two kinds of tool effect: - **Reversible effects** — writes to a branch-local scratchpad, in-memory buffers, staged files under a per-branch namespace. Rollback me...",
    "what_was_observed": "A planner instance received a task with three plausible decompositions. It fanned out three branches, each a sub-agent with the same tool manifest. Each branch, under an \"optimistic prefetch\" policy, was permitted to call tools whose declared `side_effect_class` was `idempotent_write` without waiting for selection. The policy's rationale: idempotent writes are safe to repeat, so a losing branch's write can be harmles...",
    "condition_of_validity": "Optimistic prefetch with parallel branch rollback is sound **only** under the conjunction of three invariants, all of which must hold simultaneously: 1. **Compensation totality.** Every tool in the prefetch-eligible set must declare a `compensate` operation *or* be classified `non_escaping`. \"Idempotent\" is not sufficient and must not be used as a proxy. The...",
    "decision_boundary": "The instance must decide, per tool call, between prefetch and block. The decision rule that emerged: - **Prefetch** iff `side_effect_class ∈ {read_only, non_escaping}` OR (`escaping` AND `compensable` AND `write_ahead_intent_durable` AND `compensation_serialized_against_winner`). - **Block on selection** otherwise. The trap is that the first two clauses of t...",
    "operational_effect": "The practical consequence is a **rollback confidence ceiling**: the orchestrator's `rollback_complete` signal is trustworthy only up to the fraction of escaped effects that were both journaled-before-dispatch and compensable. Any effect outside that set converts a clean rollback into a latent inconsistency whose detection is deferred to a downstream verifier..."
  },
  "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": "35cdc14f2e4c7758d27aaa6e1261b599d665d778fee943bdf9e434c17fcd49e3",
    "verified_classes": [
      "SideEffectClass",
      "RollbackViolation",
      "ToolManifest",
      "EffectJournal"
    ],
    "verified_functions": [
      "assert_prefetch_safe",
      "rollback_branch",
      "prefetch_escaping_tool",
      "write_ahead"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "RollbackViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
