WARSAW -- The independent trade union Solidarity came in from seven years in the political cold Wednesday, joining in a historic agreement with Poland's Communist government that paves the way for the first free elections here since World War II and ensures Solidarity's reinstatement as a legal union. The agreement concluded nine weeks of grueling negotiations between Solidarity and the government and capped a turbulent year in Polish political life that began with a series of strikes last April, which led to Solidarity's return as an active force in the nation's affairs.

"I think the round-table talks can become the beginning of the road to democracy and a free Poland," Solidarity leader Lech Walesa said, "and hence, we look with boldness and hope into the future."

'A Social Contract' The leader of the government delegation, Minister of Internal Affairs Czeslaw Kiszczak, called the accord "a social contract." He added: "We declare the will to fulfill honestly the agreement that we symbolically conclude today." In Washington, White House Press Secretary Marlin Fitzwater called the accord "a great day for the Polish people and for freedom." Fitzwater said President Bush is "very pleased by the accords that have started Poland on this new path toward reconciliation."

Asked whether the United States would now be willing to expand trade and commerce with Poland, Fitzwater replied that "now that we have these accords, we are considering issues or moves that might be taken which would, in various ways, foster economic development and help move that process forward." "I don't have a timetable," he said in response to another question, "but . . . hopefully within the not-too-distant future, we'll have something to announce."

Snags Delay Signing The signing of the document was delayed for about three hours by last-minute procedural wrangling with the official trade union federation OPZZ, which declined to join in a wage indexing plan to combat the effects of inflation. Negotiators for the government and Solidarity, however, had already agreed on the issue, and the signing ceremonies finally resumed after the OPZZ chief, Alfred Miodowicz, was allowed to break the planned sequence of speakers to warn against economic measures that "break the bones of the workers."

The agreement covers three major areas--trade unions, politics and economic reform--that put Poland once again in the forefront of change in the Soviet Bloc.

Trade unions, including Solidarity, will be legalized by amending the legislation that banned Solidarity in 1982. The revised law is expected to be passed by the Sejm, the Polish Parliament, on Friday, and Solidarity could be registered officially within days.

Political reforms include a new election law for the Sejm and for the creation of a 100-seat Senate, whose members will be chosen in free and fully competitive elections. Elections are expected to be held in June.

A new office of president is to be created, and the first holder will be the Communist Party leader, Gen. Wojciech Jaruzelski. The president will have broad powers to initiate legislation and dissolve both houses of Parliament. He also will be commander of the nation's military forces.

