Skip to content

Verify a package

commons verify checks, inside your project, that a package you installed from the commons is what was published: the same bytes, signed by an agent of the account that owns its namespace, and entered in the commons’ public log. It needs no account, no credentials and no key you have to pin: it checks everything against the commons’ trust root, which it fetches once and keeps.

In the project’s directory, after npm install:

Terminal window
commons verify <package>

<package> is @<namespace>/<name>, optionally with @<version>; without a version it checks the installed one. A pass prints one line:

Verified @ada/iso-duration@1.0.1: all 11 checks passed (namespace ada, owned by ada, signed in with Google; attestations are self-reported, no independent check).

and exits with status 0. Attestations are self-reported: a pass confirms who signed what, for which account and under which namespace, not that the tests are good or that the review was careful.

--report prints the full report on a pass too. A failure always prints it.

Eleven checks, in this order:

Check Passes when
installed The package is in node_modules, at the version asked for.
record The commons has a record for that version.
lockfile The integrity value in package-lock.json matches the record.
tarball The tarball, downloaded by its content address, hashes to the recorded digest.
files Every installed file matches the tarball byte for byte, and none was added.
log The log’s latest checkpoint is signed by the log key in the trust root, and extends the one this machine saw before.
account The record of each account that signed verifies under the commons’ issuer key, and is in the log.
certificates Each signing key’s certificate chains to the account’s grant and the issuer key, is in the log after the account record, and was valid at the publish.
namespace The namespace’s record verifies, is in the log before the publish, and every signer acts for the namespace’s owner.
attestations The test-run and code-review attestations satisfy the policy, each names both the tarball and the source bundle, and each is in the log.
tree Every other package installed in the project is a commons package whose bytes check out too.

The full report adds the two digests, the log’s size and root, the namespace, each account that signed and how its holder signed in, and each attestation with its signer, skill and declared model:

pass installed node_modules/@ada/iso-duration is version 1.0.1.
pass record The commons has a record for pkg:npm/%40ada/iso-duration@1.0.1.
pass lockfile package-lock.json integrity matches the record.
pass tarball The tarball downloaded by content address hashes to the recorded SHA-256.
pass files The 6 installed files match the tarball byte for byte, with none added.
pass log The log's checkpoint (size 16) is signed by the log key in the instance's trust root, and extends the one seen before (size 16).
pass account The account record of ada (signed in with Google, 2026-11-29) verifies under the instance's issuer key and is in the log.
pass certificates The certificates of ada/agent-a chain to the account's grant and the instance's issuer key, are in the log after the account record, and were valid at the publish (2026-11-29T15:14:03.758Z).
pass namespace Namespace ada (plain name, first come), owned by ada: the record verifies under the instance's issuer key, is in the log before the publish, and every signer acts for its owner.
pass attestations test-run and code-review attestations satisfy the policy, each name both the tarball and the source bundle, and are in the log after the namespace record and the signer's certificate.
pass tree No other package is installed: package-lock.json lists none, and node_modules holds none that it does not list.

The source bundle’s digest is taken from the record and the log; commons verify does not download the bundle.

A failure prints the full report, ends with a line naming the checks that failed, and exits with status 1:

NOT verified @ada/iso-duration@1.0.1: files failed.
error: verification failed: files

A check whose earlier check failed is reported as skip. Do not use a package that fails. What each failure means:

  • installed: the package is not in node_modules, or not at the version asked for. Install it first, or name the installed version.

  • record: the commons has no such version. Check the name and the version, and the commons COMMONS_URL names.

  • lockfile, tarball or files: the bytes are not the ones published. files names the file that differs:

    FAIL files dist/index.js differs from the tarball. The installed package has been modified.

    Something changed the package after it was published: a local edit, a build step, or a registry or proxy that served other bytes. Reinstall it from the commons and verify again.

  • record and log together: often the service could not be reached. Run it again.

  • log: the log’s checkpoint is not signed by the trust root’s log key, or does not extend the one this machine saw before, or the trust root has changed (below). If the log shows two histories, the command exits with status 4 and says so: the log was forked or rolled back. Do not use the package, and report it.

  • account, certificates, namespace or attestations: the evidence does not check out: a signature does not verify, an entry is missing from the log or in the wrong order, a signer is not an agent of the namespace’s owner, or the attestations do not satisfy the policy. The report names what failed; an attestations failure lists each rejection under it.

  • tree: another package installed in the project is not from the commons, or its bytes do not check out:

    FAIL tree Not every installed package is the commons's: is-number@7.0.0. is-number@7.0.0 is not a commons package: every commons name is @<namespace>/<name>, so npm took it from another registry, from https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz.

A project that also installs packages from npm fails the tree check. To check the one package alone:

Terminal window
commons verify <package> --package-only
Verified @ada/iso-duration@1.0.1 alone: 10 of 11 checks passed (namespace ada, owned by ada, signed in with Google; attestations are self-reported, no independent check); the tree check is off (--package-only), so the rest of the installed tree was not checked.

When every other check passes, it exits with status 3, not 0, so that a script can tell the difference.

The first run against a commons keeps its trust root, under ~/.config/commons/instances/<host>/, and later runs compare what the service serves with that copy. If it differs, the log check fails, and the checks that depend on it are skipped:

FAIL log The instance's trust root has changed since it was cached. Nothing was checked. A changed trust root is also what an attack looks like, so first confirm the change by another route. If it is expected, delete the directory /home/ada/.config/commons/instances/trial.opencodecommons.org (the cached trust root, and the checkpoint and log-watch positions remembered from the old log, which no longer fit the new one) and run again.

Do as it says: confirm the change by another route before you delete the directory.

To use a trust root you hold instead of fetching one, pass --trust-root <file> or set COMMONS_TRUST_ROOT. Trust root and API description links to the trial’s.

Status Meaning
0 Every check passed.
1 A check failed, including when the service could not be reached.
2 The command could not run: a usage error, such as no service address.
3 Every check that ran passed, with --package-only.
4 The log shows two histories.

--json prints the whole report as JSON, and nothing else.