When Governor George Pataki vetoed hundreds of millions in state spending a month ago, down-in-the-mouth liberals sought solace at the door of Pataki’s potential Democratic opponent New York City Council Speaker Peter Vallone.

On Friday, that strategy paid off as Vallone restored millions in cuts to Legal Aid and Legal Services, community groups and a nonprofit that provides free legal help to poor tenants. Vallone even added $2 million to pay for 78 new housing inspectors.

But even the beneficiaries of the council’s largesse know the victory could be fleeting: Mayor Rudolph Giuliani plans to freeze all of the city’s funding if Vallone presses his plan. That is why the most important thing to come out Vallone’s pre-emptive budget is a subtle, but potentially damaging counterattack against Giuliani.

For the first time in recent history, the council used its power to attach special provisions to each spending item. These provisions could make it impossible for Giuliani to spend a penny of agency funds if he fails to follow council policy directives. Many of the provisions require the mayor to disclose statistics his administration has been reluctant to release.

At a Friday press conference, Giuliani said he thought Vallone’s maneuver was potentially illegal–a reference to a bitter lawsuit that many budget watchers expect will paralyze City Hall for much of the summer. “Unfortunately all of this might end up in court,” said Steve Banks, Deputy Attorney-in-Charge of Legal Aid’s Civil Division. “The council should prevail, but the lawsuit process is what we’re looking at.”

Perhaps the most significant clause in the bill is a requirement that the city shift its homeless services money from large, emergency-type shelters into smaller permanent housing. The rider mandates that the city create 3,500 new units of permanent homeless housing over the next two years.

The council’s spending bill also requires the city to issue statistics on lead contamination and abatement efforts, the housing department’s anti-abandonment strategy and information on Medicaid managed care. There is also a provision barring the city Department of Juvenile Justice from housing teens on its prison barge. Other noteworthy council add-ons include:

— $263,000 for the City-Wide Task Force on Housing Court, which gives free advice to unrepresented tenants in housing court.

— $2.8 million in restorations to Legal Services chapters and the Legal Aid Society.

— An additional $403,840 in a restoration of free lead testing for children and the budget bill reportedly contains regulatory language that would require the city to be more forthcoming with its lead contamination statistics.

— Restoration of the Community Training and Resource Center’s $200,000 program to train landlords cited by the city for code violations.