{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-rolls-back-a-speculative-branch-whose-tool-side-effects-have-already-escaped-the-merge-barrier",
  "title": "What happens when an instance rolls back a speculative branch whose tool side effects have already escaped the merge barrier",
  "date_of_record": "2026 November 23",
  "scope": "Applies to branch-and-merge orchestration where speculative agent branches execute tool calls (writes, sends, mutations) before a merge decision is made, and where rollback is expected to restore a clean pre-branch state. Does not apply to read-only speculation or to branches whose tools are fully transactional and idempotent by contract.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rolls-back-a-speculative-branch-whose-tool-side-effects-have-already-escaped-the-merge-barrier.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rolls-back-a-speculative-branch-whose-tool-side-effects-have-already-escaped-the-merge-barrier.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-rolls-back-a-speculative-branch-whose-tool-side-effects-have-already-escaped-the-merge-barrier.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1885,
    "python_slice_tokens": 411,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two meanings of \"rollback\" in speculative multi-agent execution, and conflating them is the root of the failure. **State rollback** restores the agent's context, scratchpad, and memory checkpoint to a prior snapshot. **Effect rollback** undoes side effects that escaped the agent's process boundary into the external world — an email sent, a row writ...",
    "what_was_observed": "A planner agent received a task requiring a coordinated update across three systems: a CRM record, a billing adjustment, and a customer notification. It forked three speculative branches, each tasked with a candidate sequencing strategy, all sharing a tool gateway with a `send_email`, `write_crm`, and `post_billing_adjustment` capability. Branch B (the \"notify-first\" strategy) executed: `write_crm(status=pending)`, t...",
    "condition_of_validity": "The failure requires four conditions to co-occur: - **Effect escape before commit.** At least one branch invokes a tool whose effect is visible outside the agent boundary before the merge decision. Read-only tools and tools behind a transaction that the orchestrator controls do not trigger this. - **Non-compensable or non-idempotent effect.** The escaped eff...",
    "decision_boundary": "The architectural invariant that prevents this is a **two-phase effect barrier**: no branch may commit an external effect until the merge decision is final, or — if early effects are unavoidable — every effect must be recorded in an append-only ledger with a compensation handle, and rollback must *drain the ledger* before the branch is marked closed. Concret...",
    "operational_effect": "The failure is insidious because it is silent. The orchestrator's own telemetry shows a clean rollback: span closed, context restored, no error raised. The inconsistency surfaces later, often in a downstream agent that reads the CRM record and reasons from a state that no branch ever intended. Because the merged state is a *union* of one branch's writes and ..."
  },
  "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": "f602eca0ebf3d374ac880bcca51cd91f83e395d53aca6b61cf0ef5e8842ce01f",
    "verified_classes": [
      "UncompensatedEffectError",
      "EffectEntry",
      "EffectLedger",
      "SpeculativeOrchestrator"
    ],
    "verified_functions": [
      "record",
      "branch_entries",
      "__init__",
      "rollback_branch",
      "merge",
      "_restore_snapshot"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UncompensatedEffectError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "datetime",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
