The immigration debate has festered for years. The nation’s unwillingness to resolve it has been shameful. Now, President Donald Trump has ripped the scab off this wound with a tough policy against those here illegally that should drive a comprehensive solution to our broken system.

What happens next will be a test for the nation — for its legal and political systems, law enforcement, economy, communities and most especially its values. This will play out for a long time, and it is unclear whether taxpayers will be willing to spend billions of dollars to deport those workers who are a key part of our economy. For now, Trump has succeeded in conveying his clear message: We don’t want you here.

advertisement | advertise on newsday

Some immigrants here without proper documentation might decide to leave, others are likely to withdraw deeper into the shadows. And those who were thinking of coming here might decide to stay put.

Unfortunately, he also is creating fear with dissonant information from his administration. The official line is that there will be no mass deportations and, instead, criminals are the priority for expulsion. But Trump has widened the net of those at risk to include anyone who has abused a public-benefits program such as food stamps. There will be no deportation force, officials say, but Trump wants to hire 10,000 new Immigration and Customs Enforcement agents and 5,000 Border Patrol agents and build deportation centers. Trump will deal with people brought here as children “with heart,” he says, without explaining what the guidelines will be for those known as Dreamers.

Some Americans want to kick out each and every one of the estimated 11 million people here without legal status. Many are more willing to find a comprehensive and compassionate solution. Let’s be clear, violent criminals and those with histories of violating the law must be sent back. But many immigrants are long-time law-abiding residents with children who are citizens, and they work and pay taxes and contribute to their communities. How do we strike a balance?

The tricky calculus has many variables, and many players will shape the solution. Congress must decide whether to pay to hire thousands of ICE agents and how quickly it can be done. There are 2,000 Border Patrol vacancies because of the difficulty in finding agents who meet the agency’s standards. The courts will weigh in on issues like due process; one measure unlikely to pass muster subjects to deportation anyone whose acts could result in a “chargeable criminal offense.” That is a very broad category. Multiple layers of government — states, cities, counties, towns, villages, sheriffs and police — must decide their degree of cooperation with federal agents. They should be wary of apprehending anyone unless presented with a judicial warrant authorizing the arrest.

advertisement | advertise on newsday

Four years ago, nasty partisanship derailed a Senate bill that offered a solution for dealing with those who are here illegally but are integral members of our communities. Trump is forcing us to finally solve this problem. It’s not enough to say we are a nation of laws, because we also are a nation of values. How we respond will define us.— The editorial board