Bring a large pot of water to a boil. Season generously with salt. Add the pasta and cook 1 to 2 minutes less than the package instructions so it still has a bite to it (al dente). Reserve 1/2 cup of the pasta water, then drain.
Heat a large skillet over medium-high heat. Add the walnuts and cook, stirring continuously, until toasted, about 1 minute; take care not to burn them. Transfer the walnuts to a dish and reserve. Wipe the skillet clean with a paper towel if needed.
Heat the oil in the same skillet over medium-high heat. Add the shallots and garlic and cook 2 to 3 minutes. Stir in the mushrooms and cook until browned, about 8 minutes. Stir in the flour and apples and cook 1 to 2 minutes. Add the vegetable stock, wine, 1 teaspoon salt and 1/4 teaspoon pepper and bring to a simmer. Add the asparagus and cook until tender, 3 to 5 minutes.
Stir in the drained pasta and toss to coat. Add a tablespoon or two of the pasta water if it starts to get dry, or more as needed. Add the walnuts and parsley. Serve immediately, sprinkled with nutritional yeast if desired.