In my youth I read a novel where technology was controlled by a priest class.
They had an ordination process of novices which involved randomly selecting an egg, breaking it open, and inside was a different colored robe. The different colors corresponded to different fields (iirc).
The society, and the priest class, believe in magic as opposed to technology.
The protagonist, a novice, breaks open an egg to reveal a black robe - which was not any of the prescribed colors. IIRC, they tried to take it from him but ultimately ended up letting him have it, and (?) ignored him.
Turns out, the black robe was some sort of master robe, with knobs inside the sleeves that controlled 'broken magic'. Like flying cars. And rendering the black-robe wearer invisible.
AI is also involved in this.
I read this when I was around ~6-10 years old, early 1990s. So possibly young-adult. English language. And I read it in a New Zealand school.
Any pointers would be appreciated!