Orders middleware topologically by runsBefore / runsAfter (a.runsBefore(b) and b.runsAfter(a) are the same edge, a outside b), breaking ties by registration order. One ValidationError lists every invalid id, duplicate id, constraint naming an id that is not registered, cycle, and tool name contributed twice by one middleware or by more than one.
Orders middleware topologically by runsBefore / runsAfter (a.runsBefore(b) and b.runsAfter(a) are the same edge, a outside b), breaking ties by registration order. One ValidationError lists every invalid id, duplicate id, constraint naming an id that is not registered, cycle, and tool name contributed twice by one middleware or by more than one.