One recent evening, a Moscow housewife standing in an endless line at her local food store lost patience and began doing what Muscovites have always done -- complaining about shortages.

Suddenly, a man stepped out of the crowd, seized her and forced the woman out of the store. She was bundled off to a local station house, where, to her astonishment, she found about 30 shoppers who also had been seized in other stores for complaining. The stunned Soviets were harangues by an official for "spreading rumors and falsehoods about Soviet life" as the 1980 Moscow Olympics approach.

When the woman left, she discovered the authorities had another unpleasant surprise: her internal passport, with its vital permission allowing her to live in Moscow, had been freshly stamped to require an official review of her conduct in six months to be sure she behaves.

The Moscow Olympics purge is gathering momentium in the Soviet capital as authorities prepare for the 1980 summer games when an estimated 300,000 foreign tourists, including about 20,000 Americans, are expected here.

The Soviets, intent upon presenting their society as an ideal unmatched elsewhere in the world, are planning Draconian measures to "cleanse the city," in the words of one person, of people the government believes are "undesirable." They are also taking steps to limit sharply Muscovites' access to Westerners in general and Americans in particular. In recent weeks, the following examples have come to light here:

Some Soviet schoolteachers are telling their students that American Olympic tourists will offer poisoned chewing gum to Soviet children. Some teachers are said to have warned that if not poisoned, the chewing gum will contain bacteria to spread disease and infection. The students have been warned sternly to avoid any contact with foreign tourists and athletes.

Directors of factories and enterprises in Moscow have been ordered by local Communist Party officials to compile lists by April 1 of drunkards, psychotics, disordely persons and jews who have applied to emigrate so the party can decide who will be sent out of the city during the games, which open July 19 and close Aug. 2.

Schools ar requiring students to fill out forms specifying where they will spend the months of June, July, and August. Those who plan to be in the city then will be sent to summer camps away from Moscow.

Human rights activists and dissidents said they believe the KGB secret police will institute tight surveillance and, possibly, house arrest of certain well-known dissident figures, similar to the house arrests made during President Nixon's visit here in 1974.

Adult vacation spas and rest homes and children's summer camps throughout the country apparently are being prepared to handle Muscovites who are to be sent out of the city during the games.

Beyond the usual anti-Western, anti-capitalist propaganda attacks, there is nothing to be seen here in the official press of these measures. But reliable, unofficial sources tell of these pre-Olympic preparations. They srdonically use the Russian word chistka or "cleaning" to describe what is going on. It is a word with dread connotations for Soviets, because it is the term used in designating the Stalinist purges that swept millions to their deaths in slave labor camps beginning in the late 1930s.

The 1977 Soviet constitution, which President Leonid Brezhnev likes to hail as one of the supreme achievements of his 15-year rule, guarantees a place to live for all Soviet citizens. But where a Soviet lives is controlled tightly by the state through extensive bureaucratic checks on individual freedom that center on the internal passport, which every Soviet is required to carry from the age of 16.

Thus, the threat to the housewife -- likely to be repeated many times between now and the summer -- falls into a gray administration area where internal Soviet security organizations exercise virtualy unlimited power.

The same gray area seems to cover the lists of "undesirables" now being drawn up. According to knowledgeable sources, the lists are to include as "disorderly persons" any citizen who has had at least two court appearances, of any kind, whether or not the incidents resulted in acquittal or dismissal. The category of "psychotics" is thought to include not only those who may have spent time in mental institutions or been treated for mental illness, but others whom officials deem unreliable.

A further category will be used to list "suspicious" or worrisome citizens who do not fall cleanly into the other definations. The potential numbers could thus reach into the tens of thousands.

It is being said here that virtually every repository for Soviets -- jails, prisons, psychiatric wards, rest homes, sanitariums, and summer camps -- in the moscow area will be specialy cleared and readied solely for Muscovites sent from the city. The undesirables will be given vacations and if space in rest homes runs out, others will be dispatched on official business, trips elsewhere in Soviet Union.

It is also thought that measures are being organized to bar the city to any provincial Soviets without specific travel permession to enter Moscow, either by establishing a new pass system or simply shutting down incoming commuter bus and train service. About a million peasants and other country folk are estimated to be in Moscow any day during the summer months, in search of meat and domestic goods unavailable in the countryside.

The Soviets used similar measures once before, during the 1957 International Youth Festival here during Nikita Khrushchev's leadership.