President Donald Trump’s take on trade has always been a cornerstone of his political brand. He has argued passionately and convincingly that elites among both Republicans and Democrats supported international trade pacts that, even as they boosted corporate profits and cut prices for consumers, cost the United States good jobs and depressed the wages of the ones that remained.

The North American Free Trade Agreement in effect among the United States, Mexico and Canada since 1994 was his most frequent target. His promises to tear it up were among his biggest hits on the stump.

But now, wisely, Trump has agreed to a deal that rebrands NAFTA as the United States-Mexico-Canada Agreement and improves several of its provisions but does not do wholesale damage to our nation’s most crucial trading partnerships.

One key provision of the new version, for instance, requires that an increasing percentage of parts in cars imported to the United States tariff-free from Mexico and Canada be made by workers earning at least $16 an hour. That could serve two positive purposes — shifting more manufacturing jobs back to the United States, or providing Mexican workers with incomes that would increase prosperity and stability there. But that provision also illustrates how important it is that the United States join strong trade agreements worldwide, such as a well-vetted Trans-Pacific Partnership. It does no good to force a $16 hourly wage in Mexico if companies shift production to $6-per-hour workers in Asia.

There still are details in this dense deal that need to be analyzed and which Congress must vet. But one clear advantage is the certainty it brings. The flow of trade across North America is fantastically complicated and important, and many products include parts crafted in all three countries. Trump’s bellicose tirades about ending NAFTA entirely at times roiled stock markets and left companies unsure how or whether to invest in new production. Now they know the rules under which they will operate, rules that have been tweaked in many areas but not upended in any.

The deal even includes wins for Trump’s home state, including on Long Island: Canada’s markets will be increasingly open to dairy products produced upstate and wine flowing from Suffolk County. — The editorial board