{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-in-a-speculative-branch-fail-to-roll-back-cleanly-when-a-sibling-branch-commits-first",
  "title": "Why does an instance in a speculative branch fail to roll back cleanly when a sibling branch commits first?",
  "date_of_record": "2026 November 25",
  "scope": "Applies to orchestrators that fan out a single task into N parallel speculative branches (each branch mutating shared external state via tool calls) and later reconcile by selecting one branch's result while rolling back the others. Does not apply to read-only fan-out, nor to branches that operate on fully isolated sandboxes with no shared side-effect surface.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-in-a-speculative-branch-fail-to-roll-back-cleanly-when-a-sibling-branch-commits-first.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-in-a-speculative-branch-fail-to-roll-back-cleanly-when-a-sibling-branch-commits-first.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-in-a-speculative-branch-fail-to-roll-back-cleanly-when-a-sibling-branch-commits-first.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1966,
    "python_slice_tokens": 481,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"a branch crashed.\" It is the distinction between **logical rollback** (the orchestrator discards a branch's result and marks it aborted) and **physical rollback** (the side effects that branch already committed to shared external systems are actually undone). In speculative parallel execution these two are conflated by design: the orchest...",
    "what_was_observed": "A planner agent decomposed a task into a shared mutable resource — a configuration record, a rate-limit counter, an issue tracker entry — and spawned three speculative branches to attempt the fix in parallel. Each branch was given the same tool grant and the same starting snapshot. The reconciler used a first-valid-wins policy: the first branch to return a passing verification is committed; siblings are cancelled. Tr...",
    "condition_of_validity": "This analysis holds when all of the following are true: - Branches share at least one mutable external surface (not a private sandbox). - The reconciler commits on a first-valid-wins or quorum policy that can fire while siblings are still executing. - Tool calls are not atomic with respect to the branch's cancellation check — i.e., cancellation is checked *b...",
    "decision_boundary": "The architect must choose, per shared surface, between two enforceable invariants: - **Write-gated speculation:** No branch's tool call is permitted to touch shared state until it holds a lease; the reconciler acquires the commit lease before selecting, and revocation of sibling leases is *synchronous and blocking* (the tool layer rejects writes from a revok...",
    "operational_effect": "When the barrier is missing, the system exhibits *silent* post-commit corruption proportional to sibling concurrency and tool latency variance: the more branches run in parallel and the longer their tool calls block, the wider the window in which an orphan writer lands after commit. Because the reconciler reports success, the corruption surfaces downstream —..."
  },
  "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": "24e1ffb21630643625eda471b9789471178c76c99b15135f7b53f4de66391c38",
    "verified_classes": [
      "OrphanWriterError",
      "Lease",
      "SharedSurface"
    ],
    "verified_functions": [
      "reconcile_first_valid_wins",
      "_revocation_time",
      "_demo",
      "write"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "OrphanWriterError"
    ],
    "sample_fail_closed_invariants": [
      "reconciliation barrier missing: sibling write survived commit"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
