Add the oil to a medium to a large pan and start browning the two whole garlic cloves. After a few minutes add the parsley and the shallot finely chopped. Let them brown nicely, being careful not to burn them. If they start sticking to the pan, add small splashes of water, but erally small not to give the "boiled" taste.
When the shallot is translucent, add the tomato sauce and cook for about 10 minutes over medium heat.
Add the cooked beans, stir, and let cook for some 5 minutes.
Cover with water, add a pinch of salt, and bring the water to a boil.
When the water starts boiling, add the pasta, stir, and cook over low heat following the instructions of the box. Cook over low heat and stir continuously but gently. The heat is low, so no need to cover it, but you do need to check it constantly. If it becomes dry and the pasta is not cooked yet, add two or three tablespoons of water and stir.
Proceed this way until the pasta is al dente. Turn off the fire when the result is creamy but not watery, thick but not dry.