Preheat oven to 350°F.
Peel and quarter the sweet potato, peel and halve the shallots, and leave the garlic in its paper.
Arrange everything on a foil-lined baking sheet, drizzle with olive oil, and season with salt and pepper.
Roast, removing garlic after 15 minutes, and cook the rest until the sweet potato is tender, about 30 minutes and cool slightly.
Cook pasta to al dente, reserving pasta water.
Blend drained cashews, roasted sweet potato, shallots, peeled garlic, olive oil, balsamic, tomato paste, rosemary, and seasoning in a high-speed blender, adding water as needed.
Toss pasta with the sauce, loosening with pasta water, and adjust flavors as needed.
Garnish with chives, pine nuts, and red pepper flakes.