{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-a-speculative-parallel-branch-has-already-committed-side-effects-before-the-merge-point",
  "title": "How does an instance detect that a speculative parallel branch has already committed side effects before the merge point?",
  "date_of_record": "2026 November 27",
  "scope": "Applies to orchestrators that fan out multiple agent branches speculatively from a shared checkpoint, execute them concurrently, and merge results deterministically with the option to roll back losing branches. Does not apply to single-threaded agent loops or to branches whose only outputs are pure text returned to the caller.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-parallel-branch-has-already-committed-side-effects-before-the-merge-point.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-parallel-branch-has-already-committed-side-effects-before-the-merge-point.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-a-speculative-parallel-branch-has-already-committed-side-effects-before-the-merge-point.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1844,
    "python_slice_tokens": 352,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Speculative branch execution assumes that a branch is *reversible* until the merge gate admits it. That assumption is false the moment a branch performs an externally visible side effect—sending an email, writing to a database, calling a non-idempotent API, mutating a shared file—before the merge decision. The orchestrator's rollback logic typically operates...",
    "what_was_observed": "A planner agent at checkpoint C₀ fans out three speculative branches (B₁, B₂, B₃) to resolve an ambiguous user request: \"update the customer record and notify them.\" Each branch independently interprets \"notify\" and \"update\" and proceeds. - B₁ calls `crm.update(customer_id, field=\"tier\", value=\"gold\")`, then `email.send(template=tier_upgrade)`. - B₂ calls `crm.update(customer_id, field=\"tier\", value=\"silver\")` after ...",
    "condition_of_validity": "The invariant that makes speculative merge safe is: > For every branch B executed speculatively from checkpoint C₀, every external effect E produced by B must be either (a) buffered and not applied until B is admitted at the merge gate, or (b) recorded in an effect ledger with the branch ID and epoch, and the merge rollback must reverse every ledgered effect...",
    "decision_boundary": "An instance must treat a branch as *unsafe to speculate* — and serialize it instead of fanning out — when any of the following is detected at branch admission time: - A tool in the branch's declared toolset has `reversible=False` and no compensation registered. - The branch's first action reads external state that another concurrent branch may write (a write...",
    "operational_effect": "The practical consequence is that the orchestrator must maintain an **effect ledger** as a first-class artifact, separate from the agent state checkpoint, and the merge operation must be a two-phase commit over that ledger: 1. **Prepare:** every branch records intended effects; deferrable effects are staged, non-deferrable effects are executed and ledgered w..."
  },
  "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": "04fcc5b1565312e2a0314faee50aa593325e8aace507f4983e4e211e27d1c662",
    "verified_classes": [
      "MergeSoundnessError",
      "EffectState",
      "Effect",
      "EffectLedger"
    ],
    "verified_functions": [
      "verify_merge",
      "record",
      "uncompensated_for"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "MergeSoundnessError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