All Senate Seats Open According to the plan worked out by Solidarity and the government, 65% of the seats in the Sejm will go to the Communist Party and its allied parties, with the other 35% open to non-party candidates. All of the seats in the new Senate will be open to fully competitive elections. The Senate will have power to veto legislation but not to initiate it. The Sejm will be able to override a Senate veto with a 65% majority. While the Senate's powers are limited primarily to the veto, political observers believe that it will have a significant moral voice since it will be the first freely elected parliamentary body in the East Bloc. On economic reform, the government and Solidarity both signed documents stressing the need to steer Poland in the direction of a market-oriented economy, away from the centrally planned system that has helped keep the nation in financial crisis for the last 20 years. Although agreement on concrete details was elusive, Solidarity and the government agreed on a wage indexing scheme to compensate workers for up to 80% of price increases. Inflation in Poland exceeded 60% last year, and economists predict an even higher rate this year. Order on Wage Demands Solidarity and the government believe that the wage indexing plan will impose some order on workers' wage demands and at least hold inflation to a predictable rate. While the talks on these three major areas were going on, a series of "sub-table" discussions were concluded in eight other areas, some of them resulting in agreements that could be far reaching. The subjects under discussion at the sub-tables were agriculture, housing, environment, health, mass media, mining, youth and legal reform. The agreements on these issues will have to be implemented by legislative action, some of which may require lengthy debate and further political struggle. As a result of the agreement on the mass media, Solidarity will be given immediate permission to publish a weekly newspaper, with daily newspapers to follow. Solidarity will also be allowed to publish regional weekly newspapers. The union failed in its bid for an independent radio and television station, but it will be allowed a weekly 30-minute television program. In addition, local television stations will have to provide Solidarity with five minutes of time daily. Farmers Can Sell to All In the agreement on agriculture, farmers will be allowed to buy materials and supplies from any source and sell products to any buyer, thereby freeing them from selling only to state agencies. Major restrictions on the sale and purchase of farmland are to be removed, allowing farmers to accumulate as much land as they can afford to buy. Rural government units will be allowed to set up their own development projects, financed and built under local control. In youth affairs, it was agreed that "free, unrestricted formation of youth associations" is to be allowed and that youth organizations should have the right to publish and meet freely. In the economically vital area of coal mining, both sides agreed to a five-day week for miners, allowing miners to work a sixth day on a voluntary basis. The two sides also agreed, in principle, to the closing of a number of outdated and inefficient mines and to redeploy miners to other sites. In health, environment and housing, all sides agreed that present conditions in these areas are abysmal and need urgent attention. Unresolved Questions There were unresolved questions in each field. For example, the two sides were unable to reach agreement on the issue of nuclear power. Solidarity wants construction halted on two nuclear power plants. The government, which says it wants to end its dependence on coal, is insisting on going ahead with the development of nuclear power. While the round-table agreements were taken by some observers as a historic turning point for Poland, the road ahead for the nation remains unclear, and potential trouble spots are evident. At the moment, the agreement is a triumph for Walesa, who in August called a halt to last year's second wave of strikes by accepting a government offer to open negotiations. Many of the union's hard-liners, suspecting government duplicity, advised against it. At a meeting of the National Executive Commission of Solidarity before he signed the accord, Walesa told his colleagues that the union has achieved its main goal--legalization--and that it could fight for further reforms after it is registered and organized. "Before Poland and all the world, I am saying that we have achieved what we promised to do," he said. Solidarity was born out of August, 1980, protests at the Lenin Shipyard in Gdansk, becoming the Eastern Bloc's first independent trade union. By mid-1981, its membership was estimated at 10 million workers, or about 50% of Poland's labor force. It was officially suspended on Dec. 13, 1981, after the imposition of martial law, and was banned on Oct. 8, 1982. After it was outlawed, many of Solidarity's leaders went underground. By 1985, about two-thirds of the labor force had joined the official OPZZ, but the leadership continued to work for an independ-ent trade union and in opposition to many government policies. In November, 1988, the leadership campaigned against political and economic reforms that the regime proposed in a nationwide referendum. In the current negotiations, the Communist Party has had its own difficulties with hard-liners, some of whom continue to resist partnership with an organization dedicated to ending the Communist monopoly on power. A potential role as spoiler could be played by the OPZZ, the official union federation, which has performed a surprising turnabout and remains the lone holdout against a government-Solidarity alliance that, uneasy as it is, seemed impossible a year ago. If the OPZZ can muster sufficient strength from its 5 million members, it could start its own round of strikes to protest price rises and present a challenge to Solidarity. Solidarity faces another challenge in the coming elections, for which it is by its own assessment poorly prepared. Some union activists will certainly stand for seats in the new national assembly, and the union will face the possibility that its moderate-leaning intellectuals--its driving force in recent years--will abandon their role in the union. In that case, the affairs of the union may well pass to a younger and more radical generation of activists. No Real Guarantee Most important for the union, there is no real guarantee that the economic reforms, including the wage indexing plan that it has endorsed, will bring an end to the economic crisis here. If hardships continue, with no sign of progress, Solidarity could well be blamed along with the government. This was the key to the risky bargain--the government gambling on the neutralization of Solidarity as an opposition force, and Solidarity gambling on setting in motion a set of changes that would neutralize the Communists. With the ink now drying on the agreement, the game has only begun. BREAKTHROUGH IN WARSAW The package of agreements signed Wednesday by the Solidarity trade union and the Polish government includes these main points: UNIONS: Free trade unions, including Solidarity and Rural Solidarity, a farmers' union, will be legalized by amending existing trade union laws. The necessary legislation is expected to be approved by the Polish Parliament on Friday, and registration of the unions should quickly follow. Workers fired for union activities since martial law was declared in 1981 will be reinstated. ELECTIONS: Balloting will be held in June to choose members of a newly organized Sejm, or Parliament, and a newly created Senate. The 100-member Senate will be freely elected and open to those who can submit a petition with the signatures of 3,000 voters. In the Sejm, 35% of the seats will be openly contested. The other 65% of the seats will be apportioned to the government coalition and other already existing parties. The Senate will not be empowered to initiate legislation but will be able to veto laws passed by the Sejm, which will need a 65% majority to override the veto. PRESIDENT: An office of president, with broad powers and a six-year term, will be created. Members of the Sejm and Senate will choose the president. The post is to go first to the present Communist Party leader, Gen. Wojciech Jaruzelski. ECONOMICS: The pact stresses the need to move toward a market-oriented economy and away from the current centrally planned system. To combat the effects of inflation, an indexing plan will be set up, under which wage increases would cover up to 80% of price increases. MEDIA: The opposition will be allowed a daily national newspaper with 500,000 circulation, 30 minutes a week on state television and one hour on radio. Solidarity will be permitted regional weekly newspapers, and censorship will be eased.