Cook the pasta in plenty of boiling salted water according to the package instructions until al dente.
In the meantime, wash the tomatoes, cut out the stalks in a wedge shape and dice the tomatoes.
Wash the cucumber thoroughly, rub dry and cut in half lengthwise. Remove the seeds with a teaspoon and dice the cucumber.
Wash the parsley and basil and shake dry. Pluck the leaves and chop them roughly.
Roast pine nuts in a coated pan until golden brown. Put them on a plate and let them cool down a little.
Grate the parmesan; cut the lemon in half and squeeze it.
Drain and drain the pasta, collecting about 200 ml of pasta cooking water.
Place the pine nuts, olive oil, stock, parmesan, herbs and 4 tablespoons of pasta cooking water in a tall container. Puree with a hand blender to a creamy pesto. If necessary, add more pasta cooking water (the paste may be a little more liquid, as the pasta will absorb more liquid later). Season with salt, pepper and 1-2 tablespoons lemon juice.
Put the pasta in a large bowl. Mix in tomatoes, cucumber, pesto and, if desired, some more pasta cooking water. Season with salt, pepper and remaining lemon juice and serve lukewarm.