Preheat oven to 325°F and line a baking tray with parchment paper.
In a medium mixing bowl, whisk together all purpose flour, baking powder, salt, walnuts, chocolate, rosemary, and orange zest until evenly combined. Set aside.
Using a hand mixer or stand mixer fitted with a paddle attachment, cream together the butter and sugar until light and fluffy, about 1 - 2 minutes. Add the eggs and vanilla extract and beat on medium speed until well combined. Scrape down the sides of the bowl as needed. Add the sourdough discard and beat on medium speed until combined. Add the dry ingredients and mix on low until a sticky dough forms.
Generously flour a surface and turn out the dough. Divide the dough into 3 equal pieces. Flour the dough and shape into logs about 2 inches wide and 3/4 of an inch thick. Place the logs on a baking sheet, spacing them as far apart as possible since they will spread a bit in the oven. Bake for 30 minutes.
Remove the logs from the oven and let cool for 5 minutes until cool enough to handle. Use a serrated knife to slice each log on a slight diagonal to create the cookies. Space each cut about 1 inch apart. Place the cookies cut side down on the baking tray. Bake for 15 minutes. The cookies will still be a little soft but will harden as they cool.
Remove from the oven and let cool for a few minutes and enjoy!