Documented: the Book of Overthrowing Apep survives in the Bremner-Rhind Papyrus (c. 310 BC, copying older material) and prescribes the ritual in detail: make Apep of wax, curse his name, spit on him, trample him, burn him, repeatedly. New Kingdom underworld books show the serpent ambushing the sun barque in the Duat and being cut to pieces nightly, only to reform. Egypt also practiced execration rites against human enemies the same way, names smashed on pots, the technology was one system.
The story everyone repeats: eclipses and storms were Apep temporarily winning, the serpent swallowing the barque. It is a good story and it circulates in every retelling. The problem is the record: Egyptian sources connect Apep to clouds and darkness generally, but the crisp eclipse-equals-Apep line is mostly modern fill-in. Egypt saw few total eclipses and left no clean text saying it.
The interesting claim: Apep cannot be killed, only driven off nightly, and the texts say so. Egyptian theology therefore encodes a position modernity keeps rediscovering, entropy does not negotiate, order is a process, not a state. Some readers hear an early chaos theory; others hear the maintenance schedule of every civilization since.
A religion that believes order must be re-won every night is pessimism, realism, or the oldest risk-management system on record?