mops verify
Audit the installed dependencies against mops.lock.
mops verify
mops install verifies files at download time, before they enter the cache, and does not re-hash .mops/ on every run. mops verify is the on-demand full audit: it re-hashes every file the lockfile records and confirms the lockfile itself is still trustworthy.
It checks that:
mops.lockexists, parses and is the current format version- every file listed in
mops.lockexists under.mops/with the recorded hash mops.lockpins every dependency declared inmops.tomlto the same valuemops.lock'sdepsandhashessections agree on the set of registry packages- every file hash in
mops.lockmatches the Mops registry - every GitHub dependency's directory under
.mops/_github/still hashes to the treemops.lockrecorded for the pinned commit
On success it prints the number of packages and files verified and exits 0. On failure it prints each problem with the recovery step and exits 1.
$ mops verify
Integrity verified 6 package(s), 842 file(s)
When to use it
- After editing files under
.mops/by accident. Since 3.0,mops installtolerates a modified.mops/tree;mops verifyis what reports it. - As a tamper gate. If a pipeline relied on
mops installfailing when.mops/had been modified, runmops verifyinstead. - When a build behaves unexpectedly and you want to rule out a modified dependency.
Registry packages are verified file by file, against the per-file hashes the registry publishes. GitHub (repo) dependencies are verified as a whole tree instead — GitHub publishes no hashes, so mops.lock records one sha256 over the extracted directory and that is what gets re-checked. Local (path) dependencies are not verified at all: they point at live directories by design.
Recovering
- A file under
.mops/differs from the lockfile — delete that package's directory (rm -rf .mops/<package>@<version>) and runmops installto restore it from the cache. - Files are missing from
.mops/— runmops install. mops.lockitself disagrees withmops.tomlor the registry — restoremops.lockfrom version control, or delete it and runmops installto regenerate it.