implement and test Edge.preventCycle to complete last DAG enforcement hook