At a minimum, the mojo should:
foreach plugin, if plugin ends in .core, check plugin/META-INF/MANIFEST for Dependencies manifest header, and verify .ui is not included in the dependencies at all.
However, this minimum goal would not have solved the issue we are experiencing with foundation.checkup. The foundation.checkup plugin does not end in .core and so would be skipped by this simple algorithm.
So... we may wish to check transitive dependencies only in the same repo. For example, foundation.core depends on foundation.checker, and foundation.checker is in the same repo, so foundation.checker should also be checked for ui deps or fail.