test: add test to catch alias discovery ordering invariant regressions