In recent weeks the Home Office has been doing something very unusual. It has been consulting the people likely to be affected by its policies.
This is almost unheard of. "Once upon a time I'd have killed for a Home Officer briefing like this," one immigration expert tells me. Now they're taking place all the time, with campaign groups, embassies, employers and lawyers. "They'll sit in a room and take the abuse and that doesn't stop them."
It's a strange turnaround from a department famous for inflicting a Kafkaesque nightmare on those unfortunate enough to come into contact with it. But the interests of the Home Office and EU immigrants have suddenly aligned. They need to process huge numbers of people very quickly, from a legal status based on EU free movement to one based on the new post-Brexit category of 'settled status'. And EU immigrants want to have a simple, hassle-free system for retaining their right to be in the UK.
The logistics are extraordinary. There are 3.7 million EU citizens and tens of thousands of non-EU partners. The Home Office target is for 98% of them to be transferred. To do this they are going to have to process around 5,000 people a day, every day, for two years.
If even a tiny portion of applicants are rejected by the system, the blockage could swell out of control in hours. The potential for chaos is huge.
So the Home Office is doing several things. It is consulting widely and deeply with the people who understand the needs of EU migrants. It is designing a system which is as simple as possible. And it is rigging it so it is biased towards passing people rather than rejecting them. Every part of this is unprecedented. It's like seeing a hardened criminal spend all day in a field making a daisy chain.
The process will be done via an app. To the user it is intended to be incredibly simple, but behind the front end a complex interlinked database will operate, linking users to evidence of their presence in the UK.
The shape of the project is still changing, but according to several people who have sat in meetings with the Home Office we now know enough to get a general idea of how it will work.
When you open the app, there will be three questions. The first will ask if you are an EU national, the second will ask if you live in the UK and the third will ask if you have a criminal record.
Usually visa forms demand that the applicant supply the proof of their rights to stay, but here the work is done by the government.
The app will verify whether you are an EU national by using European data, or a national insurance number tied to nationality, or information provided on entry into the UK. It will check your presence in Britain by scanning HM Revenue and Customs (HMRC) and the Department of Work and Pensions (DWP) databases.
This system is designed to give settled status to any EU citizen who has been in the UK for five years. Negotiations with the EU are still ongoing, but chances are that that five year period can start at any stage, up to the last day of transition on December 31st 2020. If someone applies before they've been here five years years, they'll be given 'temporary settled status' - although the Home Office intends to change this name to make it sound less tenuous. This then transforms into 'settled status' once the five years are up.
Technically, anyone who left the country for more than six months during this period must have a special reason for having done so. But this requirement is unlikely to be stringently enforced. There is currently no question on the app asking it.
A lot will come down to the data points the app scans on HMRC and DWP records. Will it scan for a monthly series of data points across a five year period, or bi-annually, or yearly? The fewer data points, the easier it will be for migrants to avoid questions over long stays outside the UK.
The key thing here is that the Home Office wants it to be as easy as possible - not because they have suddenly become lovely people, but because they need the system to flow smoothly in order to not have the whole thing blow up in their face. That suggests they'll use relatively few data points. People who've been knocking around the UK and then going back home for a while should still be fine.
There will inevitably be problems, of course. Not everyone will be on the HMRC and DWP databases. Sometimes the results will suggest that someone arrived in the UK later than they really did. Systems always go wrong like this.
If this happens, people will be able to submit evidence of their presence to back up their claim. It's not clear what type of evidence will be accepted, but it'll probably include household utility bills, mobile phone contracts, bank statements, library cards, enrollment certificates at a community college and registration with a GP.
The big question is what happens when you have a criminal record. What we know is that some people with a criminal record will be rejected and some will be allowed to stay. We also know that really minor crimes, like a speeding offence, will not affect an application and that really big ones, like a terror offence, obviously will. The level will be defined by the threshold for deportation, which is itself defined by whether you're a risk to the public. Europe and the UK usually have different ideas of what that entails.
The noises from the Home Office suggest they want to set the threshold high so that only those who have committed serious and repeated offences are rejected.
But even with all this in place, the potential for blockages is still vast. The number of potential applicants is just so huge, and the time to process them so tiny, that the whole thing is by definition a logistical bomb waiting to go off.
So much can go wrong. There will be people who worked in the cash economy and didn't bother declaring their earnings. There will be people who will have escaped an abusive relationship and don't have access to their documents. There will be people who do not apply during the two-year time period, because they won't know they needed to, or don't follow the news, or don't have a computer, or are homeless, or don't speak English, or have learning difficulties, or work in seasonal agricultural labour and have limited access to TV or newspapers.
What about the nationals from outside the EU who are entitled to settled status? There will be tens of thousands of non-European partners of European citizens who are entitled to stay. How does the Kenyan wife of a German citizen prove her eligibility? Will the system do the work on the back end by scanning databases? If so, which ones? Will they have to manually upload documents, and if so what if they don't have them? Many couples who've been married 40 years will have lost theirs. Others may never have needed one. After all, some countries - like India - don't issue marriage certificates.
Does HMRC and the DWP really have the capacity to make their databases searchable in this way, at this rate, for such an extended period of time? Will they even want to? After all, government departments do not always play nicely with each other.
Then there are the security implications - both national and personal. The project involves getting lots of sensitive databases and putting them together, then adding personal data to the system as part of an applicant-led evidence process. Can it be protected from being stolen, disrupted or brought down by a state like North Korea or Russia? How can you verify that someone typing their national insurance number into the phone is really that person, and not some envious ex-husband looking to keep track on his former wife?
Any of these things could go wrong. A tiny miscalculation in the system could provide far too many rejections. Or worse, two things could go wrong at once, with a flawed algorithm, say, creating chaos at the same time that a foreign state tries to subvert the system from the outside.
But it's still important to give praise where it's due. Given the scale of the task, this is the right way to go about it: consulting widely and openly, stacking the system in favour of positive results and loading the workload onto the government so that applicants themselves don't have to do it. So far, this is being approached in a sensible way.
There are tentative reasons for optimism. And that's not something we often say when it comes to the Home Office.
Ian Dunt is editor of Politics.co.uk and the author of Brexit: What The Hell Happens Now?
The opinions in politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.