IT IS WELL -- for all parties -- that China is writing "mission accomplished" to its incursion into Vietnam. Whether, as Peking insists, it has "taught a lesson" to Hanoi is not so important as that Peking thinks so, or at least claims so, and that it pulls out before getting into the quagmire in Vietnam that Vietnam is in in Cambodia. The Vietnamese claim they have been neither defeated nor dishonored. If that gives them the reason they need to lick their wounds and contemplate diplomatic ways in which to stabilize their troubled Chinese borders, so much the better. That in turn relieves the Kremlin of having to answer any charge that it let down its Vietnmese allies. As it is, the Russians are reaping -- in their propaganda -- the advantages of restraint, claiming among other things that they foiled a devious Chinese plot to promote a Soviet-American clash.

If Peking, Hanoi and Moscow pronounce themselves satisfied with the manner in which the Chinese-Vietnam war seems to be winding down, it is not for outsiders to complain. But something else, we believe, must be said: Cnina acted badly. It acted badly in timing its invasion to Sino-American normalization and thereby attempting to make the United States an accessory. It acted badly, and continues to act badly, in its effort of spoil relations between the United States and the Soviet Union. And if any Americans gave the Chinese the impression that the United States would wink at their maneuver, then they acted badly, too. It is tough enough for the United States to sort out the competitive and cooperative aspects of its relationship with the Soviet Union without letting Peking call the tune.

But let us look at the bright side. The Chinese tested their new relationship with the United States to see if they could use it for leverage in their dispute with the Soviet Union, and found it not very useful for that purpose. That is one good "lesson" we hope the Chinese (and the Russians) have drawn. The Russians, understandably anxious to see whether normalization would be turned against them, found that the Carter administration would not permit that to happen. That is another good lesson. A third lesson is the demonstration to Americans that, for all the benefits promised by normalization, it holds risks as well.

It is better to learn these lessons at the start of a new phase of activity on the Moscow-Peking-Washington triangle, when appropriate adjustments of everyone's political compass can still be made.