1. Trim the courgette and aubergine, then chop into 2cm chunks. Set a large pan on a medium-high heat for 2 mins, then add 1½ tbsp olive oil, the courgette and aubergine. Season with a pinch of salt. Fry for 5 mins, stirring every now and then, till the veg are slightly softened and lightly coloured. While the veg fry, peel and thickly slice the onion.
2. Lift the veg out of the pan and pop into a bowl. Drizzle ½ tbsp oil into the pan and add the onion. Fry, stirring every so often for 8 mins till glossy.
3. While the onion cooks, pick the leaves from the thyme sprigs and finely chop the leaves (if the thyme sprigs are woody you can push them through a sieve and the leaves will collect in the bowl of the sieve. If the sprigs are white and tender, you can chop them up with the leaves). Peel and thinly slice 1½ garlic cloves, setting the remaining half-clove aside for later. Drain and rinse the lentils.
4. Tip the courgette and aubergine back into the pan. Add the sliced garlic and the chopped thyme. Stir for 1 min.
5. Tip in the tin of cherry tomatoes then half fill it with cold water (around 200ml) and add that too. Add the rinsed lentils, 1 tbsp balsamic vinegar and the olives. Add a pinch of salt and pepper. Place a lid on the pan and cook on a medium heat for 20 mins. Stir every now and again.
6. Whilst the ratatouille simmers, pick the leaves from the basil and finely chop them. Place them into a small bowl. Zest in the lemon and squeeze in half the juice. Finely grate in the reserved half garlic clove. Add ½ tbsp olive oil, 2 tbsp cold water and a good pinch of salt and pepper. Whisk with a fork and set to one side. Chop the halloumi into 6 thick slices.
7. When the ratatouille has cooked for 20 mins, taste and adjust the seasoning, remembering the halloumi and olives will lend their own savouriness to the dish. Turn off the heat to allow it to cool slightly.
8. Place a small frying pan on a high heat. When hot, place the slices of halloumi in it and fry them for 2-4 mins on each side till golden and soft.
9. Spoon the ratatouille into 2 warm bowls. Top with 3 slices of halloumi each. Spoon over the lemony basil dressing and serve.