Let’s say you are totally in favor of affirmative action, and believe that compromising in the face of the right-wing onslaught will start the country on a slippery slope to the bad old days. But how about FCC rules that let a huge white-owned company like Viacom win millions in tax breaks by selling broadcasting holdings to black front groups? Or how about an admissions policy that explicitly favors the preppy daughter of a rich black doctor over a poor white boy from Appalachia? Or a set-aside system that favors, say, a wealthy Costa Rican immigrant over a struggling third-generation Latvian-American? Liberals were demonstrating last week with their new slogan: ““No retreat.’’ No retreat from that?

Across the divide, let’s say you are totally against affirmative action, and believe we must face up to the hard truth that group entitlement (22 ““protected’’ classes in California alone) is deeply unfair. But how about, for instance, a black city with a largely white police force that makes no effort to recruit qualified black officers? Or a computer company with no women sales representatives? Finding black cops and women sales reps requires looking beyond paper credentials and old hiring habits and at least factoring in race and gender. That’s called affirmative action.

Pushed hard enough, most people turn out to be fairly conflicted on this issue, which makes the search for compromise (as opposed to ideological vindication) all the more necessary. This is especially important for supporters of affirmative action to understand. If they try to hold fast to the status quo, they’ll lose it all, first in California’s 1996 ballot initiative, then everywhere. Lyndon Johnson’s original idea in 1965 was to help ““disadvantaged’’ people ““hobbled’’ by past discrimination. It was Richard Nixon who began the drift to quotas. The challenge now is to reinforce the common-sense pillars on which the old consensus can be rebuilt, before it’s too late. Some possibilities:

If every admissions, hiring and promotion program established this as the first principle, then complaints about affirmative-action abuses would inevitably decline. We wouldn’t have to read any more horror stories like the one about the state health-department supervisor in California who was fired when he refused to fill 10 clerk-typist positions with minorities who couldn’t type. Stressing excellence first would also lessen the stigma that is now often attached to minority hires, and give them more confidence that they were chosen on merit.

Fights over preferences routinely revolve around tests. Whites, who generally do better on exams, tend to argue that test results equal merit. Blacks tend to argue that merit should be defined broadly. The latter argument is more persuasive. White police officers who complain that they were passed over for promotion even though they did better than black colleagues on the test miss the point. Promotion shouldn’t be determined by tests but by performance, which can include relating to the community better in part because you are black.

It’s one thing to miss winning a job partly on the basis of race. It’s far worse to lose a job strictly on the basis of race. If the layoff decision truly cannot be made on the basis of performance or seniority, as in the controversial Piscataway, N.J., case, management should simply flip a coin. That would be arbitrary but fair.

The two big Supreme Court decisions of the last 20 years have both been attacked for ambivalence, but in both cases the court drew the right distinctions. In its 1978 Bakke decision, the court ruled against quotas but accepted the use of race in the admissions process to build a diverse student body. The 1989 Richmond ruling found that preferences in municipal hiring must be ““narrowly tailored’’ to overcome specific examples of past discrimination. Needed next: better enforcement.

With budgets tight, schools fill affirmative-action slots by admitting minority students whose families can pay, while rejecting poor applicants who really need the break. Class cannot replace race across the board. (Workplace promotions, for instance, cannot be pegged to childhood disadvantage.) But class must consistently supplement and sometimes supersede race, especially in education.

Affirmative action has helped create a new black middle class and transform the role of women. But few recognize that it also fattens the bottom line. From newspapers to apparel, a diverse work force brings a marketing edge. Hard-headed results carry more weight than the old calls for justice.

Like any program, this one should be constantly second-guessed. Instead of whimpering about the assault, advocates of affirmative action should seize the chance to rethink, revise and re-energize their position. Enemies of the whole idea were the ones who reopened the debate. So what? Like striving for diversity, it happens to be the right thing to do.