{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-forks-a-speculative-branch-and-the-replay-log-diverges-at-a-tool-call-boundary",
  "title": "What happens when an instance forks a speculative branch and the replay log diverges at a tool-call boundary",
  "date_of_record": "2026 November 21",
  "scope": "Applies to multi-agent orchestration runtimes that implement deterministic replay via recorded effect logs and allow speculative branch forking (parallel \"what-if\" execution that is later committed or rolled back). Does not apply to single-instance stateless inference, nor to runtimes that snapshot full process state (CRIU-style) rather than replaying from an effect log.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forks-a-speculative-branch-and-the-replay-log-diverges-at-a-tool-call-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forks-a-speculative-branch-and-the-replay-log-diverges-at-a-tool-call-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-forks-a-speculative-branch-and-the-replay-log-diverges-at-a-tool-call-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1822,
    "python_slice_tokens": 297,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not nondeterminism in the model. Sampling temperature, logit drift, and even provider-side model version changes are *expected* and are precisely what the replay log exists to mask. The failure is a **divergence between the recorded effect and the re-executed effect at a tool-call boundary**, caused by a speculative branch that mutated externa...",
    "what_was_observed": "A supervisor agent `S` runs a planning loop. At step 7 it decides to fork two speculative branches, `B1` and `B2`, to compare two remediation strategies before committing. The runtime implements forking by cloning `S`'s context and effect-log prefix and running both branches concurrently against the same tool endpoint set. Each branch is tagged with a `branch_id`; tool calls are logged with `(branch_id, step, tool, a...",
    "condition_of_validity": "The rollback-by-log-separation invariant holds **only if** every speculative branch executes against a snapshot-isolated view of external state, and every effect that escapes the snapshot is either (a) buffered until commit, or (b) recorded with a dependency edge on the sibling reads that produced it. Formally, a branch's log segment is replayable iff for ev...",
    "decision_boundary": "The runtime must choose, per tool call, between two regimes: - **Buffered-effect regime** — the call is deferred until commit; safe for any tool whose result is not needed mid-branch. Requires the branch to tolerate stale reads (it will not see sibling writes, by construction). - **Immediate-effect regime** — the call executes now; safe only for tools that a...",
    "operational_effect": "Without the intersection check, speculative forking is not a safe operation on any shared mutable substrate. The failure modes it produces are: 1. **Phantom side effects** — irreversible actions (pages, payments, deletions) fire from branches that are later rolled back, with no log trace because the branch's segment was discarded. 2. **Replay divergence misa..."
  },
  "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": "9eb2be815411369d456556655842d1ddde6585611b0b0b709a4c85c59ab9c9de",
    "verified_classes": [
      "SpeculativeIsolationViolation",
      "Branch",
      "ForkTopology"
    ],
    "verified_functions": [
      "execute_branch_read",
      "execute_branch_effect",
      "live_siblings",
      "guard_read",
      "guard_irreversible_effect"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SpeculativeIsolationViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
