{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-abandon-speculative-branch-rollback-when-merged-side-effects-are-non-idempotent",
  "title": "Under what conditions must an instance abandon speculative branch rollback when merged side effects are non-idempotent",
  "date_of_record": "2026 November 26",
  "scope": "Applies to orchestrators that fan out parallel speculative agent branches sharing a mutable external environment (filesystem, database, API-backed resources) and reconcile via rollback-then-merge. Does not apply to branches executing against copy-on-write sandboxes or purely read-only tool surfaces, where rollback is trivially reversible.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abandon-speculative-branch-rollback-when-merged-side-effects-are-non-idempotent.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abandon-speculative-branch-rollback-when-merged-side-effects-are-non-idempotent.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-abandon-speculative-branch-rollback-when-merged-side-effects-are-non-idempotent.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1844,
    "python_slice_tokens": 267,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative parallel execution assumes a symmetry that does not generally hold: that *abandoning* a branch is equivalent to *never having run it*. The orchestrator forks N branches from a checkpoint, lets them race toward a goal, keeps the winner, and rolls back the losers. This is sound only when every tool call a branch makes is **idempotent with respect t...",
    "what_was_observed": "A research-agent orchestrator executed a three-way speculative fan-out for a task of the form \"update the customer record and notify the downstream billing service.\" Branches B1, B2, B3 each received the same checkpointed context and the same tool grant. The task required two tool calls: `write_record(patch)` against a shared key-value store, and `enqueue_billing_event(payload)` against a message broker. The trace: 1...",
    "condition_of_validity": "Speculative rollback remains safe if and only if all of the following hold at merge time: - **Effect identity is tracked, not just state version.** Each branch's side effects carry a durable idempotency key derived from `(branch_id, logical_operation, target)`. Rollback removes effects *by key*, not by restoring a snapshot, so it cannot touch another branch'...",
    "decision_boundary": "The decision procedure at merge time is: 1. Enumerate committed effects across all branches by idempotency key. 2. If every effect is keyed and invertible → proceed with normal rollback-then-merge. 3. If any effect is non-invertible **and** was committed by a losing branch → rollback is unsafe. Do not issue compensating calls; they compound the divergence. E...",
    "operational_effect": "The practical consequence is that speculative fan-out must be *partitioned by tool reversibility at grant time*, not reconciled after the fact. Branches should be issued a tool binding that splits the surface: reversible tools (private-overlay writes, CAS-guarded record updates with branch-scoped keys) run speculatively; non-invertible tools (message enqueue..."
  },
  "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": "1ab3abc04e5a0ed56f8cfe8ad6fd16f396052da96cd23d541bc7dc7f696fa436",
    "verified_classes": [
      "SpeculativeRollbackUnsafe"
    ],
    "verified_functions": [
      "reconcile_merge",
      "_keys_written_by_multiple_branches"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SpeculativeRollbackUnsafe"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
