In the Yoga Sutra, the description of enlightenment sounds a lot like clear Cosmic Consciousness or Self Realization. But the “perfections” in book 3 and 4 that come with it are from another age when the environment is “cleaner”. Nonetheless, a number of them do tend to show up over time.
But there is also another distinction. Patanjali uses the word kaivalya for enlightenment. In the last verse, 4v34:
In the absence of activity (the gunas), the purpose of purusha (spirit) is fulfilled, and what remains is kaivalya (singularity) – the infinite power (shakti) of consciousness established in its own nature.
Put another way: Purusha is spirit in duality with prakriti, nature. Nature is composed of the 3 gunas. When nature is resolved, the purpose of its duality is complete and the power behind nature and conciousness are united in a singularity.
Note that kaivalya means singularity. That’s not how enlightenment is popularly described these days. This is when you recognize yourself as the point of awareness, the point from which the knower/ experiencer arises. After the initial spiritual awakening, boundless awareness usually dominates. The fact that all experience comes through a point may not be noticed at first. But when the witness becomes less of a contrast or duality, the point-value becomes more apparent.
In time it is recognized there is both boundlessness and a point of focus of attention. (samyama) Later this is recognized in a still larger context. That cosmic, global awareness is seen to become aware of itself at every point – not just this one. We are this singularity in a field of singularities. Each kaivalya is yet another point waking up to its wholeness, another step in the boundless awakening of all beings.
Further along and we transcend global awareness (Atman) into Brahman. Kaivalya becomes seen as the starting point or doorway to totality. Vedanta follows Yoga.
Then we can recognize Brahman is the actual knower and all those points of awareness are actually devata – not knowers but rather the process of experience, the means by which Brahman knows it’s expression. No seer or seen, just seeing. There is no separate knowers or experiencers. Devata are just expressing what comes through them, our muse.
From this perspective, nothing has ever happened or is happening. There is simply a kind of musing within itself that expresses an apparent form that is never formed. No illusion, just a play within itself. There is only ever a process, a means of knowing, a profound sense of holy.