n a medium bowl mix in flour, cocoa powder, baking powder, and salt; set aside.
Combine the butter and brown sugar in the bowl of a stand mixer fitted with a paddle attachment. Mix on medium speed until light and very fluffy, about 5 minutes. Scrape the bowl.
Lower the speed and add the eggs one at a time, scraping between additions. Still on low speed, add the chocolate and sourdough starter/discard. Mix until well combined, about 1 minute. Add the vanilla to the mix.
Gradually add dry ingredients and combine everything.
Transfer the dough, which will resemble very wet batter, to a bowl; cover and refrigerate at least 8 hours overnight, or up to 1 week.
Preheat the oven to 350°F. Line a baking sheet with parchment paper. Put the confectioners’ sugar and the granulated sugar in separate bowls.
Use a 1 ½-tablespoon cookie scoop or portion scoop and shape the cookies into a ball. Roll each ball into the granulated sugar first and then into the confectioners’ sugar, coating completely.
Place the cookies onto the prepared baking sheet ½-inch apart. Bake until puffed and cracked and just set around the edges, 14 minutes. The centers will still be soft and appear under-baked.
Cool completely on the baking sheet. Serve right away or store in an airtight container for up to 4 days. For a long time use freeze the cookies.