Buffeted on all sides, Gorbachev consolidates his powers to save the union  even if it means becoming the dictator Shevardnadze warned about

What Mikhail Gorbachev wants, whether it is a policy change or an official appointment, Mikhail Gorbachev usually gets. Through nearly six years in power, he has put together an almost unbroken winning streak at contentious parliamentary sessions and Communist Party meetings. He did it again last week in the Congress of People's Deputies  taking some nasty thumps along the way  when he managed to ram through another political reorganization that further strengthens his hand. But he acknowledged this hard-won victory with a tone of finality and a warning. "I intend to act as President," he said, gathering up his papers on the final day of the session. "So don't be surprised."

Gorbachev has accumulated unprecedented powers  on paper. In practice, he is finding it increasingly difficult to rule. Only a week earlier Foreign Minister Eduard Shevardnadze had shocked everyone by announcing his resignation in protest against what he called an approaching dictatorship. Gorbachev then proceeded to behave as if determined to lend substance to that prediction. He pushed through constitutional amendments last week that subordinate all government departments and policies to the will of the President, then forced the reluctant Deputies to accept his choice of a colorless communist loyalist as the country's first Vice President.

The struggle over the appointment of Gennadi Yanayev to the No. 2 spot looked at first like one of Gorbachev's rare defeats. Liberals were appalled, and even the right wing seemed stunned by Gorbachev's selection of an unimaginative political nobody from the Communist Party hierarchy as his principal deputy. Although more than half of the 2,239 registered Deputies belong to the Communist bloc or the ultraconservative Soyuz (Union) faction, Yanayev came up 31 votes short.

Angrily, Gorbachev stumped to the rostrum and demanded another vote. Even he had struggled to find something good to say about Yanayev, managing only to call him a "mature politician, a man of firm principles." Gorbachev was determined to have someone he could count on for absolute loyalty. "I want someone beside me I can trust," he said. On the second ballot, Yanayev was approved by a margin of 117 ayes.

But what did Gorbachev gain? For all his organizational triumphs, the President is now flanked by a party hack and depends increasingly on the security forces for support. He has lost nearly all the front line of perestroika, the allies who stood beside him as he sought to bring reform to the U.S.S.R. Shevardnadze has quit. Alexander Yakovlev, one of reform's philosophical fathers, no longer has an official post. Vadim Bakatin, the moderate, cautious Interior Minister, was forced out, replaced by a KGB man and a general as his deputy. And last week Gorbachev announced that the last of the old team, Prime Minister Nikolai Ryzhkov, 61, had been hospitalized after suffering a heart attack  some say brought on by all the opposition sniping.

Yanayev's speech was indicative of the political ground he and Gorbachev now occupy. "I am a communist to the depths of my soul," he said after his nomination. "I will fight political confusion and nihilism." He and Gorbachev, he said, "want no dictatorship, only respect for law."

That is a slippery distinction Soviet leaders are making more and more often, implying that enforcing order is only a matter of police work. KGB chief Vladimir Kryuchkov staggered the West two weeks ago with a paranoid speech that sounded as if it had been stored in a freezer since the depths of the cold war. He tried to repair the damage at a press conference but again claimed that a crackdown might be therapeutic. "If our President does introduce extraordinary measures, it will not mean going back to dictatorship," he said. "It will just mean restoring the order that everyone craves."

As for extraordinary measures, since last March, Gorbachev has had full power to declare martial law in any trouble spot he chooses and to rule by presidential decree. Last week's new amendments created a Cabinet of Ministers directly under his control rather than the Prime Minister's. They also put him in the chair of two new policymaking bodies  the Federation Council, made up of key officials from the republics; and the Security Council, which includes heads of the military and police.