Preheat the oven to fan 90C/conventional 110C/gas ¼. Halve the plum tomatoes lengthways and place, cut-side up, in a small shallow roasting tin. Trickle over 2-3 tablespoons of the oil, then scatter with the thyme leaves and some seasoning. Roast for about 45 minutes until the tomatoes soften a little, but still hold a good shape. Remove and cool, spooning over some of the roasting juices.
While the tomatoes are roasting, blanch the shallots in boiling water for half a minute or so, then drain and cool under cold running water. Peel off the skins and trim the root ends. Also peel off any tough inner skins and cut any larger shallots in half so they are all roughly the same size.
Heat all but 1 tbsp of the remaining oil in a large frying pan and toss in the shallots, stirring to coat in the oil. Sauté over a medium heat for 15-20 minutes or until they become tender and begin to turn mid-golden in colour. Add the rosemary, season and cook for another 5 minutes. Remove from the heat and leave to cool.
Sprinkle the sugar and 2 tbsp water into a smaller frying pan and leave to stand for about 3 minutes. Put the pan over a low heat, shaking occasionally to mix the melting sugar and stirring gently. When all the sugar has dissolved, turn up the heat and cook to mid-golden brown.
Remove from the heat and mix in first the butter and then the vinegar. Take care as this might spit a bit – you should be left with a nice syrup. Toss in the shallots and tomatoes and stir lightly to coat.
Now stand eight 150ml ramekins on a metal baking sheet. Drain the shallots and tomatoes in a colander, saving the syrup, then divide them between the ramekins and set aside to cool.
Cut the pastry into 4 oblong pieces on a lightly floured board. Roll out each one very thinly, then cut out two 9-10cm discs from each piece (the discs should be about 1cm larger than the diameter of the ramekins). Pick each piece up and press the edges gently between your fingertips to make the pastry thinner. Do not prick. Lay a pastry disc on top of each ramekin, then tuck the edges of the pastry down inside, between the tomatoes and shallots and the sides of the dishes, using the handle of a teaspoon to help. Press down lightly. (The tarts can now be chilled for up to 24 hours until ready to bake.)
Preheat the oven to fan 200C/conventional 220C/gas 7. Bake for about 18-20 minutes until the pastry tops are crisp and mid-brown. Remove and cool for 5 minutes (the sugar will be very hot otherwise). Meanwhile, gently reheat the reserved syrup from the tomatoes and shallots with the remaining 1 tbsp olive oil.
Loosen the pastry edges with a small knife and carefully upend each ramekin on to a small plate. Cut the goat’s cheese into 8 thin slices (discarding the rind ends), dipping your knife into a cup of hot water in between each slice. Put one slice on top of each tatin, drizzle over the warm syrup and garnish with little basil leaves. Serve warm.