Cook the potatoes: Add chopped potatoes to a large pot of salted water. Bring to a boil and cook until fork-tender, about 12–15 minutes.
Drain well.
Mash the topping: Return potatoes to the pot. Add vegan butter and warm non-dairy milk a little at a time. Mash until smooth and creamy.
Season with salt and pepper. Stir in nutritional yeast or garlic if using. Set aside.
Cook the lentils (if using dried): Rinse lentils.
Add to a pot with 3 cups water. Bring to a boil, reduce heat, and simmer until tender but not mushy, 20–25 minutes. Drain and set aside.
Sauté the vegetables: Preheat oven to 400°F (200°C).
Heat olive oil in a large skillet over medium heat. Add onion, carrots, and celery. Cook 6–8 minutes until softened.
Add mushrooms and cook another 5–6 minutes until most moisture evaporates. Stir in garlic and cook 1 minute.
Build the sauce: Add tomato paste and cook 1–2 minutes to caramelize. Stir in cooked lentils (or canned), soy sauce, thyme, rosemary, and optional bay leaf.
Pour in 1 cup broth and optional balsamic or red wine.
Thicken the filling: In a small bowl, mix cornstarch with 2 tablespoons cold water to make a slurry (or use flour). Stir into the pan and simmer 2–3 minutes until thick and glossy. Add peas.
Season with salt and plenty of black pepper. Add more broth if too thick.
Assemble: Transfer the lentil mixture to a 9x13-inch baking dish or similar casserole. Spoon mashed potatoes over the top and spread evenly.
Use a fork to create ridges for extra browning.
Bake: Place the dish on a baking sheet to catch any bubbles. Bake 20–25 minutes, until the top is lightly golden and the filling is bubbling around the edges. For a deeper crust, broil 2–3 minutes at the end, watching closely.
Rest and serve: Let the pie rest 10 minutes before serving so it sets.
Garnish with chives or parsley if you like.