Re: Well, you're leaving
the situation should be simple to deal with - just 'grandfather in' any EU citizen who's already in the UK and working at Brexit time as 'legal immigrants with work visas'. shouldn't be too hard at that point.
(seriously making this all harder than it needs to be)
It'll easy if you don't know EU citizen rights (they don't have to be working), don't know how residency is proven (last five years of paperwork), and don't know how resident EU citizens can be distinguished from non-resident EU citizens at the UK border (they can't).