For the puff pastry, combine the flours and salt in a bowl. Mix in enough cold water to form a reasonably tight but still kneadable dough (about 75-100ml/2½-3½fl oz).
Turn out on to a lightly floured surface and knead for 5-10 minutes, or until smooth.
Form into a rough rectangle, wrap in cling film and place in the fridge for at least seven hours.
Meanwhile, use a rolling pin to flatten the butter into a rectangle, 20cm/8in long and just slightly less than 12cm/4½in wide. Wrap this in cling film and return to the fridge.
On a floured surface, roll out the chilled dough to a rectangle, 12x30cm/4½x12in.
Place the chilled butter on the dough so that it covers the bottom two-thirds. Make sure it’s positioned neatly and comes almost to the edges of the dough.
Lift the exposed dough at the top and fold down over half of the butter. Fold the butter-covered bottom half of dough over the top.
You will now have a sandwich of two layers of butter and three of dough.
Seal the edges by pinching together. Place in a plastic food bag and chill in the fridge for an hour.
Remove the dough from the bag and with the short end towards you, fold the top quarter down and the bottom quarter up so that they meet in the middle, then fold the dough in half along the centre line. Chill for an hour.
Remove the dough and with the short end towards you, fold down one-third of the dough and fold the bottom third up. Chill for an hour.
Remove the dough and repeat the last process. The dough is now ready to use. Wrap in cling film and chill in the fridge while you make the filling.
Heat your oven to 200C/400F/Gas 6 and line a large, lipped baking tray with baking parchment (some butter may leak out of the pastry).
Put the mushrooms in a food processor and season with salt and pepper. Pulse until the mushrooms are broken down to a rough paste. Add the thyme and give the mix a final pulse.
Put the mushroom mixture into a dry frying pan on a medium-high heat and cook, stirring often, until all the moisture has evaporated from the mushrooms. Remove from the pan and leave to cool.
Meanwhile, heat the oil and butter in a large frying pan over a medium-low heat. Add the onions with the sugar and cook slowly until they are very soft and sweet. This will take at least 20 minutes.
Once caramelised, stir in the sherry vinegar.
Roll out the pastry into a rectangle, about 26x30cm/10½x12in, and place on the prepared baking tray. Spread the mushroom paste down the central third of the pastry, leaving a 5cm/2in gap at the top and bottom.
Mix the sausagemeat with the black pudding, mould into a long sausage shape that will fit on top of the mushroom paste and place it on the paste. Spread the caramelised onions on top of it.
Cut 2cm/¾in strips all the way down the pastry on each side of the filling. Take one strip over the filling from one side, then one from the other and so on, crossing the strips over to form a plaited effect. Tuck the ends of the pastry under the plait, trimming off excess if necessary. Brush the plait with beaten egg and sprinkle with sesame seeds.
Bake for 30 minutes or until the pastry is golden-brown. Leave to settle for 10 minutes or so, then serve hot or cold. This is delicious with a dollop of apple sauce on the side.