Chop the apples into small chunks. Heat the butter in a pan over a medium-high heat until sizzling, then scatter in most of the sugar, reserving about 1 tsp. Bubble until the sugar has dissolved and the mixture is sticky. Tip in the apples and stir to coat. Season with a small pinch of sea salt flakes and cook for 5-6 mins until the apples have softened and started to caramelise and any juices they have released have evaporated. Remove from the heat and set aside to cool completely. Once cooled, will keep chilled for up to a day.
Heat the oven to 200C/180C fan/gas 6 with a baking tray inside on the middle shelf. Unravel the pastry on its baking parchment. Spoon the apple mixture over the right side of the pastry, leaving about a 1-2cm border around the edge, then brush the border all around the pastry with some of the beaten egg yolk. Fold the left side of the pastry over the apple filling to enclose it. Crimp or pinch the edge, or use a fork to seal. Use the back of a knife to score six triangles over the top of the pie, and make a few small slits in the centre of each. Brush all over with the rest of the egg yolk, then scatter with the reserved 1 tsp sugar.
Carefully lift the pie, still on its parchment, onto the hot baking tray in the oven. Bake for 25-30 mins until puffed up and deeply golden. Leave to cool for 10 mins, then cut into wedges using the marked-out triangles as a guide.