"Who determined godhood? The Senate? At the direction of the emperor? Was this godhood conferred in writing?"
In the Roman Empire, the Senate voted on deification of the emporer. It was kind of like getting elected to the Baseball Hall of Fame, or better yet the Rock and Roll Hall of Fame. Deity was the reward for conquering other lands, stealing all their wealth and bringing it back to Rome to share.
The emporer pushed to have his forbear deified in order to set his own deification set up in order. For example, even though Domitian may have been complicit in Titus' death, he moved to have the Senate deify him immediately. Somehow, deity to these ancient people did not mean the same as 'deity' does to us. These gods could be killed if you didn't like them. Most of them died violent deaths.
"Gnosticism was mapped onto the material later."
Organized religions predated the roman empire and the start of Christian religion by millenia. One aspect of kingship is that the king was defender of the Faith. Now some kings might have been pious while others had more secular outlooks. They had to keep the priests happy.
Egyptian, Babylonian, and Greek religion were all available in the Hellenistic world. They all had aspects that today we would call gnostic.
If you are thinking that politics was always intermixed in religion, you are absolutely right! Kings were very powerful but they were still politicians.
© Charles N. Pope, US Library of Congress. All rights reserved.