Preheat the oven to 190°C (fan/210°C/gas mark 6½).
Roast the cherry tomatoes. Add the tomatoes and whole garlic cloves to a baking dish with plenty of extra virgin olive oil and salt. Roast for 15 minutes, or until the tomato skins start to burst and wrinkle.
Meanwhile, make the beans. Fry the shallots in olive oil on a low heat with a pinch of salt for 5 minutes until caramelising (this makes the final dish taste sweet). Add the beans, 100ml water and the stock, starting with ½ teaspoon or stock cube and adding more to taste. (You can also use the liquid from the bean cans/jar if you prefer.) Let it bubble on a low heat while you prep the tofu cream cheese.
To make the tofu cream cheese, squeeze the tofu in kitchen paper to draw out any excess water. Add to a blender with all the remaining ingredients and blend until you have a thick, paste-like consistency. You may need to pause the blending and use a spatula to scrape the mixture down the sides. Season to taste.
Add the spinach and basil (if using) to a colander in the sink. Quickly blanch them by pouring over a kettle of boiled water, then rinse under running water from the cold tap. Transfer to a blender with the roasted garlic (squeeze it out of the skins first) and the miso paste. Add more water to help it blend if you need to.
To finish the dish, add the green sauce to the beans, combine and top with the tofu cream cheese, the roasted tomatoes and a drizzle of olive oil, plus some chilli flakes or toasted seeds, if you like. Serve with sourdough, or your grain of choice and black pepper.