Gene Epstein of Barron’s doesn’t like the long-term outlook for the federal budget.

In 2008, as now, the agency warned that “Growth in spending—particularly for Medicare and Medicaid–is likely to exceed growth in federal revenues,” and that unless there were dramatic hikes in taxes and cuts in spending, debt and deficits would rise to “unsustainable levels.”

But the study argued that the following 10 years offered plenty of breathing space, because Medicaid and Medicare costs wouldn’t begin to explode until baby boomer retirements reached critical mass. In fact, it predicted, the nation’s fiscal health would noticeably improve. By 2015, for example, the CBO foresaw a $111 billion surplus, instead of the projected $486 billion deficit. Similarly, federal debt held by the public as a share of gross domestic product— 39.3% in 2008—would fall to 28%. Instead, it has soared to a 65-year high of 74%.

THE CBO GOT THINGS SO WRONG, of course, because it didn’t anticipate the Great Recession of 2007-09 or the sluggish expansion that would follow. In the study released last week, the agency also projects that the next 10 years will be the relative calm before the storm. Deficits will rise faster than growth in GDP, but the federal debt-to-GDP ratio will have climbed by just four percentage points by 2025, to 78% from the current 74%.

Thereafter, however, the costs of supporting the retired baby boomers will help propel that 78% to 107% by 2040 (per the “Extended Baseline Scenario with Macroeconomic Feedback”), or even as high as 175% (based on one version of its “Extended Alternative Fiscal Scenario”). Either way, with the rise in the debt-GDP ratio continuing after 2040, the CBO notes that government profligacy could trigger a fiscal crisis, with major damage to the private economy.

You could argue that if the agency’s 2008 forecast could err so far on the side of optimism, it might be too pessimistic now. But there are plenty of negative wild cards. Unforeseen military challenges might boost defense spending; the cost of servicing the debt might surge unexpectedly if interest rates jump; future presidents and Congresses might launch new programs and break the discretionary spending caps, and, of course, there might be another serious recession.