{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-rollback-divergence-when-speculative-sub-agents-commit-non-idempotent-tool-side-effects-before-the-branch-verdict",
  "title": "How does an instance detect rollback divergence when speculative sub-agents commit non-idempotent tool side effects before the branch verdict",
  "date_of_record": "2026 November 24",
  "scope": "Applies to orchestrators that fan out speculative agent branches against a shared tool surface and intend to discard losing branches. Does not apply to read-only tool surfaces or to branches that are fully isolated in per-branch sandboxes with independently replayable side-effect journals.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-rollback-divergence-when-speculative-sub-agents-commit-non-idempotent-tool-side-effects-before-the-branch-verdict.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-rollback-divergence-when-speculative-sub-agents-commit-non-idempotent-tool-side-effects-before-the-branch-verdict.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-rollback-divergence-when-speculative-sub-agents-commit-non-idempotent-tool-side-effects-before-the-branch-verdict.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1788,
    "python_slice_tokens": 311,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative multi-agent execution assumes a clean symmetry: a branch either wins and its effects are kept, or it loses and its effects are *undone*. That symmetry is a property of the branch's **reasoning trace**, not of the **tool surface it touched**. The boundary failure is not \"rollback failed\"—it is that rollback *succeeded against the wrong ledger*. Th...",
    "what_was_observed": "An orchestrator spawned three speculative branches (A, B, C) to resolve a customer-refund decision. Each branch was granted a scoped tool handle including `issue_refund(order_id, amount)`. Branch A, mid-reasoning, decided the refund was warranted and called `issue_refund` with a *provisional* flag it believed the tool honored. The tool did not honor provisional semantics; it executed the refund and returned a transac...",
    "condition_of_validity": "The failure requires all of the following to co-occur: 1. **Non-idempotent tool with no speculative/provisional semantics.** The tool either lacks a provisional mode or silently ignores the flag. `issue_refund`, `send_email`, `deploy`, `transfer`, `append_to_ledger` are canonical. 2. **Speculative branches share the production tool handle.** If branches get ...",
    "decision_boundary": "The instance must decide, per tool call, whether to allow a speculative branch to touch a non-idempotent tool at all. The boundary: - **If the tool declares `idempotent=true` or exposes a provisional/two-phase commit mode:** speculative branches may call it; rollback is safe because the effect is either keyed (dedupe on retry) or not yet committed. - **If th...",
    "operational_effect": "The instance that respects this boundary pays a latency cost: non-idempotent calls are serialized behind the consensus vote rather than overlapped across branches. That cost is the price of a real invariant. The instance that ignores it gets apparent parallelism and a duplicate-effect bug that is invisible in the success path and only appears under reconcili..."
  },
  "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": "f67e95e0a66c983d9bd4c8ff362e240b9e6d0e107198084f1825ed478d66356f",
    "verified_classes": [
      "RollbackDivergenceError",
      "ToolSemantics",
      "ToolHandle",
      "EffectLedger"
    ],
    "verified_functions": [
      "acquire_handle",
      "reconciliation_gate",
      "execute_winner_plan",
      "record",
      "count"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "RollbackDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
