How to enumerate DSA port names?

Hi. How does OpenWrt enumerate the DSA port names from the underlying system (Linux)?

I have a setup script that runs on the OpenWrt device. It inspects the system, then emits a bunch of UCI commands to configure the system. I noticed after the 22 => 23 upgrade that the wan port was no longer configured (my script wants to configure the wan port as another "lan" port).

In 22.03.5, I had done (on Cudy X6 v1 - ramips/mt7621):

$ ls -1 /sys/devices/platform/*eth*/mdio_bus/mdio-bus/mdio-bus*/net
lan1
lan2
lan3
lan4
wan

Now in 23.05.0, the same command does not report the wan port:

$ ls -1 /sys/devices/platform/*eth*/mdio_bus/mdio-bus/mdio-bus*/net
lan1
lan2
lan3
lan4

The "Port status" of the luci UI shows lan1-lan4 + wan .

How does OpenWrt enumerate the DSA port names? Or do I really just need to special-case the case of the wan port?

Thank you.

Edit: as suggested here, the following command yields similar information; the wan port does not show up:

grep -sq DEVTYPE=dsa /sys/class/net/*/uevent

there was a change with lots of MT7621's where they removed the wan from the switch
this may shed some light on a change you may be seeing