In a large, heavy pot, brown the meat in a drizzle of oil in batches (without crowding), seasoning with salt, over medium-high heat.
Transfer to a bowl and cook the onions in the same pot. Pour in the stout or stock and bring to a simmer, scraping up the browned bits on the bottom of the pan. Return the meat to the pot, add the thyme, cover and put into a 150°C (300˚F) oven for 2 ½-3 hours.
Remove from the oven and add the carrots and peas, stirring them into the gravy, cover and return to the oven for 20 minutes, or until the carrots are tender.
On a lightly floured surface, roll the pastry out slightly larger than the diameter of your baking dish (or dishes).
Remove the stew from the oven, turn the heat up to 200°C (425˚F), and if you like, divide the stew into smaller baking dishes. Cover with pastry, allowing it to overlap the edges of your baking dishes, or tucking in the surplus. Brush the top with some beaten egg, if you’d like it glossy, and cut a few holes in the top to allow steam to escape.
Return to the oven for about 15 minutes, or until the pastry is golden.