And so Mr. Trump came to Warsaw, confirmed his commitment to NATO’s Article 5 on collective defense, and promised contracts for the sale of Patriot missiles and natural gas to Poland. Mr. Kaczynski’s party bused in cheering crowds, and both sides concluded — with good reason — that the visit was a success.

Law and Justice’s standing in the polls improved; the latest, carried out before the vote on judicial reform, showed 38 percent support for the party and only 19 percent for Civic Platform, the largest opposition party.

Mr. Trump’s visit coincided with the judicial legislation, which was already awaiting a vote in the Sejm, the lower house. But shortly before his arrival, the bills were abruptly withdrawn.

Once the poll numbers and press accolades began to pour in, though, the party put the bills back in action, and added a third, to recall the judges of the Supreme Court so that their successors could be chosen by the Sejm. Because the Supreme Court confirms the results of parliamentary and presidential elections, the bill would have given Law and Justice control not only over the courts, but also over electoral results (this was one of the bills that Mr. Duda vetoed).

In short, for the price of some applause, Mr. Trump gave Mr. Kaczynski the cover to carry out a coup. And what has the United States done since? The State Department issued a dry statement formulated not to offend the Polish authorities (“We urge all sides to ensure that any judicial reform does not violate Poland’s Constitution”).

It’s unlikely that Mr. Trump meant to condone Mr. Kaczynski’s power grab. But by not using his visit to press the Law and Justice leader to respect democracy, Mr. Trump gave his implicit imprimatur to a renewed campaign to get the bills into law. And while Mr. Duda showed political independence in vetoing two of the bills, he has otherwise been a faithful ally of Mr. Kaczynski. We’ll see if his new drafts will really run counter to Mr. Kaczynski’s, or only extend Mr. Duda’s own influence over the courts at the expense of Law and Justice.

The ultimate responsibility lies with Poles, and it is they who will have to respond — as they have done admirably over the last few weeks, staging big protests that most likely pressured Mr. Duda into his vetoes. But until very recently, they wouldn’t have had to go it alone: This is precisely the sort of situation in which previous American presidents could and would have used their country’s prestige to push for freedom and democracy. Instead, beyond the cheers of manufactured masses, all the Polish people hear from the White House is silence.