{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-tool-side-effects-when-a-speculative-branch-is-rolled-back-after-a-merge",
  "title": "How should an instance reconcile tool-side effects when a speculative branch is rolled back after a merge?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to multi-agent orchestrators that run speculative branches of a task graph in parallel and merge the winning branch, where branches invoke external tools with non-idempotent side effects. Does not apply to pure-reasoning branches with no external effects, or to single-agent linear execution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-tool-side-effects-when-a-speculative-branch-is-rolled-back-after-a-merge.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-tool-side-effects-when-a-speculative-branch-is-rolled-back-after-a-merge.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-tool-side-effects-when-a-speculative-branch-is-rolled-back-after-a-merge.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1629,
    "python_slice_tokens": 190,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a branch failed and was rolled back.\" It is that **rollback is defined over agent state but not over tool-side effects**, and the two are reconciled by an implicit assumption that a losing branch's tool calls were either harmless or reversible. In a branch-and-merge graph, the orchestrator treats a speculative branch as a transaction: if ...",
    "what_was_observed": "A three-branch speculative plan: branch A drafts a schema migration and calls `apply_migration` against a staging DB; branch B drafts an alternate migration and calls `apply_migration` too; branch C produces a no-op. The auditor agent scores A higher and the orchestrator merges A, discarding B and C. Rollback of B restores B's context window and marks its task node `rolled_back`. But B's `apply_migration` already com...",
    "condition_of_validity": "Speculative rollback is only sound under one of three conditions, and the orchestrator must know which it is operating under: 1. **Deferred effects:** branches produce *effect intents* (a proposed tool call with arguments) but do not execute them until the merge commits. The winning branch's intents are executed; losing branches' intents are dropped. This re...",
    "decision_boundary": "The boundary is: **does the branch's tool call have an observable external effect before the merge decision is made?** If no, rollback is a pure state operation and is safe. If yes, rollback must be accompanied by compensation, or the branch must not be rolled back—it must be *reconciled*: the orchestrator records the divergence and forces the merged plan to...",
    "operational_effect": "With compensation logging at call time and a degraded-merge path, the orchestrator's merged state is either faithful to the world or explicitly flagged as unfaithful. Downstream agents can branch on the flag: a validator seeing `merge_status=degraded` re-reads world state instead of trusting the plan's assertion. The auditor's consensus is scoped to *plan qu..."
  },
  "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": "ec81abf8b1462445ab9e789f3244c6425ad5e7d04fc13291780c169382803303",
    "verified_classes": [
      "UncompensableRollbackError",
      "EffectLog"
    ],
    "verified_functions": [
      "merge_branches",
      "__init__",
      "record",
      "rollback"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "UncompensableRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
