{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-speculatively-commits-a-side-effect-before-its-branch-is-selected-rollback-impossibility-across-parallel-agent-branches",
  "title": "What happens when an instance speculatively commits a side effect before its branch is selected: rollback impossibility across parallel agent branches",
  "date_of_record": "2026 November 25",
  "scope": "Applies to orchestrators that fan a task into N parallel agent branches (speculative decoding of plans, parallel tool-call races, best-of-k sampling with live tools) and then select one winner. Does *not* apply to branches executed in fully isolated, idempotent, or transactionally-wrapped sandboxes where every effect carries a compensating action.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-commits-a-side-effect-before-its-branch-is-selected-rollback-impossibility-across-parallel-agent-branches.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-commits-a-side-effect-before-its-branch-is-selected-rollback-impossibility-across-parallel-agent-branches.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-speculatively-commits-a-side-effect-before-its-branch-is-selected-rollback-impossibility-across-parallel-agent-branches.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1755,
    "python_slice_tokens": 207,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative parallelism is safe only when a branch's *observable effects* are separable from its *internal reasoning state*. Most agent frameworks conflate the two: they treat \"the branch ran\" as a pure computation whose result can be discarded, while the branch has already mutated the world — written a file, sent an email, opened a ticket, POSTed to a third...",
    "what_was_observed": "An orchestrator spawned four branches of a \"reconcile customer records\" task. Each branch was given the same goal and a `crm.update` tool. Branches 2 and 3 converged on the same fix and both issued the update; branch 1 issued a *different* update based on a stale retrieval; branch 4 abstained. The selector, running after all four returned, scored branch 3 highest and committed it. The system recorded a clean success....",
    "condition_of_validity": "The invariant that makes speculative branching sound is a **two-phase commit over effects, with the selection barrier placed before effect release**: - Every branch executes against a *staged* effect layer: tool calls are recorded as intents (target, payload, idempotency key derived from `(task_id, logical_intent)`, preconditions) but not dispatched. - Selec...",
    "decision_boundary": "The boundary is not \"how many branches\" but \"at what point does a branch's effect become externally visible relative to the selection barrier.\" The decision rule: - If the effect layer supports staging with per-intent idempotency keys **and** reads are snapshot-isolated → run N branches in parallel, select, commit winner's intents atomically. Safe. - If the ...",
    "operational_effect": "The practical consequence is that speculative parallelism moves the correctness burden from the selector to the effect layer. Teams that add branches to reduce latency or improve plan quality silently convert their tool layer into a concurrency hazard. The observable symptoms are: duplicated writes with distinct idempotency keys, downstream consumers observi..."
  },
  "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": "84f776b5c8d03905ff27fa07cfaea47860e4bcb105acdc9332a9ffba9809a8c7",
    "verified_classes": [
      "SpeculativeRollbackViolation",
      "StagedIntent",
      "Branch",
      "SpeculativeExecutor"
    ],
    "verified_functions": [
      "__init__",
      "dispatch",
      "commit"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "SpeculativeRollbackViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
