The euphoria over the state's first substantial budget surplus in years has camouflaged the specter of a massive tax increase or severe spending cuts in the post-election 1989 legislative session.

Although the state treasury opened this month with an unexpected windfall of nearly $12 million, current demands will evaporate the extra cash before lawmakers even start making decisions on the new budget they will write this winter.A feared $4 million shortage in financing for Medicaid and Medicare benefits, $2 million to open the new state prison and reimburse counties for holding state inmates until cell space is available, and repayment of $2.5 million siphoned from other state accounts, along with nearly $3 million just to put the current budget in balance, will wipe out the surplus.

So even with the state's economic growth as robust as recent statistics show, new Legislative Budget Office projections for meeting just basic state spending needs in the 1990 budget year show revenue from the current tax structure falling $40 million short.

The gap would grow by tens of millions of dollars more if lawmakers approve new spending programs as they usually do and make the kind of financial commitment to schools that Senate President pro tem James Risch, R-Boise, has suggested.

With the lucrative sales tax already at what most believe is a maximum level and GOP leaders hanging firmly onto a $15 million investment credit business tax break, the revenue gap could become politically explosive, both during the fall campaign and the session after it.

It can create the kind of situation that could either paralyze the Legislature because lawmakers fear public retribution for another major tax increase or open the gates for major tax revisions like those contemplated by some legislators when a special interim committee on the state's tax structure went to work this summer.

When the prospect for a revenue surplus surfaced two months ago, a number of officials, including Republican House Speaker Tom Boyd and Democratic Gov. Cecil Andrus, suggested caution before spending any windfall because of the budget crisis looming in 1990.

After more than a month of debate over whether the cash should be quickly given to education, an area Andrus and others believed was shortchanged last winter, the decision was effectively made to hold on to the surplus at least for a while to see how the economy develops.

"Opinions are mixed as to whether the surplus reflects a stronger overall revenue trend or is simply the product of one-time anomalies," legislative budget analyst Jeff Youtz said in detailing the early budget outlook.

But the most recent job figures finally putting total employment back at the levels of the 1979 peak and federal statistics showing Idaho personal income growing more rapidly than almost any other state's suggest much more of the surplus may have been founded on economic expansion than on one-time quirks.

Andrus administration economists have begun reworking their revenue estimates for the present budget year with an eye toward raising them because the expansion has been much stronger than they foresaw just six months ago. The current administration estimate for 1989 is $7.7 million below the unadjusted legislative projection of $673.3 million.

And some analysts now believe underlying revenue growth, which has run at 2 percent a year or less over the past few years, could actually reach a level of 4 percent during the 1990 spending year if the expansion continues.

Youtz used that hypothetical growth rate in putting together an initial budget outlook this month. But even at a growth rate that would have been considered laughable just a year ago, the current tax structure would generate less than $695 million.

That would only be about $9 million more than lawmakers will spend this year in a budget being financed by $16 million in one-time revenue sources like loans from other government funds, temporary tax hikes, past surpluses and bookkeeping gimmicks that only accelerate tax payments, not increase them.

At the same time, this year's spending demands will not decline, and Youtz's analysis showed it will take $738 million just to keep government operating at present levels with a modest 3.5 percent inflation adjustment and 4 percent pay hikes for teachers and state workers.

"Concurrently several large spending issues will surface, including costs for the new prison facilities, the new state accounting system and several Health and Welfare issues," Youtz said.

At $738 million, the budget would provide a $24.5 million increase for public schools, boosting state aid to education to $377.5 million.

That would be nearly twice the increase in state aid that education got in the current budget.