If the stew is made in advance, be sure to remove the rosemary sprig and let the beans cool before refrigerating. It should be reheated gently over medium-low heat.
Soak beans in water overnight. Drain, and transfer to a large pot. Cover beans with 4 inches water. Add the intact half of the onion, the carrot, celery, and bay leaf. Bring to a boil. Reduce heat, and simmer until beans are tender but not bursting, about 1 hour. Drain, and remove onion, carrot, celery, and bay leaf; discard.
Pulse tomatoes, with juice, in a food processor until coarsely chopped. Heat oil in a medium heavy-bottomed pot over medium heat. Add chopped onion, the garlic, and red-pepper flakes. Cook, stirring occasionally, until onion and garlic are tender but not browned, about 3 minutes. Add tomatoes and rosemary. Bring to a boil.
Add beans, and simmer, stirring occasionally, until tomato sauce thickens, about 20 minutes. Season with salt and pepper. Serve warm, and drizzle with oil just before serving.
Beans can be refrigerated for up to 3 days.