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
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.
Only Mops registry packages carry file hashes, so only those are file-verified. GitHub (repo) and local (path) dependencies are not — local paths 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.