Step 1Seed the chiles, rinse and set aside. Bring 4 cups of water to a boil. Remove from heat and add the chiles, pushing them down with a spoon so they are fully submerged. Cover and let stand for 30 minutes.
Step 2Meanwhile, in a saucepan over medium heat, boil the onions in water until soft, about 25 minutes. Drain.
Step 3Remove the soaked chiles from the water, reserving 2 cups of the liquid. In a food processor, blend the chiles, onions and garlic until pureed.
Step 4In a saucepan over medium heat, heat the oil. Stir the cumin into the hot oil, being careful not to burn it. Add the chile mixture and simmer for 3 minutes. Add 1 cup of the stock, 1 cup of the reserved chile liquid and the tomatoes. Add just enough additional stock and reserved liquid to make a sauce the consistency of thin gravy. Add the sugar and salt and cook for 10 minutes longer, stirring occasionally, until the sauce is the consistency of a thin gravy. Taste and add more salt and sugar if needed.
Step 5Set aside to cool. Store in an airtight container in the refrigerator for 4 to 5 days, or in the freezer for 2 to 3 months.