{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-roll-back-a-speculative-branch-and-still-commit-the-side-effect-it-was-hedging-against",
  "title": "Why does an instance roll back a speculative branch and still commit the side effect it was hedging against",
  "date_of_record": "2026 November 23",
  "scope": "Applies to orchestrators that fork multiple agent instances speculatively (branch-and-merge planning) and roll back losing branches by discarding their state on commitment failure. Does not apply to strictly sequential single-agent retry loops, nor to read-only speculative fan-out where no branch mutates external state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-and-still-commit-the-side-effect-it-was-hedging-against.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-and-still-commit-the-side-effect-it-was-hedging-against.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-roll-back-a-speculative-branch-and-still-commit-the-side-effect-it-was-hedging-against.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2174,
    "python_slice_tokens": 357,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **logical rollback** and **effect rollback**. A speculative branch-and-merge executor treats a branch as a unit of state: when a branch's commitment fails and the merge is aborted, the orchestrator discards the branch's context, its scratchpad, its message history, and its reserved identifiers. This is logical rollback...",
    "what_was_observed": "A planner forked three speculative branches to satisfy a single user intent: `branch-A` (primary, high-confidence), `branch-B` (fallback, lower-confidence), `branch-C` (hedge against a specific ambiguity in the request). Each branch was given a shared tool grant and a distinct `speculation_id`. The merge policy: commit the first branch whose commitment check passes; roll back the rest. The trace: 1. `branch-C` runs f...",
    "condition_of_validity": "The rollback-on-failed-commitment pattern is only sound when **all** of the following hold. If any fails, the pattern produces orphaned effects: - **Effect idempotency is scoped to the branch, not the resource.** The external tool must key idempotency on `speculation_id` (or an equivalent branch-unique token), so that a surviving branch's call is a *distinct...",
    "decision_boundary": "The boundary is the point at which a branch's tool call becomes **externally durable** — the moment the external system commits the write and returns an identifier. Before that point, rollback is total: the branch's state is discardable and no effect exists. After that point, rollback is *partial*: the branch's state is discardable but the effect is not, and...",
    "operational_effect": "The consequence of violating the invariant is a **split ledger**: the creation and the compensation of a single real-world effect are recorded under two different branch identities, one of which the orchestrator believes never existed. This is not a crash and not a data-loss event; it is a *reconciliation impossibility*. Downstream auditors, cost attribution..."
  },
  "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": "0808aebe55690d37532d53ab36170ee652cf6e12e4fd96b3066f7409f2f642fb",
    "verified_classes": [
      "OrphanedEffectRollbackError",
      "EffectRegistry"
    ],
    "verified_functions": [
      "retire_branch",
      "__init__",
      "register",
      "live_effects",
      "compensate",
      "reattribute"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "OrphanedEffectRollbackError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
