Only the sourest of cynics could fail to be heartened by what has transpired here this week. The capital has been given a badly needed lift and new reason for hope about the future. Neither could come at a better moment.

Until the Soviet-American Christmas-season summit dramatically changed the atmosphere, Washington was sullen, filled with increasingly rancorous political accusations. A sense of stalemate was pervasive. Legitimate reasons for mounting frustration and foreboding included:

The Wall Street crash. The budget-deficit gridlock. Lingering aftereffects of the divisive Iran-contra scandal. Diminution of a once-powerful and immensely popular president. Increased sniping from critics on Wall Street and allies abroad about U.S. economic and foreign policies. Uncertainty about next year's presidential election and the outlook for both political parties. Inability to reach consensus on many critical issues.

No wonder so many senior political figures, Republicans and Democrats, are deciding not to run for reelection. The days of the politics of joy, as Hubert H. Humphrey used to say, seem to have been replaced by the far less appealing politics of impossible choices. Now, no matter what course one chooses here, it's no-win politics.

Then came the summit.

Ronald Reagan and Mikhail Gorbachev may have accomplished something even more significant than signing an arms-reduction treaty. They demonstrated that they and their nations can put aside lingering hostilities and act responsibly in pursuit of a safer, more secure world.

Each leader proved himself capable of meeting the challenge. The tone they set was exactly right: tempered and open, practical and candid.

While they met, the city sent forth another kind of positive signal -- of the remarkable way in which the democratic system, for all of its failings, continues to function.

A stroll through Lafayette Park across from the White House showed democracy's enduring strengths: the right to dissent, to be wrong, to insult the mighty, to challenge freely the most powerful, all without fear of retribution.

There an elderly woman jumped up and down, waving a sign and shouting, "God bless Gorbachev." A few feet away, a young woman was fervently and repeatedly shouting into a microphone, "Death to Gorbachev, don't trust the Russians. Death to Gorbachev, don't trust the Russians."

Around them were sights and sounds of an amazing array of protesters. As always on such occasions, they represented various ethnic, religious and national groups expressing diametrically opposite, passionately held views. All vented their feelings, pro or con, without hindrance from authority. All took for granted their right to protest.

Viewed together, events inside and outside the White House this week were most welcome. But it would be a mistake to view them through the rose-colored glasses too often donned during previous highly publicized summits.

Invariably, the glow of good will that emanated from "the spirit of Camp David" in the Eisenhower era, "the spirit of Glassboro" in Lyndon B. Johnson's presidency and "the spirit of detente" under Richard M. Nixon dissipated quickly and often cruelly.

I, for one, remember too well similar uniform expressions of hope during the first visit of a Soviet leader to America. That trip in 1959 by Nikita Khrushchev was my first major story as a young reporter here, and I find my yellowing clippings of that episode revealing and dismaying.

Like Gorbachev, Khrushchev was depicted as fresh, different, open and energetic, bearer of the good new message from Moscow that nuclear disarmament might be at hand. One night after attending a formal White House state dinner in a business suit, as did Gorbachev, Khrushchev hosted President Dwight D. Eisenhower at the same Soviet Embassy building where Gorbachev entertained Reagan Wednesday night.

According to my report then, Khrushchev raised his glass to the president and said: "The ice of the Cold War already is not only showing signs of a crack but has started to crumble."

That, of course, was before the Berlin Wall, before the Cuban missile crisis, before Vietnam, before the Soviet invasion of Czechoslovakia, before Soviet troops were sent into Afghanistan and before the new "spirit of the Christmas summit." The moral: Be grateful for good tidings, but don't count on them to produce the millennium.