In a 10 or 12-inch saute pan, heat 3 tablespoons of the olive oil. Saute the ground chicken or beef until lightly browned, breaking up the pieces as they cook. Season lightly with salt and pepper. Remove the chicken or beef with a slotted spoon and drain in a colander. Set aside until needed.
In the same saute pan, heat the remaining 2 tablespoons of olive oil. Over medium heat, saute the onion, carrots and celery until they just start to color, 6 to 8 minutes. Do not brown. Add the garlic, stir in the tomato paste, and cook a few minutes longer.
Deglaze the pan with the wine and cook, stirring occasionally, until almost all the liquid has evaporated. Add the tomatoes, cook for 2 or 3 minutes, then pour in the stock and reserved chicken and season with the oregano, thyme, and a little salt and pepper. Cook until the sauce has thickened slightly, about 30 minutes. If the sauce has thickened too much or you prefer a thinner sauce, add a little more stock. Stir in the chopped basil and the red pepper flakes and adjust the seasoning, to taste. Serve over rigatoni.