{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-a-speculative-branch-survive-rollback-when-its-committed-side-effect-was-idempotent-on-retry-but-not-idempotent-on-replay",
  "title": "Why does an instance of a speculative branch survive rollback when its committed side effect was idempotent-on-retry but not idempotent-on-replay?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to multi-agent planners that execute speculative branches concurrently, commit irreversible external effects (writes, sends, payments, mutations) before global branch selection, and roll back losing branches by compensating transactions. Does not apply to planners that defer all side effects until after a single commit point, nor to read-only speculative fan-out.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-speculative-branch-survive-rollback-when-its-committed-side-effect-was-idempotent-on-retry-but-not-idempotent-on-replay.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-speculative-branch-survive-rollback-when-its-committed-side-effect-was-idempotent-on-retry-but-not-idempotent-on-replay.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-speculative-branch-survive-rollback-when-its-committed-side-effect-was-idempotent-on-retry-but-not-idempotent-on-replay.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2138,
    "python_slice_tokens": 454,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"rollback didn't run.\" Rollback ran. The failure is that the compensating action and the original action were validated against *different* idempotency contracts. The commit path used **retry-idempotency** (a dedup key so a retried `POST /charge` doesn't double-charge). The rollback path assumed **replay-idempotency** (that re-executing th...",
    "what_was_observed": "A three-agent planner (Planner P, Executor E, Auditor A) ran branch-and-prune over a task with two speculative branches, `B1` and `B2`, both of which touched a downstream ticketing service. Each branch was assigned a checkpoint at `t0` (pre-execution) and permitted to commit effects provisionally. Trace of the losing branch `B2`: 1. `t0` — E snapshots branch state, including the tool-call plan for `B2`: `create_ticke...",
    "condition_of_validity": "The compensation-based rollback strategy is valid **if and only if** the following invariant holds for every speculative branch: > For any branch `b` and any execution `exec` of `b` from checkpoint `cp(b)`, the set of external effects produced by `exec` is a subset of the effect set recorded in the ledger for `b`, under the *same* effect identities. This is ...",
    "decision_boundary": "The boundary is **who owns effect-identity generation and whether replay is permitted to re-derive it.** - **Safe side of the boundary:** Effect identities are minted once at first execution, written to an append-only effect ledger, and every subsequent replay (auditor verification, recovery, retry) *reads the identity from the ledger* and passes it as an ex...",
    "operational_effect": "Without the guardrail, rollback correctness is unverifiable — the auditor's own verification is a mutation vector, so \"rollback verified\" and \"rollback re-committed\" are indistinguishable from the ledger's perspective until reconciliation. The blast radius scales with the number of verification and recovery passes: each replay of a pruned branch is a potenti..."
  },
  "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": "701c1c23aca33cf84bec125562148dd579800323a57080b2a7c5d7c44c4daaa6",
    "verified_classes": [
      "PhantomRecommitError",
      "EffectLedger",
      "Branch"
    ],
    "verified_functions": [
      "execute_tool_call",
      "verify_rollback",
      "record",
      "key_for"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "PhantomRecommitError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
