IT'S RIGHT for President Carter to commute the prison sentences of the four Puerto Rican nationalists convicted in the 1950s for trying to kill President Truman and shooting up the House of Representative. They've served long enough. Commutation was the halfway house between parole, which they would not ask for since they do not recognize American sovereignty over Puerto Rico, and pardon, which many people would have regarded as an affront. Long in the works, the matter came to a head at this time less as a deliberate American attempt to cozy up to the nonaligned summit in Havana, than as a gesture to Puerto Rico's pro-statehood governor, who wanted the Pan American Games to end before the four hit San Juan.

Their release sets up a swap for the four Americans Cuba has held since the 1960s on espionage and related charges. Fidel Castro has promised for years to make the deal. He will make political hay out of it. By going ahead, however, the United States does a humane service to the prisoners it releases and it does its duty by those it retrieves.

A word must be said about the violence used by the four nationalists. They were protesting that the Puerto Rican people, rather than accepting their counsel of independence, were forming a new voluntary link with the United States. In 1952 when Puerto Ricans overwhelmingly endorsed a commonwealth tie, the nationalists chose not to test their popular support and boycotted the poll. In 1967, they competed and were swamped. Another plebiscite is coming, and railbirds expect independence to fare poorly once again. These nationalists are not heroes struggling against colonial oppression, as some propaganda has it. They are people whose cause has been tested democratically and found wanting. They are, in brief, poor losers. Nothing in this is altered by the fact that in Puerto Rico their example of standing up to the United States has won them broad personal regard.

Lolita Lebron is the most celebrated of the four. The Nation reported last month that her eyes "flashed in anger" at mention of being "traded" for a CIA agent. "I will not be degraded, or have what I did degraded in this way," she said. "It would be a purer thing, a more beautiful thing for me to die in prison." Of such stuff are legends, or at least magazine articles, made. More to the immediate point, all these fireworks have provoked caution in response. One reason administration officials deny that the release of the Puerto Ricans is tied to the other four is to avoid bruising the delicate political sensibilities of Lolita Lebron.

Her insistence that she is a proudly independent Catholic and nationalist and will allow no others to use her is also interesting. She and her comrades represented the last gasp of the prewar Puerto Rican independence movement: extreme, right-wing, pro-Mussolini, the latter association arising from a tendency to identify with foreign enemies of the United States. The same tendency has produced the relationship of the current independence movement with Cuba. Fidel Castro will be godfather of the warm reception the proud nationalist Lolita Lebron can expect if she returns to the island that has rejected her cause.