Cook the lentils (but do not turn them to mush). Add lentils, water, and 1 tsp of the salt to a large pot. Bring to a boil, then reduce to a lively simmer. Cook 18 to 22 minutes until tender but still holding shape. Drain well. Toss with remaining 1/2 tsp salt and 1/2 tsp cumin.

Cook the rice. In a medium pot, combine rice, water or broth, oil, and 1/2 tsp salt. Bring to a boil, cover, and reduce to low. Cook 15 minutes, then turn off heat and rest 10 minutes. Fluff with a fork.

Cook the pasta. Boil pasta in well-salted water until just tender. Drain. If it will sit for a bit, toss with a tiny splash of oil to prevent sticking.
Crisp the onions. In a large skillet over medium-high heat, add enough neutral oil for about a 1/4-inch depth. If using flour, toss the onions with flour first. Right before frying, toss with the salt. Fry in batches, stirring often, until deep golden and crisp, 6 to 12 minutes per batch depending on your pan and how crowded it is. Transfer to a paper towel lined plate.
Tip: Pull them when they are a shade lighter than you think. They keep browning from residual heat.

Make the tomato sauce. Pour off most of the frying oil, reserving 2 tablespoons in the skillet. Add garlic and cook 30 seconds until fragrant. Stir in tomato paste for 1 minute. Add crushed tomatoes, cumin, coriander, paprika (if using), sugar, salt, and pepper. Simmer 15 to 20 minutes, stirring occasionally, until slightly thickened. Taste and adjust salt and sugar.

Make the garlic vinegar sauce. In a small bowl, whisk vinegar, water, garlic, cumin, salt, and optional pepper flakes. Let it sit 5 minutes so the garlic takes the edge off in the best way.

Optional: stir together a quick chile sauce. In a small bowl, mix hot sauce (or chili garlic sauce) with a couple spoonfuls of the tomato sauce (or tomato puree), then add vinegar to taste. Season with a pinch of cumin and salt if you want it extra street-food-ish.
Assemble the koshari. In bowls or on a platter, layer equal-ish parts rice, lentils, and pasta (I start with about 1/3 rice, 1/3 lentils, 1/3 pasta, then adjust to your mood). Add warm chickpeas if using. Spoon tomato sauce over top, then drizzle a little garlic vinegar sauce. Add chile sauce if you want heat. Finish with a generous handful of crispy onions.
My serving advice: Put all the sauces on the table. People can keep it layered, mix it up, or do both halfway through.
