Preheat oven to 350˚F. Line a baking sheet with parchment and place the sweet potato, shallots, and (unpeeled) garlic on it. Toss with a tablespoon of the olive oil and season with salt and pepper. Roast, removing (and setting aside) the garlic after 15 minutes, until the sweet potatoes are tender and shallots are beginning to turn golden brown. Remove from oven and set aside.
Cook the pasta according to package directions until al dente, and drain, reserving ½ cup of the pasta water.
Place the cashews in a blender or bowl of a food processor with sweet potato, shallots, reserved (peeled) garlic, the remaining 2 tablespoons olive oil, balsamic vinegar, tomato paste, rosemary, and some salt and pepper. Process until smooth, adding some of the reserved pasta water as needed to reach a creamy consistency. Taste and adjust seasoning as needed.
In a large serving bowl, toss the cooked pasta with enough sauce to coat. Serve topped with toasted pine nuts, chives, and some red pepper flakes.