The boom in artificial-intelligence investment is undoubtedly boosting both the US stock market and the broader economy right now. But what about the longer term? Will AI be a big net positive, delivering prosperity and solving the nation’s fiscal problems?