Yeah, poking around on sites like Westlaw and Cornell’s LII, it’s clear as mud as to whether or not the ex post facto clause applies to all manner of things that the average person might deem punitive. The courts seem to go both ways about whether or not a nominally civil penalty avoids the question, and it seems to center around whether the statute is masking a fundamentally punitive measure as civil rather than criminal (I think?). Good thing I’m not an attorney. :^)
This has been a fascinating dive into a very narrow part of what attorneys and judges out there deal with on a daily basis. The complexity and occasional appearance of arbitrariness makes my skin crawl as an engineer, but it’s far from the first area of someone else’s expertise to give me a bad case of the willies.