China generated a trade surplus topping one trillion dollars in the first ten months of the year, propelled by booming artificial intelligence exports. The strong foreign sales offset deep domestic economic weakness, but the swelling surplus threatens to inflame trade tensions with Western partners.