Sauté onions and carrots (always in about equal quantities) in the butter for about 30 minutes. Stir in sugar the last 10 minutes of cooking. Increase heat so vegetables will caramelize, but do not let them burn. This gives the rich brown color to the sauce.
Stir in flour. Stir-cook for about 3 minutes. Lightly brown flour, then add stock, garlic, bouquet garni, tomato paste, salt, and pepper. Stir until it boils. Reduce heat, set lid askew, and simmer about an hour. Add coloring, if necessary, to make a rich dark brown color, then strain sauce into a clean pan. Finish with Cognac and Madeira. Serve, turn into other sauces, or cool and freeze. (To cool, cover with a lid and set in cold water. Lid prevents tough skin from forming over top of sauce.) If sauce is to be frozen, omit the Cognac and Madeira. Add them at the time the sauce is reheated, and just before serving. Makes about 2cups.