Bring 4 L / 4 quarts of water to a boil in a 5-quart / 4.7 L pot. Meanwhile, toast the pine nuts in a 20 cm / 8-inch dry skillet over medium heat for 2 to 3 minutes until golden and fragrant, then tip them onto a plate.
Heat the olive oil in a 28 cm / 11-inch deep sauté pan over medium-low heat. Add the onion and cook for 8 minutes, stirring often, until soft and pale gold.
Add the garlic, anchovies and chili flakes. Stir for 2 minutes until the anchovies dissolve into the oil and the garlic smells sweet but hasn't browned.
Add the broccoli, olives, raisins, wine, water and 1/2 tsp salt. Bring to a simmer, cover, and cook over medium-low heat for 20 minutes, stirring every 5 minutes, until the stems are fork-tender and the florets collapse into an olive-green sauce. If it's still bright green at 10 minutes, keep going.
When 10 minutes of braising remain, salt the boiling water with 2 tbsp salt and cook the dried ditalini or broken spaghetti for 1 minute less than the package time. Reserve 250 ml of the pasta water, then drain.
Add the drained pasta to the broccoli with 120 ml of the pasta water. Cook over medium heat for 2 to 3 minutes, stirring, until the sauce clings to the pasta and no liquid pools in the pan.
Take the pan off the heat and stir in half the pecorino, the toasted pine nuts and black pepper. Serve at once in warm bowls with the remaining pecorino.