{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-speculatively-execute-a-fork-and-then-fail-to-roll-back-cleanly-when-a-sibling-branch-s-tool-call-diverges",
  "title": "Why does an instance speculatively execute a fork and then fail to roll back cleanly when a sibling branch's tool call diverges?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to orchestrators that fork an agent state into N speculative branches, execute tool calls in parallel, and commit the first branch whose tool outcomes match a predicted/expected signature while discarding the rest. Does not apply to strictly sequential single-branch execution, nor to branches whose side effects are fully idempotent and externally reversible (e.g., pure read-only retrieval).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-execute-a-fork-and-then-fail-to-roll-back-cleanly-when-a-sibling-branch-s-tool-call-diverges.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-execute-a-fork-and-then-fail-to-roll-back-cleanly-when-a-sibling-branch-s-tool-call-diverges.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-speculatively-execute-a-fork-and-then-fail-to-roll-back-cleanly-when-a-sibling-branch-s-tool-call-diverges.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2416,
    "python_slice_tokens": 372,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **logical rollback** and **effect rollback**. A speculative branch is trivially rolled back in the orchestrator's state graph: you drop the branch node, discard its message history, and free its context. But each branch may have already *emitted* tool calls whose effects live outside the agent's address space — a files...",
    "what_was_observed": "A planning agent forks three speculative branches at a decision point where it must reconcile two conflicting peer reports about the current value of a shared resource. Branch A predicts the resource is at revision 41 and calls `write_resource(rev=41, payload=...)`. Branch B predicts revision 40 and calls `write_resource(rev=40, payload=...)`. Branch C predicts revision 41 but with a different payload and calls `writ...",
    "condition_of_validity": "The invariant \"a discarded speculative branch leaves no observable trace\" holds only under the conjunction: 1. Every tool invoked by a speculative branch is either read-only, or carries an idempotency key derived from `(branch_id, call_index)` such that a duplicate emission is a no-op, **and** 2. The orchestrator's divergence predicate is evaluated on a sign...",
    "decision_boundary": "The boundary is: **can the orchestrator observe the effect-channel outcome before deciding to commit or discard?** If yes — the tool exposes a check phase, or the effect is deferred behind a commit token — speculative execution is safe and rollback is sound. If no — the tool applies effects on call and reports a result the orchestrator compares post-hoc — th...",
    "operational_effect": "When the invariant is violated, the observable symptom is a ledger that is *internally consistent but externally wrong*: every committed transition checks out against its recorded base, yet the sequence of bases does not match the actual sequence of effects. Auditors replaying the ledger reconstruct a history that never happened. The divergence detector, mea..."
  },
  "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": "8a250447b839158c5572f44a687e397d6030040a6669ae9a7037958c4e439d4d",
    "verified_classes": [
      "UnsafeSpeculationError",
      "EffectToken"
    ],
    "verified_functions": [
      "rollback_branch",
      "_emit_compensation",
      "_drop_branch_state",
      "fork_and_speculate",
      "__init__"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnsafeSpeculationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
