If you liked President Trump's deal with Sen. Chuck Schumer and Rep. Nancy Pelosi on immigration, you'll love the healthcare deal he'll cut with them soon.

Schumer and Pelosi, the top two Democratic leaders in Congress, seemed quite pleased with the deal, of course. So pleased, in fact, that they issued a celebratory joint statement about its result. In order to secure legal status for those who illegally immigrated as children, Trump had supposedly given away his border wall -- the one that he had talked about and promised non-stop since mid-2015 -- in an impromptu negotiation.

"We agreed to enshrine the protections of DACA into law quickly," Pelosi and Schumer wrote, "and to work out a package of border security, excluding the wall, that's acceptable to both sides."

Within hours, the White House denied that such a deal had been made, before later seeming to confirm the reports of a deal. In a Thursday press conference, House Speaker Paul Ryan, R-Wis., pushed back against the idea of any such deal.

On the surface, Ryan reinforced the White House message that no such deal existed at all. But he added what looks like a veiled comment about Trump's evident propensity to make such deals: "I think the president understands he has to work with the congressional majorities to get any kind of legislative solution," Ryan told reporters.

Whichever version of events you want to believe, it is by now apparent that Trump is indeed willing to cut deals with the Democrats that upend congressional Republicans' plans. This wouldn't be the first time he didn't behave as a team player, and it won't be the last.

And so Republicans in Congress need to actually pass legislation, or they can bet on even more Donald-Chuck-Nancy deals.

In recent decades and under both parties, Congresses controlled by the president's party have behaved like employees of the president. They protect him from any serious oversight and help him avoid politically agonizing decisions over bill-signings and vetoes.

It should not be this way, and Republicans cannot afford to make it this way now. Congress is a coequal branch of government, and the GOP majority needs to assert its own agency and its independence.

The constitutional authority of the Congress affords the Republican majority both a stick and a carrot that it can use in dealing with Trump.

The stick is what Ryan hinted at during his Thursday presser. A majority in Congress is required to ratify any legislative deal that Trump makes with Democrats, and Democrats alone cannot form a majority in either the House or the Senate. If all Republicans -- from Tuesday-Groupers to Freedom-Caucusers -- agree in advance that they will stick together out of principle in preventing presidential end-arounds of their authority, it will discourage such behavior on Trump's part.

But of course, the stick alone will not be enough. If deployed without the carrot, it will simply lead to gridlock and more government shutdowns, to say nothing of very hard feelings between Trump and Congress.

And so the other thing the GOP caucus must do is to reward Trump's efforts by producing legislative accomplishments for which he can take at least partial credit. Republicans must start acting like a functional party and engage in the politically messy task of making laws through the committee process. If they can manage this and put imperfect but better-than-nothing legislation on Trump's desk, they will at least stop giving him reasons to do deals with the Democrats.

Absent an Obamacare replacement bill from the GOP, Trump will have no problem cutting a deal with Democrats to further expand Medicare or Medicaid. If Republicans don't get a tax reform to Trump's desk, Trump will cut a tax deal with Democrats that includes plenty of tax hikes. The man isn't a conservative, and so he has no problem signing big-government bills into law.

No one is making excuses for Trump here. He is not being "forced" by Republican failures to go over to the Democrats. But given that he is evidently willing to indulge this temptation, Republicans should at least help him avoid the near occasions of sin.

The 2016 election result was shocking not only because of Trump's unexpected win of the presidency but also because of Republicans' surprising retention of Congress. But it's not enough for them to smile and bask in a team victory. Republicans were elected to produce results. Part of that means keeping Trump on the straight and narrow, and away from alliances with Democratic leaders who are only striving to weaken and undermine him.