Preheat the oven to 400°F [200°C].
On a baking sheet, toss cherry or grape tomatoes with extra-virgin olive oil and roast until the tomatoes start to burst and turn a light golden brown, rotating the pan halfway through cooking, 25 to 30 minutes. Remove from the oven and transfer the tomatoes with the juices to a blender or food processor. Pulse on high speed into a smooth purée.
While the tomatoes roast, cook the pasta. Bring a large pot of salted water to a boil and cook dried spaghetti until al dente, per the package instructions. Drain the cooked pasta and transfer to a large bowl.
In a medium saucepan, warm extra-virgin olive oil over medium heat. Add grated garlic cloves and red pepper flakes such as Aleppo, Maras, or Urfa and swirl in the hot oil until fragrant and the oil starts to turn red, 30 to 45 seconds. Remove from the heat and whisk in white or yellow miso paste. Stir in the puréed tomatoes until smooth and free of lumps. Return the saucepan to the stove, bring to a boil over high heat, then turn down the heat to low and simmer until the sauce thickens, 2 to 3 minutes. Taste and season with fine sea salt. Remove from the heat.
Fold the spaghetti with the tomato sauce. Garnish with grated Parmesan and torn fresh basil leaves. Leftovers can be stored in an airtight container in the refrigerator for up to 4 days.
