It is illegal to do what Harvard is doing in hiring decisions. It may even be illegal for Harvard to do what it is doing, given how the supreme court decides to rule. Affirmative Action doesn't exist in employment.
Affirmative action definitely exists in hiring. There are racial and gender quotas.
Such a quota would be very loudly illegal.
Why would it be illegal to have two separate but otherwise identical simultaneous job postings, one only covering the protected group and one only covering the unprotected group? Like, 10 males and 10 females, or 10 whites and 10 non-whites, or 10 elders and 10 youngsters, as long as they are employed without such seggregation after hiring.