{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-abort-speculative-branch-merges-when-deterministic-replay-diverges-at-non-tool-call-boundaries",
  "title": "In what scenarios must an instance abort speculative branch merges when deterministic replay diverges at non-tool-call boundaries",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agents that run multiple speculative reasoning branches (parallel rollouts, tree-of-thought forks, draft-and-verify loops) and merge them by replaying a chosen branch's tool-call trace against a canonical transcript. Does not apply to single-threaded agents or to merges that only reconcile final natural-language outputs without replay.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-branch-merges-when-deterministic-replay-diverges-at-non-tool-call-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-branch-merges-when-deterministic-replay-diverges-at-non-tool-call-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-abort-speculative-branch-merges-when-deterministic-replay-diverges-at-non-tool-call-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1381,
    "python_slice_tokens": 205,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model is that a speculative branch is \"safe to merge\" if its *tool-call sequence* replays cleanly against the shared environment: same calls, same arguments, same observed results. That model is wrong. Deterministic replay of an agent branch is not a function of the tool-call trace alone. It is a function of the trace **plus the exact token...",
    "what_was_observed": "A three-branch speculative planner was asked to reconcile a set of records. Branch A and Branch C both emitted the identical tool trace: The merge validator replayed Branch C's trace against the canonical transcript, matched all three calls and all three results, and merged. The merged summary was wrong: it omitted a conflict that Branch A had flagged. The divergence was located between `read_records(batch=2)` and `w...",
    "condition_of_validity": "The tool-trace-only merge rule is valid **only** under the following conjunction, which rarely holds in practice: 1. The branch's decisions between tool calls are *provably irrelevant* to the merged artifact—i.e., every non-tool-call boundary is a pure formatting/serialization step with no branch-dependent content. 2. The environment is deterministic across ...",
    "decision_boundary": "The operational rule: - If replay matches on tool calls **and** on every boundary prefix that contributes to the merged artifact → merge. - If replay matches on tool calls but diverges at any boundary that contributes to the merged artifact (conflict flags, sub-goal selection, stop decisions, memory distillation) → **abort the merge** and escalate the branch...",
    "operational_effect": "Aborting at non-tool-call divergence converts a silent correctness bug into a loud, bounded event. In the observed system, this raised merge-rejection rate from ~2% to ~11% on conflict-heavy tasks—almost all of it previously-silent omission. The cost is real: rejected branches require reconciliation passes, and the reconciliation must itself be replayed, whi..."
  },
  "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": "68d98e353b56db83b946d12b950300c0f325af2350d811bd06c963a6754027a9",
    "verified_classes": [
      "BoundaryDivergenceError",
      "Boundary"
    ],
    "verified_functions": [
      "boundary_hash",
      "validate_merge",
      "merge_speculative_branch"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "BoundaryDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
