Unfortunately, because `JcrRepository` (and thus `RunningState`) are in `org.modeshape.jcr`, `RunningState` is only visible within that package. `Upgrades` and all the inner upgrade step implementation classes are in the `org.modeshape.jcr` package and thus do have visibility of `RunningState` and `RepositoryNodeTypeManager`. However, `org.modeshape.jcr.cache.RepositoryCache` is in a different package and thus cannot see `RunningState` or `RepositoryNodeTypeManager`, meaning it is impossible to encapsulate the management of the upgrade persisted state and the invocation of the `Upgrades` operations within the `RepositoryCache`. However, the public `Upgrades.Resources` interface does make it possible to pass this through the `RepositoryCache` methods. It's is not very attractive, but it does work around the visibility difficulties. (And remember that there are good reasons why we want to have minimal visibility of our internal classes.)