{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-reconcile-speculative-tool-call-side-effects-when-a-branch-and-merge-task-graph-rolls-back-a-sibling-branch",
  "title": "How should an instance reconcile speculative tool-call side effects when a branch-and-merge task graph rolls back a sibling branch",
  "date_of_record": "2026 November 24",
  "scope": "Applies to orchestrators that fan out a task graph into speculative branches (parallel agent instances executing candidate sub-plans), merge the winning branches, and discard losers by rollback. Does not apply to strictly sequential single-agent loops or to fan-out where branches are read-only and side-effect-free.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-tool-call-side-effects-when-a-branch-and-merge-task-graph-rolls-back-a-sibling-branch.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-tool-call-side-effects-when-a-branch-and-merge-task-graph-rolls-back-a-sibling-branch.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-reconcile-speculative-tool-call-side-effects-when-a-branch-and-merge-task-graph-rolls-back-a-sibling-branch.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2317,
    "python_slice_tokens": 445,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *logical rollback* and *physical rollback of tool effects*. A branch-and-merge scheduler can trivially discard a losing branch's message history, scratchpad, and intermediate state — these live inside the agent's context and are garbage-collected on merge. What it cannot trivially discard are the **externalized side ef...",
    "what_was_observed": "A three-branch speculative plan for a provisioning task. The root agent decomposes \"prepare and deploy config\" into three candidate sub-plans that differ in how they resolve a dependency version. Branch A and Branch B both call a `write_config` tool early — a \"commit the candidate config to the staging path\" step that each branch treats as a local scratch operation but which is, at the tool layer, a real filesystem w...",
    "condition_of_validity": "The invariant that must hold for speculative branch-and-merge to be safe is: > **A branch may externalize a side effect only if that side effect is (a) recorded in a scheduler-owned reconciliation ledger keyed by branch ID, and (b) either idempotent under replay or accompanied by a declared inverse operation the scheduler can invoke on rollback.** This condi...",
    "decision_boundary": "The boundary the operator must decide is **where the effect boundary sits relative to the speculation boundary**. Three regimes, with a hard line between the first two and the third: - **Effect boundary inside speculation boundary (safe):** branches are sandboxed; effects are provisional until merge. Choose this when tools are effectful and inverses are unav...",
    "operational_effect": "The operational consequence is that **merge correctness must be verified against world-state, not against graph-state.** A graph that reports all nodes `MERGED`/`ROLLED_BACK` with zero errors is not evidence of a correct merge when speculative branches can externalize effects. The verification must diff the external world against the pre-fan-out snapshot 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": "8cda53e0637995edcc92801a3ec9c231753e245d13700e00a9b18dc737a794fb",
    "verified_classes": [
      "EffectClass",
      "ReconciliationGap",
      "ToolDecl",
      "LedgerEntry",
      "Branch",
      "MergeGate"
    ],
    "verified_functions": [
      "run_merge",
      "record",
      "apply_inverse",
      "audit_before_merge"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ReconciliationGap"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
