I enjoyed reading this even though I currently don’t use AST. In the past used to work heavily with images, and dealt with some of these issues, as well as some craziness with vector graphics. Like a 2kb purple rectangle svg that could bring down a 64GB RAM server.
A lot of this could be super helpful in the official Rails guides. I’m not on the team, so this is just a personal opinion.