{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-refuse-to-roll-back-a-speculative-branch-committed-side-effect-divergence-in-cost-aware-speculative-multi-agent-execution",
  "title": "When must an instance refuse to roll back a speculative branch: committed-side-effect divergence in cost-aware speculative multi-agent execution",
  "date_of_record": "2026 November 25",
  "scope": "Applies to orchestrators that fork speculative agent branches in parallel, commit the winner, and discard losers, where branches may invoke irreversible external tools (payments, file writes, message sends, DB mutations). Does not apply to pure-read speculation or to sandboxed branches with fully reversible effect logs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-roll-back-a-speculative-branch-committed-side-effect-divergence-in-cost-aware-speculative-multi-agent-execution.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-roll-back-a-speculative-branch-committed-side-effect-divergence-in-cost-aware-speculative-multi-agent-execution.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-refuse-to-roll-back-a-speculative-branch-committed-side-effect-divergence-in-cost-aware-speculative-multi-agent-execution.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2029,
    "python_slice_tokens": 530,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative execution at the agent layer is routinely described as \"fork, race, pick the winner, roll back the losers.\" That framing silently assumes rollback is a *state* operation: restore the checkpoint, discard the branch's context, done. But the failure that matters is not state rollback—it is **effect rollback**. A losing branch's *reasoning* is free t...",
    "what_was_observed": "An orchestrator forked three branches (A, B, C) at a planning node to resolve a tool-selection ambiguity (which CRM endpoint to call to update a customer record). Depth was set to `max_steps=12` per branch, `fork_width=3`, with a token budget of 40k per branch and a global prune at 60% budget consumption. Branch A reasoned conservatively, spent 9k tokens, and at step 4 issued `POST /customers/{id}/merge`—an idempoten...",
    "condition_of_validity": "The rollback-loser invariant holds **only if** every effect performed by a branch is either (a) idempotent and keyed by a speculation-scoped idempotency token, or (b) deferred behind a two-phase commit gate that the orchestrator controls. Formally: a branch may execute freely up to depth *d* only while all effects in `[0, d]` are members of the *reversible s...",
    "decision_boundary": "The orchestrator must choose, at fork time, between two regimes: 1. **Shallow speculation with gated effects.** Fork wide, run shallow (`max_steps < k`), and route every `e ∉ R` through a propose/commit gate where only the selected branch's proposals are committed. Cost: latency (the gate serializes the winner's effects). Benefit: rollback is always sound. 2...",
    "operational_effect": "Once a branch crosses the commit horizon, the orchestrator's winner selection must be re-run over the *committed subset*, and the losing committed branches must be compensated in reverse commit order (LIFO) to preserve referential integrity—if branch C merged a record and branch B updated it, you must un-update B before un-merging C, or the compensation itse..."
  },
  "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": "c6824b283c133fc5272d7e65d096e8cecd49087ea791ca9428d509cce81eaf7d",
    "verified_classes": [
      "IrreversibleEffectError",
      "RollbackDivergenceError",
      "EffectKind",
      "Effect",
      "Branch",
      "SpeculativeOrchestrator"
    ],
    "verified_functions": [
      "__init__",
      "register_branch",
      "record_step",
      "_apply_irreversible",
      "_discard",
      "select_winner",
      "finalize"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "IrreversibleEffectError",
      "RollbackDivergenceError"
    ],
    "sample_fail_closed_invariants": [
      "irreversible effect occurred at step 0; speculation depth is unsound"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
