While repeat() can take a max depth, it should be able to traverse until all leaf nodes are found.
In Gremlin, here is one I had used:
g.V().has('name','Q1').repeat(out().simplePath()).emit(__.not(out().simplePath())).path().by('name') ==>[Q1, Q2, Q3, Q4]
In this case it produces the “path” (starting node to leaf node).
Also needed are cycle detection, in order to either avoid or to detect endless loops so they can be fixed.
While Oracle’s implementation is non-standard SQL, it is quite complete and easy to understand. For example, this page shows what can be done [here]
Thanks for asking for requirements.