Stormont officials have described preparations for the Northern Ireland Protocol as a "major emergency response plan".
Central to that emergency is food. Even if an EU-UK free trade agreement (FTA) is concluded in the coming days, the UK will be liable for ensuring that Northern Ireland applies EU food safety and animal health rules from 1 January.
The human resources alone tell the story: the Northern Ireland Department of Agriculture has increased staff from 2,900 to 3,200. Belfast and Larne ports will each need 25 vets, 75 inspectors for their portal offices, and 12 administrative staff to carry out documentary checks.
The local authorities will need 30 environmental health, 18 plant health and three fisheries officers. A further 53 vets are being trained, with some of the funding coming from the European Union.
New animal health and food safety inspection centres are underway at Larne, Belfast and Warrenpoint ports. They are so far behind that contractors are having to build temporary facilities at the same time because the long-term facilities won't be ready for 1 January.
"We will not be able to deliver the frictionless movement we all hoped for between Great Britain and Northern Ireland on day one," Northern Ireland’s chief vet Robert Huey told the Stormont Assembly agriculture committee on 5 November. "But what we will be able to do is to ensure that physical checks are carried out to a level which allows product to enter Northern Ireland, albeit, on some occasions, with delays."
With just over six weeks to go, the politics surrounding the final dash is intense.
Neither the EU nor UK appear willing to make substantial moves on the most sensitive parts of implementing the protocol in case that impacts on the delicate dynamic within the FTA negotiations.
There are tensions within the Northern Ireland polity itself since the DUP has disavowed the protocol.
Against that backdrop there are frantic technical meetings involving Northern Ireland officials, business groups, European Commission and UK officials. Meetings of the EU-UK joint and specialised committees, which are supposed to implement the protocol, have been ramped up.
"We’re pushing this very hard as this is so significant for us, the volumes are just so high," says one senior official familiar with developments. "Had everybody had longer to deal with these things, it could have been different. We’re being squeezed into this short time frame."
At the heart of the process is an essential tension: the UK mantra is that all sides should minimise the pain the protocol renders on daily life; the European Commission wants to ensure the single market is preserved and insists food safety rules are there for a reason.
This is not about fussy, legalistic commission officials. Member states are watching this closely and their officials have been monitoring both the joint committee and specialised committees in increasing numbers.
But there is a greater effort to find common ground.
The Joint Committee, chaired by Michael Gove on the UK side and Maroš Šefčovič on the EU side, has been giving firmer political direction to officials to find technical solutions.
Last Thursday’s meeting of the more technical specialised committee was described by both sides as very positive. "Overall, it was probably the best meeting so far," says one diplomat. "There was considerable progress made."
That included securing an EU VAT number for Northern Ireland businesses so they can plug into the EU-wide VAT collection system (pre-Brexit they were simply gathered under the UK numbering system).
Work was also advanced on what rules will govern the functioning of the Single Electricity Market (SEM) on the island of Ireland.
Critically, both sides agreed to a one-year grace period when it comes to medicines, another area where Brexit seriously complicates existing arrangements.
Under the EU Falsified Medicines Directive, every medicine pack produced in the EU has a unique set of codes which a pharmacist scans when a customer buys over-the-counter medicine (it’s designed to prevent the circulation of counterfeit drugs).
Under the protocol, Northern Ireland retains that facility. After the grace period expires, any medicines sold in Northern Ireland will require this identifier on the packs.
The problem is that 80% of the medicines prescribed in the North are shipped over daily (or twice daily) from Britain.
"The challenge is that GB packs of medicines ... will not have the obligation of having this unique identifier on the packs of medicines," Rick Greville, director of distribution and supply at the Association of the British Pharmaceutical Industry (ABPI) told the House of Commons Northern Ireland Affairs Committee this week.
"If a pharmacy cannot verify a pack of medicine in Northern Ireland as being authenticated because of its unique identifier, the pharmacist will be expected to quarantine that pack and not pass it on to the patient," Mt Greville told the committee.
The hardest aspect of the protocol remains retail food.
Under Article 5(4), Northern Ireland’s Department of Agriculture is responsible for applying the EU’s Official Controls Regulation (OCR) on food and animal products arriving from Britain.
Any lorries entering the UK from France, by contrast, will tend to be dominated by one, or a handful of categories of food, so the paperwork and costs will be simpler.
"That doesn’t work for Northern Ireland because of the way the just-in-time supply chain works," says Aodhán Connolly, chief executive of the Northern Ireland Retail Consortium.
"90% of the supermarket loads are consolidated [ie mixed]. If they are fresh loads then they can have one thousand, up to 2,000 different products. They can have, in the worst-case scenario, maybe 400 products of animal origin that will each require an export health certificate."
An export health certificate can cost between £50 and £200 depending on the product. Mr Connolly says that will make the high volume, low profit margin model of northern supermarkets unviable.
Last week, Sainsburys’ chief executive Simon Roberts told the Guardian: "If we don’t get greater clarity on the Northern Irish situation then we will see a restriction on the ranges of products we can sell. This is not one or two products in stores I am talking about, it is a substantial number of products and quite key, everyday products too."
That prompted a rare bout of unity between the North's First and Deputy First Ministers, who wrote to the commission describing the risk as "unacceptable" (the first joint Brexit-related communication since Arlene Foster and the late Martin McGuinness warned about the impact of Brexit in August 2016).
Mrs Foster and Michelle O’Neill insisted that the "best endeavours" clause in the protocol "can and must secure an outcome which guarantees the normal flow of agri-food products to our people."
It is less than 50 days to 1 January, yet the EU-UK Joint Committee first sat on 30 March. In the interim, politics have bedevilled the process.
The first meeting was dominated by bad-tempered exchanges over whether the EU could have an office in Belfast to house officials supervising checks and controls, as mandated by the protocol. The EU was also exasperated at claims, going all the way up to Boris Johnson, that there would be no checks or controls on trade between GB and NI and vice versa.
By the summer, technical engagement was under way, but by early September the UK Internal Market Bill (IMB), which overwrites elements of the protocol, caused a serious slump in trust.
"The UK IMB eroded about six months of trust in the space of 24 hours," says one source close to the negotiations.
Things have improved since then. The commission dropped its demand for an EU "physical presence" in Belfast and the awarding of tenders to start building border control posts at northern ports convinced Brussels that London was serious in its intentions.
But the most sensitive issues have yet to be resolved. Industry sources suggest that both sides are mindful of the downstream reputational implications.
"The European Commission is aware of the hearts and minds stuff," says one source. "They need to be seen not to be the bad guys. There are people who are worried about how it will play out if Northern Ireland goes hungry. For the UK government, it would be Northern Ireland getting shafted so there is also reputational damage there if one of the big multiples pulls out."
Northern Ireland officials have acknowledged the commission’s efforts to stretch the rules as possible.
"They worked hard to find flexibilities and clarifications within the existing legislation in order to help us with a plan that was deliverable," Robert Huey, Northern Ireland’s chief vet, told the Assembly agriculture committee last week. "We wouldn’t have got to where we are with the deliverable plan that I can present to you with some confidence if the commission hadn’t helped us."
Some of those flexibilities are based around the IT systems that Northern Ireland and Britain will need to have access to in order to inhabit the hybrid world of the protocol.
But what exactly does the EU’s food safety regime entail?
The majority of foods of animal origin need an export health certificate. This must be signed by a UK vet and the exporter generally has to pick up the cost. There are some derogations, for example where the meat content is less than 50%, or whether a bakery product made with eggs and milk is "shelf stable".
However, composite products like lasagna and sausage rolls will need certificates. Again, there may be derogations and exemptions depending on whether the product is fully cooked, how much meat it contains, what is the dairy content and so on.
The export health certificates are proof, as attested by a vet, that meat comes from a BSE-free herd and is microbiologically safe and so on.
Is every product physically checked?
According to the Food Safety Authority of Ireland (FSAI), which ensures EU rules are applied in the south, between 1% and 30% of products will need to be physically checked, depending on the risk.
"The highest risk is fresh poultry, but then some of the lower-risk goods are down to 1% checks," says Gail Carroll, the FSAI’s Official Controls and Brexit Manager. "These are random checks. They would be pulled in for a full physical inspection. That could be unloading the products off the truck, taking the temperature, maybe doing a microbiological sample, sometimes they might even do a taste test."
100% of products of animal origin will, however, need an identity check.
Ahead of shipment, traders will need to file the export health certificates electronically with the EU’s food safety and animal health TRACES system.
EU and UK officials have agreed that inspectors on the British side, in Cairnryan, Heysham and Liverpool ports, will do that work, pulling up entries on their iPad, and checking them against the seal on the lorry waiting to board.
The seal and the paperwork will have to match, and a glance inside the truck may be required to ensure the food products match both.
"This is to avoid, as far as possible, having to stop lorries coming off the ferry [in Northern Ireland], and doing the work when they’re on the ferry," Denis McMahon, permanent secretary at the Northern Ireland Department of Agriculture, told the agriculture committee.
Any trucks requiring physical checks will be notified before they arrive at northern ports. The authorities are hoping that only between two and four trucks per roll-on, roll-off sailing will have to be checked.
Opponents of the protocol complain that UK food standards are high, so why should all of this be necessary?
Despite joining forces with Sinn Féin’s Michelle O’Neill to write to the commission, Arlene Foster later complained on Twitter: "These goods are sterling packaged by well established companies, there is zero risk that they would use a backdoor to the EU. It is simply not reasonable for the EU to insist these goods are treated as 'at risk'".
Like it or loathe it, ensuring that food is safe, so that one member state can sell it into another, is a foundational impulse in the single market.
"You can only trade if it's safe," says one veteran EU official. "That’s the mantra. It was a huge task to get member states to lift their exports and controls in 1992 [when the Single European Act came into force]. Occasionally you have a major crisis like foot-and-mouth disease, BSE, dioxins. Someone screws up in one of the member states and that causes problems EU-wide."
From 1 January, the UK will be a third country, Northern Ireland will be operating as if it is still within the Single Market.
EU and UK officials grappling with the supermarkets issue spent several weeks exploring the idea that they could use their own monitoring and tracing systems as replacement for standard export health certificates.
Some UK multiples have highly sophisticated stock management systems to track the precise movement of a food product from when and where it’s packaged to when and where it ends up.
London suggested these monitoring systems could unlock the problem in the hope that there could be fewer export health certificates and fewer checks at northern ports. It’s understood the Irish Government has also been discreetly urging the commission to explore this approach.
"If some of that information could be electronically shared with the customs people that might make the whole thing easier," one senior source said late last month. "You could have a risk-based approach and only a certain number of trucks might be stopped. But that all has to be looked at. At the moment there’s no clear sign of an easy way out of this."
Indeed, it has not been an easy sell. This week it looked like that particular trail went cold, for now at least.
The European Commission is considering this, on the strict condition that it would be used to prepare businesses to be fully compliant. There are also sensitive discussions over certain unfrozen meats, such as sausages, which are banned in the EU if they have originated in a third country.
The debate is feeding into the long-running dispute over an EU physical presence in Northern Ireland.
The UK has seen the joint committee discussions as increasingly transactional - in other words, if co-opting supermarket monitoring systems was a runner, then London would acknowledge the need for stronger EU supervision.
The commission is insisting that the more flexibility or derogations it allows on food safety, the more supervision by EU officials on the ground in Northern Ireland will be needed.
Both sides are keenly aware that when the Stormont Assembly votes to continue or discontinue the protocol in four years time, what constituents will remember will not be VAT numbers or exit summary declarations but whether or not supermarkets have had to close or shelves have been stripped.
"That’s the sort of thing that people on the ground, whatever their political persuasion, will see," says one source.
For now, the issues are ultra-sensitive given the knife-edge nature of the wider future relationship negotiations. Any grace period for Northern Ireland could prompt a demand for something similar for the rest of the UK.
While all the focus has been on Northern Ireland, what happens to all that food coming into Ireland from the UK?
Whether there is a free trade deal or not, EU safety rules will apply to British food destined for southern shelves.
The Central Statistics Office says 3.9 million tonnes of food worth €7 billion comes in from the UK as a whole each year, with over 1.7 million tonnes worth €1bn coming from Northern Ireland.
Under the protocol, the latter amount from the north will not require food safety checks, export health certificates or any other formalities.
Partly due to last year’s no-deal deadlines, Ireland has been making preparations.
Dublin Port has already built a new mixed consignment facility and has increased the numbers of Department of Agriculture and Health Service Executive staff applying the same rules that will apply in northern ports for British food.
"Again, these are mixed loads," says Gail Carroll of FSAI. "We're used to being able to bring in mixed loads - animal origin products, food, flowers, wine, dairy - in one container several times a day, several days a week."
Of course, after 1 January that just-in-time, seamless supply chain model will be no more once Brexit takes effect.
The FSAI says it has done a lot of preparatory work with the retail sector, including three recent webinars attended by over 1,000 people, as well as providing e-learning tools, advice hotlines and other supports.
However, the FSAI is worried that if a free trade agreement is reached with the UK in the coming days, then retailers might think life will go on as normal.
"We are really concerned that with all the noise around a trade agreement some businesses will stop taking action," says Ms Carroll. "Regardless of discussions on a trade agreement, the UK is going to be outside the single market SPS controls system from January 1. That’s not going to change. There will still be full third country SPS controls on goods coming from GB into Ireland."
Either way, the protocol will have profound effects on the flow of food into, and out of, and within the island of Ireland. Tesco, Marks & Spencer and Lidl are all-island chains. Sainsburys, Asda, Co-op and others are UK only. Two multiples - Musgrave Group and Dunnes Stores - are wholly Irish owned.
Northern Ireland is more heavily reliant on Britain for supermarket supplies, but the changes wrought by Brexit could cause what the industry calls supply chain displacement.
The prospect of northern supermarkets sourcing more products from the south, or the south sourcing more products from the EU, cannot be discounted.
"You’re talking about the displacement of a supply chain that usually takes between five and seven years to do properly," says Aodhán Connolly, of the Northern Ireland Retail Consortium.
Brexit may force such an upheaval over a radically shorter period.