Polish Communist leader Stanislaw Kania today faced a storm of complaints including demands for punishment of former officials when he met rank-and-file party members from the Lenin shipyard in Gdansk, birthplace of the independent Solidarity trade union movement.

The eagerly awaited meeting reflected the growing influence of grassroots party organizations in shaping both policy in Poland and the party's ties with Solidarity. A big majority of the 3,000 party members at the shipyard also belong to the union.

The party's rank and file is now effectively setting the pace -- and the leadership has little choice but to go along with many of the proposals hammered out by local discussion groups. Kania appears to realize that the only way of keeping his 3 million-strong party united is to swim with the tide.

Kania's visit to Gdansk coincided with press reports suggesting that former premier Piotr Jaroszewicz could be put on trial.

The party Central Committee last week instructed members of the ruling Politburo to meet with party members in major factories as soon as possible -- the implication being that they were out of touch with party opinion. These meetings have provided ordinary Communists a chance to voice their complaints and force the party leaders to take a clear stand on reforms being demanded both by Solidarity and within the party itself.

One result of the series of meetings has been to illustrate the overwhelming consensus within the party that there is a need for a consistent and conciliatory policy toward Solidarity.

"We can't allow this country to be run by small groups," said Jan Labecki, the party secretary at the shipyard. "We'll fight them no matter where they come from," he said in an apparent criticism of hard-liners in both the party and Solidarity.

Other workers complained of food shortages, lack of objective information in the official news media, and the delay in holding a Communist Party congress. t

National television said the meeting lasted more than five hours, with more than two dozen workers taking the opportunity to speak. Polish radio broadcast their remarks.

Kania's dilemma is illustrated most sharply by the demand, voiced at many meetings, for "the guilty to be punished." He is anxious to avoid a witchhunt or any dramatic steps that could alarm Poland's Soviet Bloc neighbors. At the same time he must appear responsive to the opinions of increasingly restless party members.

The highly unpopular Jaroszewicz has already been stripped of his party membership for "mistakes" and "an arrogant attitude" during his nine-year premiership. In a newspaper interview published today, a local Communist Party official, Edward Symanski, was quoted as saying that the chief prosecutor's office had been conducting "preparatory proceedings in relation to the responsibility of Piotr Jaroszewicz" -- in other words, a preliminary investigation to see if criminal charges should be made.

The case of the former party leader Edward Gierek, expelled from the ruling Politburo Dec. 2 under fire for mishandling the labor crisis, is somewhat different. Despite demands for his expulsion, he remains a member of the party. According to Szymanski, the prosecutor's office believes it is now necessary to "explain Gierek's responsibility for the decisions he took."

The Polish Communist Party has been in ferment for several months, with local organizations busy drafting their own program for an extraordinary party congress due to be held in July. But the recent worker-government confrontation over alleged police violence at Bydgoszcz could mark a turning point in the struggle within the party.

According to some estimates, as many as 90 percent of ordinary party members openly defied the Politburo's instructions and joined in a four-hour nationwide "warning strike" organized by Solidarity to protest the incident. The message to the leadership: any showdown with the union would do irreparable damage to the party itself.

This in turn has fueled speculation about the possibility of a Soviet intervention on the theory that, in Moscow's eyes, a Communist Party that no longer accepts orders from the top must be in a state of disintegration.

Most Polish political analysts, however, indicate that to put the issue of invasion in these terms is a drastic oversimplification. They agree that Poland's room for maneuver is becoming increasingly limited but deny that there is any fixed barrier which -- when shattered -- inevitably would lead to intervention.

A senior adviser to Solidarity remarked: "The Russians think in political terms, not ideological ones. They don't say to themselves, 'The Polish party is no longer in control of events so therefore we must invade.' Instead, they ask, 'How can we best accomplish our overall policy objectives given the various means at our disposal?'"

He added: "At each stage, they make a fine political calculation of the probability of various future scenarios. Many factors are taken into account in this equation. In the meantime, they keep all their options open."

According to this logic, the Kremlin must now be weighing how to restore the authority of the Polish Communist Party. But, even looking at the problem from their point of view, it is by no means certain that brute force is the best method of reaching their goal.

Similar calculations are being made by leaders of the Polish party. So far, with only occasional hesitations, they have rejected the idea of a final confrontation with the work force as simply too risky.

On the other hand, up until now Poland's ruling establishment has lacked any consistent attitude toward Solidarity. While all officials proclaim the virtues of "socialist renewal" in public, some sabotage the process in private.

A prominent Polish sociologist commented: "It's wrong to see this simply in terms of conservatives versus liberals or hard-liners versus reformists. It's a sociopsychological problem. Many people in the party apparatus are very reluctant to change the habits of a lifetime."

He explained that, after using authoritarian methods for so long, many officials simply could not conceive of other ways of running the country. In order for reforms to succeed, there had to be changes in the organization and structures of governing institutions -- and in the mentality of their personnel.

This is what has been happening, slowly and painfully, over the last few months. It is a process that ordinary party members are trying to accelerate. They are insisting on secret elections to party posts with a choice of candidates, controls over the leadership by democratically elected bodies, and the implementation of a program of reforms capable of restoring the party's authority by winning popular confidence.