Preheat the oven to 325F. In a large oven-proof casserole or medium pot, heat a drizzle of oil over medium-high heat and sauté the onion for 3-4 minutes, until soft. Add the carrots, celery, mushrooms and garlic and cook for a few more minutes. Remove from the pan and set aside. Add another drizzle of oil, sprinkle the beef with salt and pepper and brown it in the pan, turning to get as much colour as possible. Return the veggies to the pan, sprinkle everything with flour and stir to coat.
Pour the Guinness overtop, then add stock or water to come up to the top of the meat. Cover and place in the oven for 2 1/2-3 hours, until the meat is very tender. If you like, cool and refrigerate overnight, or up to a few days.
When you're ready to bake the pie, preheat the oven to 375F. On a lightly floured surface, roll the puff pastry out into a circle, square or rectangle slightly larger than your baking dish. (If you need to, transfer the beef mixture into a casserole or other baking dish.) In a small dish, beat the egg with a spoonful of water with a fork, and brush the edge of your baking dish with it. Drape the puff pastry overtop and cut a few slits in the top to allow steam to escape. (If you like, cut a crisscross pattern with a sharp knife, without going all the way through the pastry.) Brush with the egg wash and bake for 40-45 minutes, until the pastry is puffed and deep golden, and the filling is bubbling through.