Put the beef, quartered onion, garlic, ginger, all the whole spices and 6 g salt in a heavy saucepan. Add 1.5 litres water, bring to a boil and skim off any foam. Reduce to a gentle simmer and partly cover.
Start checking the beef after 90 minutes and allow about 2 hours for planning. It should be fork tender and hold its shape. Continue simmering if it is still firm, adding hot water as needed to keep it just covered. When the beef is nearing tenderness, rinse the basmati in cold water, soak for 30 minutes and drain thoroughly. If the beef is running late, drain the rice after 30 minutes anyway.
Lift out the beef and keep it covered while preparing the rice. Strain the stock and discard the spent aromatics and spices. Measure 600 ml for cooking and keep up to 60 ml extra hot for adjustments. If short of the initial 600 ml, add just enough hot water to reach it. Reserve surplus stock separately.
During the final 12 to 15 minutes of the beef simmer, heat the ghee in the rice pot over medium heat. Fry the sliced onion until evenly golden, stirring often. Take the pot off the heat if the onion is ready before the beef. Return to medium heat, add the cooked beef and green chillies, and turn gently for 2 to 3 minutes. Add the measured 600 ml yakhni and bring to a lively simmer. Taste and add up to 3 g salt if needed.
Add the drained basmati and spread it evenly. Simmer uncovered for about 6 to 10 minutes, until the stock drops to the level of the rice and small steam holes appear. Turn the heat to its lowest setting and cover tightly. Steam for about 15 minutes.
Taste a grain from near the centre. If it is still firm and the pan is dry, add 30 ml hot reserved stock or hot water around the edge. Cover and cook on low for another 3 to 5 minutes, then check again. Repeat with the remaining reserved stock only if needed. Once the rice is tender, take the pot off the heat and rest, covered, for 10 minutes. Lift out the beef, fluff the rice gently and place the beef on top. Serve hot with any of the optional accompaniments.