{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-speculative-branch-fan-out-as-non-idempotent-across-rollback-boundaries",
  "title": "Under what conditions must an instance treat speculative branch fan-out as non-idempotent across rollback boundaries",
  "date_of_record": "2026 November 7",
  "scope": "Applies to orchestrators that spawn multiple speculative agent branches, execute them concurrently against shared external side-effects (tool calls, API mutations, message emission), and later select one branch while rolling back the rest. Does not apply to pure-compute branches with no externalized effects, nor to fan-out where every branch is committed unconditionally.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-speculative-branch-fan-out-as-non-idempotent-across-rollback-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-speculative-branch-fan-out-as-non-idempotent-across-rollback-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-speculative-branch-fan-out-as-non-idempotent-across-rollback-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1251,
    "python_slice_tokens": 167,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *rollback of local state* and *rollback of externalized effect*. A branch-and-rollback orchestrator can always discard a speculative branch's in-memory context, its KV cache, and its scratchpad — these are trivially reversible. What it cannot do is un-send an email, un-charge a card, or un-post a webhook that a specula...",
    "what_was_observed": "In a fan-out of N=5 speculative branches sharing a single tool-execution gateway, the orchestrator assigned each branch a cost ceiling of 40k tokens and a 90-second deadline. Branches 2 and 4 both invoked the same `issue_refund` tool within the same selection window. The selector committed branch 2 and rolled back branch 4. Rollback succeeded at the context layer — branch 4's transcript was discarded and its cache fr...",
    "condition_of_validity": "The invariant \"rollback of a speculative branch restores the pre-fan-out world\" holds **if and only if** every effect a branch can emit is either (a) staged and committed atomically at selection, or (b) tagged with a branch-unique idempotency key that the effect sink deduplicates on commit-or-rollback. If neither holds, the invariant is false and the orchest...",
    "decision_boundary": "Before allowing a branch to cross an effect boundary, the orchestrator must answer: *can this effect be deduplicated or staged?* If yes, fan-out is safe and speculative execution proceeds under the normal cost ceiling. If no, the orchestrator must either serialize the effect behind the selector (only the committed branch may emit) or acquire a branch-scoped ...",
    "operational_effect": "When the gate is enforced, fan-out latency rises only on the mutating subset of tools, and the selector's commit path carries the effect latency. When the gate is skipped, the system exhibits *silent effect leakage*: rollback appears to succeed, branch transcripts are clean, cost dashboards are green, and the divergence is only visible in the external system..."
  },
  "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": "9222bde22c3184cb5e9af97bc98c0eccd620037f9e93e9f88c806c25f449cadc",
    "verified_classes": [
      "UnkeyedSpeculativeEffect",
      "EffectSink"
    ],
    "verified_functions": [
      "run_speculative_branch",
      "__init__",
      "emit"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "UnkeyedSpeculativeEffect"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
