Pick over the beans and discard any stones or damaged beans. Soak the beans in plenty of cold water for 4 hours. Drain the beans and place them in a large saucepan. Cover with plenty of water and simmer until the beans are tender and the skins just begin to crack, 45 to 60 minutes. Drain the beans.
Heat 2 tablespoons olive oil in a large soup pot over medium low heat. Add the onions, carrots and celery and cook, stirring occasionally, until the vegetables are tender, 20 minutes. Add the tomatoes, stock and 3 cups water and simmer 45 minutes.
In the meantime, place the basil, pine nuts, garlic, 4 tablespoons olive oil and ½ cup Parmigiano in a blender or food processor. Blend at high speed until well mixed, 1 minute. Stop and scrape down the sides periodically and continue to blend until smooth, 1 minute. Season with salt and pepper. Fifteen minutes before serving, add the cooked cannellini beans, green beans, and pasta and simmer covered, until the pasta is completely cooked, 8 to 10 minutes. Add the Swiss chard and simmer until it wilts, 5 minutes. Season with salt and pepper.
Ladle the soup into bowls and top with a large spoonful of the pesto. Sprinkle with the remaining ½ cup Parmigiano and serve immediately.