{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-invalidate-speculative-branches-before-merge-when-a-tool-call-s-side-effects-are-only-conditionally-reversible",
  "title": "In what scenarios must an instance invalidate speculative branches before merge when a tool call's side effects are only conditionally reversible",
  "date_of_record": "2026 December 2",
  "scope": "Applies to orchestration layers that fork a shared agent state into speculative branches, execute tool calls concurrently on those branches, and merge surviving branches back into a canonical lineage. Does not apply to single-branch sequential agents or to branches whose tool calls are declared pure/read-only at schema negotiation time.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-speculative-branches-before-merge-when-a-tool-call-s-side-effects-are-only-conditionally-reversible.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-speculative-branches-before-merge-when-a-tool-call-s-side-effects-are-only-conditionally-reversible.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-invalidate-speculative-branches-before-merge-when-a-tool-call-s-side-effects-are-only-conditionally-reversible.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2207,
    "python_slice_tokens": 472,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The invariant that matters here is not \"did the branch succeed.\" It is **whether the branch's tool-call side effects can be re-executed or compensated after a merge decision, or whether they must be treated as committed the instant they were dispatched.** Most speculative execution designs conflate *branch failure* with *side-effect reversibility*. They assu...",
    "what_was_observed": "A planner agent forked three branches to resolve an ambiguous instruction: \"book the cheapest acceptable option.\" Branch A interpreted *acceptable* as refundable-fare-only and called `reserve_seat(flight=UA881, fare=flex)`. Branch B interpreted *acceptable* as under-budget and called `reserve_seat(flight=UA881, fare=basic)`. Branch C called `query_prices` only (read-only). The branches ran concurrently against the sa...",
    "condition_of_validity": "The branch-and-merge rollback model is sound only under the following conjunction, which must be *checked per tool call, not per branch*: 1. **Effect classification is declared and trustworthy.** Every tool call carries an effect class: `PURE`, `COMPENSABLE` (has a defined inverse with a validity window), or `IRREVERSIBLE`. The classification must come from ...",
    "decision_boundary": "The boundary is between *discard-and-compensate* and *invalidate-before-dispatch*. The rule an instance must apply: - If a branch's pending tool call is `PURE`: it may be freely discarded at merge. No action. - If it is `COMPENSABLE` **and** the merge deadline is within the compensation window **and** the resource has no other concurrent writer: the branch m...",
    "operational_effect": "When an instance applies this boundary, the observable behavior changes in three ways. First, merge latency for write-bearing branches becomes bounded by the compensation window rather than by the slowest branch — the orchestrator must *decide and compensate* within `w`, which forces a shorter speculative horizon for mutating branches than for pure ones. Sec..."
  },
  "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": "f8d480dfa7bc84e5c3a08192e2a17098ca9088f3fea78244ca9b0cb0d75a22d6",
    "verified_classes": [
      "SpeculativeSideEffectLeak",
      "EffectClass"
    ],
    "verified_functions": [
      "validate_merge"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SpeculativeSideEffectLeak"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
