Using the version of "entire" to detect a version mismatch isn't particularly supportable, as the package itself may disappear as we settle on a plan to get consolidations publishing pkg(5) packages natively. What
I would suggest instead is to ensure that the list of package versions in the AI image is a subset of the package versions in the catalog of the repository (or repositories) you're installing from. If you're feeling exceptionally paranoid, you can check that the manifests of those packages are identical. Otherwise, it seems like a lot of support for a condition that you're not technically supporting ... Danek
