How do you approach writing clean, maintainable code for infrastructure automation?
Implement plan_automation_steps(steps) to return a deterministic execution order for named automation steps and their dependencies. Return an empty list when the dependency graph contains a cycle.
Input is a list of dictionaries with name and depends_on fields. Output is a list of step names. Use lexicographic ordering when multiple steps are ready.
def plan_automation_steps(steps):