Prepare the pan. Preheat the oven to 350°F. Line an 8-inch square baking pan with parchment paper, leaving some overhang for easy removal, and lightly coat with cooking spray. Make the crumble mixture. In a large bowl, combine the rolled oats, wholewheat pastry flour, cinnamon, baking soda and salt. Add the maple syrup, melted butter and vanilla, stirring until the mixture is evenly moistened and crumbly.
Form the crust. Reserve about 1 cup of the oat mixture for the topping. Firmly press the remaining mixture into an even layer in the prepared pan. Bake for 10 to 12 minutes, until the edges are lightly golden.
Cook the apples. While the crust bakes, add the sliced apples, maple syrup, lemon juice, cinnamon, nutmeg and salt to a large skillet over medium heat. Cook for 5 to 7 minutes, stirring frequently, until the apples begin to soften and release their juices.
Thicken the filling. Add the cornstarch slurry to the apples and stir well. Continue cooking for 1 to 2 minutes, until the juices have thickened. Remove from the heat and stir in the vanilla.
Assemble the bars. Spread the apple mixture evenly over the warm crust. Crumble the reserved oat mixture over the apples, gently pressing some of the topping together to create larger crumbles.
Bake. Return the pan to the oven and bake for 28 to 32 minutes, until the topping is golden brown and the apple filling is bubbling around the edges.
Cool and slice. Allow the bars to cool completely in the pan for at least 1 hour. For clean slices, refrigerate them for another 30 minutes before lifting the bars out with the parchment paper and cutting into 12 squares.
Make the caramel sauce (optional). While the bars cool, whisk the maple syrup, cashew butter, milk and coconut oil in a small saucepan over low heat for 2-3 minutes, until smooth. Remove from the heat and stir in the vanilla and salt. Add another splash of milk if needed, then drizzle over the cooled bars.