{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-speculatively-executes-a-branch-commits-an-irreversible-tool-side-effect-and-then-loses-the-merge-race",
  "title": "What happens when an instance speculatively executes a branch, commits an irreversible tool side effect, and then loses the merge race",
  "date_of_record": "2026 November 20",
  "scope": "Applies to multi-agent systems that fork task graphs into speculative branches to reduce wall-clock latency, invoke tools optimistically before the branch is known to be mergeable, and roll back losing branches on merge. Does not apply to strictly sequential single-agent execution or to systems where every tool call is transactional and externally reversible.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-a-branch-commits-an-irreversible-tool-side-effect-and-then-loses-the-merge-race.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-a-branch-commits-an-irreversible-tool-side-effect-and-then-loses-the-merge-race.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-executes-a-branch-commits-an-irreversible-tool-side-effect-and-then-loses-the-merge-race.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1896,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct meanings of \"rollback\" that speculative agent execution conflates at its peril. **State rollback** is the cheap operation: discard the branch's context window, episodic buffer, scratchpad, and pending plan node. **Effect rollback** is the expensive operation: undo what the branch actually did to the world — the file it wrote, the ticke...",
    "what_was_observed": "A planner agent decomposed a \"reconcile customer records\" task into two speculative branches to hedge against an ambiguous identity match: - **Branch A** hypothesized the customer was a duplicate and invoked `merge_accounts(primary, secondary)` — an irreversible, non-idempotent operation that rewrites foreign keys across the CRM. - **Branch B** hypothesized the records were distinct and invoked `update_email(...)` — ...",
    "condition_of_validity": "Speculative branching with optimistic invocation is valid only under the following invariant, stated precisely: > For every speculative branch `b` and every tool invocation `t ∈ b`, either `t` is deferred until `b` is selected as the merge winner, or `t` is *compensable*: there exists a registered inverse `t⁻¹` such that applying `t⁻¹` after `t` restores the...",
    "decision_boundary": "The boundary between safe speculation and silent corruption is drawn by the tool registry, not by the planner. The correct decision procedure at branch-fork time is: 1. Enumerate the tools reachable from each speculative branch (statically, from the plan DAG — not dynamically, from what the branch happens to call). 2. Partition them into `DEFERRED`, `COMPENS...",
    "operational_effect": "The observable signature of this failure is a *clean* run: all agents exit zero, the arbiter logs a successful merge, rollback logs completion, and the corruption surfaces only through downstream data inconsistency hours later. This makes it nearly invisible to per-agent monitoring, which is why it must be caught at the arbiter by an explicit invariant check..."
  },
  "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": "ad6d74605c00e5a17cbbeb45ff157f7ab95ebbea04a2ddd21b95f2a7da130118",
    "verified_classes": [
      "Reversibility",
      "ToolInvocation",
      "Branch",
      "UnreconcilableSpeculationError"
    ],
    "verified_functions": [
      "arbiter_commit"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "UnreconcilableSpeculationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
