Anwar Sadat may be the only man in the Middle East with no doubts about his place in history. The Egyptian president's greatest achievement, the peace treaty with Israel, has been condemned as treason throughout the Arab world. Even within Sadat's own Foreign Ministry, there are those who fear that Sadat has been played for a fool by the Israelis. But Sadat, like all true visionaries, knows neither doubt nor regret. "History," he tells the skeptics, "will show who was right and who was wrong." There can be "no going back." The judgement of history may be on Sadat's side, but current events are not. When Syrian jets engaged Israeli fighters over Lebanon last month, it left Sadat exactly where his Arab opponents said he was -- sitting on the sidelines, at peace with Israel, preparing to welcome to Egypt the same Israeli prime minister who sent war-planes over Lebanon and took new initiatives on the West Bank, while the other Arabs carried on the struggle. If Sadat shared the embarrassment and discomfort of his own officials, it did not show. He thinks Egypt has better things to do with its future than carry on a futile struggle, and so he withdrew from it on the best terms he could get. He sensed, correctly, that the Egyptian people were weary of carrying a burden imposed on them by others for a cause that was not really theirs. Sadat demonstrated that he was the only Arab leader with enough faith in his own statemanship and enough confidence in the support of his people to take the unimaginable step he thought necessary. Not for him the comforting cloak of Arab unanimity that paralyzes the others, making it easier for them to do nothing than to follow his example. No one outside Egypt is following where Sadat is leading, but to Sadat that shows only that the other Arabs are timorous and shortsighted. He knows that the West Bank and the Golan Heights can never be regained by aerial dogfights over Lebanon. Visionaries often leave wreckage behind, but since they do not look back they do not see it. If it really is wreckage, as the other Arabs say, that means little to Sadat because is is already pressing ahead to a new and even more formidable task, reshaping Egyptian society and rebulding the economy. For the 41 million Egyptians, yearning for prosperity and a place in the modern world, this is likely to be the true test of Sadat's place in their children's memories. It is possible he could fail it. Appearing before the first session of Egypt's new parliament last month, Sadat was at his persuasive best as he talked of the country's future. Appealing for compassion, dedication and commitment, he offered peace and prosperity to be built through hard work, sacrifice, education, social welfare, women's rights, the rule of law and "national unity" -- undisturbed by those "who try to distort democracy." This grand design, a distillation of everything Sadat has said he wants for Egypt since the 1973 war with Israel, was warmly applauded by the delegates, not just because parliament is dominated by Sadat loyalists but also because it told the Egyptians once again what they wanted to hear. An honorable peace, Sadat said, can be followed by "a better life for our people," in "the cradle of civilization," unhindered by the contentious "dwarfs" in other Arab countries who have turned against Egypt. Given Sadat's nine-year record of accomplishment, innovation and staying power, it is possible that he can lead the country into the golden future he was calling for. But there are also cracks beneath the Egyptian surface that make it possible he will fail, with incalculable consequences for the country, for stability in the Middle East, for Israel and for U.S. policy. It would take a daring seer to predict where Egypt will be five years from now. By many measures, Sadat's program is moving along nicely. He is firmly in control of the country and the people running every important institution are loyal to him. The threat of war, which dominated Egyptian life for a generation, has been removed. The boycott of Egypt imposed by the other Arab countries because of the peace treaty has stung finacially but has had little political impact. The economy is expanding. The Suez Canal is thriving. Tourism is booming. Oil production is rising. Factories are opening. And green things are shooting up on land that has been desert for centuries. But the country is beset by poverty, illiteracy, disease, overpopulation, corruption, bureaucratic inertia and a kind of systemic rot that cannot be cured by exhortations from the president. Public services - schools, hospitals, - water sewer and transportation facilities are in appalling condition. Government offices are crowded with indifferent public servants, their ranks ever growing, who have no incentive to perform and who act accordingly. Egypt is already unable to feed or house itself and the population is growing faster than the agricultural output, devouring more and more food imports and the government must subsidize. The state-owned factories are outmoded and renowned for the poor quality of their output. Magagement and distribution techniques are primitive. Marketing an almost unknown skill. Beyond that, Egypt is becoming a bifurgated society, split between the haves and the never-will-haves. As in India, the gap is partly technological. Egypt has skilled engineers geologists, doctors and nuclear physicists who live in a different world from the village farmers and illiterate urban pushcart vendors at the other end of the scale. But there is a social gap, too. The educated and the rich, caught in a frenzy of status-seeking and conspicuous consumption since Sadat took some of the wraps off the economy, are flaunting their wealth and their materialism. The workers and peasants, trapped in one-room flats and mud huts, are seeing their meager incomes eroded by an inflation rate of at least 25 percent. Sadat has talked about the country's "ethical crisis" and he has appealed for a return to "the morality of the village." But the country seems to be gripped by "me first" spirit in the middle and upper classes that leaves little room for the pioneering, dirt -under - the - fingernails approach that Sadat is calling for. At a diplomatic cocktail party the other night, a young woman who has a degree in agronomy laughed at Sadat's offer to give 25 acres of desert land to anyone who will go out there and reclaim it. "Who wants to live out there?" she asked. She is a secretary at a Western embassy, a dream job that gives her good working conditions, social status and enough money -- but contributes nothing to national productivity. Unfortunately for Sadat's aspirations, her attitude is widespread. It shows up in the steward for Egypt's national airline who uses his position to hustle clients for his consulting sideline, in the official on the American desk at the Commerce Ministry whose main interest is getting a job in the United States, and in all the engineers educated at state expense who prefer coats and ties to hard hats. Mustafa Khalil the prime minister, has said that "there is no class struggle in Egypt." But over the past three years, the real challenges to Sadat's authority have come from just such tensions. Egyptians historically have been a long-suffering people who generally have deferred to authority and left politics to the politicians. But they can become violent when provoked. In 1976, a two-day walkout by Cairo bus drivers, who defied a ban on strikes, caused chaos and forced the government to come up quickly with bonuses that halted the trouble before it spread. In January 1977, an attempt by the government to cut the subsidies of several basic commodities, and thereby raise the prices, brought incendiary mobs into the streets of Cairo and Alexandria, forcing Sadat to call out the Army. Later that year, a group of Moslem fanatics murdered a former Cabinet minister as part of an attempted uprising against a government they considered corrupt, immoral and heretical. The government headed off all those crises, but the pressures that provoked them still exist. The police dossier on reports of arson. Protests, demonstrations and minor clashes during the recent partliamentary elections, where government used a heavy hand to ensure the defeat of some popular opposition candidates, is said to run 300 pages. Sadat has been criticized even by some supporters for concentrating on foreign affairs and his peace campaign at the expense of domestic concerns. But he was convinced the treaty had to come first. Now that he has it, he is turning his attention to internal reconstruction development. The most common guessing game among foreigners in Egypt is; How long does Sadat have to produce real economic progress for the masses before the country boils over? The implication of that question is that after nearly nine years in power he still does not have things under control. That may be an underestimation of his political skill. He has shown he is prepared to tolerate only a narrow spectrum of dissent. He has suppressed the left and bluntly warned the Islamic right that he will not permit any excesses. As for the rest of the Egyptians, the great politically inert mass of the population, even though conditions here would surely lead to trouble in less forebearing societies, they may well go along as they habitually do unless some real catastrophe befalls them. CAPTION: Picture, ROBERT STRAUSS . . . unconventional diplomat