I believe ex post facto in the US only applies to criminal cases. Retroactive civil regulations are not restricted (at least by the federal constitution).
In a legal context, ex post facto is most typically used to refer to a criminal statute that punishes actions retroactively, thereby criminalizing conduct that was legal when originally performed. Two clauses in the United States Constitution prohibit ex post facto laws: Article 1, § 9 --- This prohibits Congress from passing any laws which apply ex post facto. Article 1 § 10. --- This prohibits the states from passing any laws which apply ex post facto.
> The state can not pass laws that alter existing contracts or refuse to enforce them.
"Right to work" laws would seem to be a counterexample here - states are permitted to jump in and put their thumbs on the scale in a contract between a debtor (the employer) and the union.