Preheat the oven to 200C/180C Fan/Gas 6.
For the baked beans and sausages, heat a tablespoon of the oil in an ovenproof frying pan over a medium heat. Add the sausages and fry for 2-3 minutes, or until browned on all sides. Transfer the pan to the oven and continue to cook for 10-12 minutes, or until cooked through. Remove from the pan and set aside.
Meanwhile, heat another tablespoon of the oil in a separate frying pan over a medium heat. Add the shallots and fry for 2-3 minutes, or until softened. Add the rosemary and garlic and fry for a further 1-2 minutes.
Add the chopped tomatoes and bring the mixture to the boil, then reduce the heat until the mixture is simmering. Add the stock and beans, return the mixture to a simmer and cook for 3-4 minutes, or until the sauce has thickened slightly.
Stir in the parsley and season, to taste, with salt and freshly ground black pepper. Keep warm.
For the cassoulet and mash, heat a heavy-based, ovenproof casserole dish over a medium heat. Add the pancetta lardons and fry until crisp and golden-brown. Then add the duck confit.
Add the cooked sausages and the bean mixture, then pour over the stock and bring the mixture to a simmer. Stir in the rosemary and parsley and season, to taste, with salt and freshly ground black pepper.
Meanwhile, heat a griddle pan over a medium heat. Drizzle a little of the remaining tablespoon of oil onto each side of the bread slices. Grill the bread for 1-2 minutes on each side, or until golden-brown chargrill marks appear on both sides.
In a food processor, blend the toasted sourdough to breadcrumbs. Sprinkle the breadcrumbs on top of the cassoulet and bake for 5-10 minutes, or until the sauce has thickened slightly.
Meanwhile, boil the potatoes in a pan of salted water for 12-15 minutes, or until tender. Drain well and return to the pan, then return the pan to the heat for 1-2 minutes so that any excess moisture evaporates.
Mash the potatoes until smooth (preferably using a potato ricer), then beat in the butter and double cream until smooth. Season, to taste, with salt and freshly ground black pepper.
To serve, divide the mash among serving plates and spoon over the cassoulet.