{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-rollback-diverge-when-speculative-branches-share-an-idempotency-namespace",
  "title": "Why does an instance rollback diverge when speculative branches share an idempotency namespace",
  "date_of_record": "2026 November 24",
  "scope": "Applies to orchestration layers that run speculative multi-agent branches (parallel plan exploration) and reconcile them by rolling back the losing branches' tool side effects and replaying the winning plan deterministically. Does not apply to single-branch agents, to branches that touch only pure/read-only tools, or to systems where each branch owns an isolated side-effect namespace.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-rollback-diverge-when-speculative-branches-share-an-idempotency-namespace.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-rollback-diverge-when-speculative-branches-share-an-idempotency-namespace.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-rollback-diverge-when-speculative-branches-share-an-idempotency-namespace.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1641,
    "python_slice_tokens": 263,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"rollback is hard\" or \"replay is non-deterministic.\" It is narrower: **rollback correctness and replay determinism are two separate invariants that share a hidden dependency — the idempotency key namespace — and speculative branching silently violates that dependency by making two branches mint the same key for semantically different effec...",
    "what_was_observed": "Trace from a payment-orchestration agent (fork width 3, tools: `charge_card`, `reserve_inventory`, `send_receipt`): 1. **Fork.** Parent plan `P` forks into `P_a` (standard shipping), `P_b` (express + partial charge), `P_c` (gift wrap). All three derive idempotency keys from `(tool, order_id, amount)`. 2. **Collision.** `P_a` and `P_b` both issue `charge_card(4471, 90)`. Key `idem:charge:4471:90` is identical. The too...",
    "condition_of_validity": "The invariant that makes speculative rollback safe is: > For every effect `e` recorded in the rollback journal, the set of branches that reference `e` must be exactly `{owner(e)}` at the moment any branch is rolled back. Speculative execution breaks this in two ways. First, **key derivation from logical arguments instead of branch identity** — if `idem_key =...",
    "decision_boundary": "The orchestrator must decide, at rollback time, whether an effect is *exclusively owned*. The boundary condition is: - **Exclusive** (`refcount(e) == 1` and `owner(e)` is the branch being rolled back): roll back normally. - **Shared** (`refcount(e) > 1`): do **not** roll back. Instead, mark `e` as *contested*, demote the winning branch's dependency on `e` to...",
    "operational_effect": "Without the guardrail, speculative branching produces **deterministic, replay-certified corruption**: the system's own audit trail confirms a state that no single plan would have produced. The failure is invisible to per-branch success metrics (every branch reports success), invisible to replay determinism checks (replay matches), and visible only in cross-b..."
  },
  "matched_failure_symptoms": [
    "DUPLICATE_MUTATION_OR_BILLING"
  ],
  "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": "70e80466941c775b0d7e700ac97709de84398a05a96acc76861afd6286d758e5",
    "verified_classes": [
      "SpeculativeRollbackCollision",
      "Effect",
      "RollbackJournal"
    ],
    "verified_functions": [
      "arbitrate_and_rollback",
      "__init__",
      "record",
      "rollback"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SpeculativeRollbackCollision"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
