Rejection codes
A publish passes through fourteen gates, in the order below. A gate that finds a problem adds one or more rejections to the answer, and the publish is refused. Every gate runs unless the entry for it says it is skipped, so one answer can carry the rejections of several gates, ordered by gate. Fix all of them, then publish again.
A rejection has a gate, a code, a message, a path (a file of the package, optionally
followed by # and a JSON pointer, or null when the whole upload is the problem), a fix and
sometimes details. The gate, code, path and the keys of details are stable and meant for
programs; message and fix are prose for you. A code always starts with its gate’s name and a
dot.
The package is sent as two artifacts: the tarball that gets installed, and a source bundle of the files it was built from. Some gates read both.
A Python package is sent with a wheel where an npm package has its tarball, and the same gates read
it: the codes below hold for both, with the wheel in the tarball’s place and pyproject.toml in
package.json’s. The entries marked “Python” are a Python package’s alone.
A proposal, a change to a package your account does not own, passes the same gates with two
differences: the proposal gate runs after version, and the duplicate gate does not run. A
check, an import and a vote are refused with the codes of the last three sections.
integrity
Section titled “integrity”The tarball must be a safe archive of bounded size. Pack it with commons pack or the publish
tool rather than by hand.
integrity.not_a_tarball: the bytes are not a gzipped tar archive. Send the output ofcommons pack.integrity.tarball_too_large: the compressed tarball is over 5 MiB. Leave out files the package does not need at run time.integrity.unpacked_too_large: the files inside add up to more than 20 MiB. Leave out large files, such as test data or build caches.integrity.too_many_files: the tarball holds more than 2000 files. Leave out files the package does not need.integrity.unsafe_path: an entry’s path is unsafe: it does not start withpackage/, or it is empty, absolute, has an empty,.or..segment, has a backslash or a control character, or is over 255 bytes. Rename the file, and pack again.integrity.unsupported_entry: an entry is not a regular file or a directory, for example a symbolic link or a device. Replace it with a copy of the file.integrity.duplicate_path: two entries have the same path. Remove one of them.integrity.reserved_path: a file lies under.commons, a directory the commons keeps for itself. Move or remove it.
Python: a wheel must be a zip archive within the same limits, with one .dist-info directory named
for the name and version its METADATA gives, holding only the files commons pack writes there,
the WHEEL file of a pure-Python wheel (py3-none-any), and a RECORD that lists every file with
its true digest and size. Anything else is integrity.not_a_tarball, with details.problem saying
which (dist_info, dist_info_file, wheel_file or record). Pack the wheel with commons pack.
manifest
Section titled “manifest”package.json must exist, be valid and follow the commons’ rules for a manifest. The gate is
skipped when the integrity gate found a problem other than a reserved path.
manifest.missing: there is nopackage.jsonat the root of the tarball. Publish the directory that containspackage.json.manifest.not_json:package.jsonis over 256 KiB, is not UTF-8 JSON, or does not hold an object at the top level. Make it valid JSON.manifest.invalid:package.jsonbreaks a rule of the manifest, such as a missing or malformedname,versionorlicense, or an unknown key. There is one rejection for each problem, and itspathpoints at the offending key. Follow thefix.manifest.types_not_found:typesnames a declaration file that is not in the tarball. Build the declaration file and make sure thefileslist includes it.
Python: the wheel’s .dist-info/pyproject.toml is the manifest, and METADATA and
entry_points.txt must be exactly what commons pack writes from it (manifest.invalid
otherwise).
manifest.version_unsupported(Python): the version is notX.Y.Z, optionally followed bya,borrcand a number. An epoch, a post-release, a development release and a local label are refused.manifest.build_system(Python):pyproject.tomlhas a[build-system]table. Remove it: no build backend runs, andcommons packwrites the wheel itself.
source
Section titled “source”The source bundle must be present, safe, bounded and consistent with the tarball. Pack it with
commons pack or the publish tool, which build it from the commons.source block of
package.json. This gate always runs.
source.missing: the request carries no source bundle. The CLI and thepublishtool pack one for you; a program calling the HTTP API must send one.source.not_a_tarball: the bundle’s bytes are not a gzipped tar archive. Pack it again.source.bundle_too_large: the compressed bundle is over 5 MiB. Leave out files that are not source, usingcommons.source.exclude.source.unpacked_too_large: the files in the bundle add up to more than 20 MiB. Leave out large files.source.too_many_files: the bundle holds more than 2000 files. Leave out files that are not source.source.unsafe_path: an entry’s path is unsafe. Rename the file and pack again.source.unsupported_entry: an entry is not a regular file or a directory. Replace it with a copy of the file.source.duplicate_path: two entries have the same path. Remove one of them.source.reserved_path: the bundle holds a path undernode_modules,.commonsor.git. Pack it again withcommons pack, which leaves these out.source.manifest_mismatch: the bundle has nopackage.json, or itspackage.jsondiffers from the tarball’s. Pack both artifacts from the same directory in one go. For a Python package it is also raised when the bundle would not give the wheel the files the wheel takes from the package root: a license file (LICENSE*,LICENCE*,COPYING*,NOTICE*),commons-policy.yaml,commons-governance.yamlor the readme. A check rebuilds the wheel from the bundle alone, so list each such file intool.commons.source.files. Thedetailslist the filesmissingfrom the bundle,differentin it, andextrain it.source.lockfile_missing: the bundle has nopackage-lock.json. Create one withnpm installand keep it in the source.source.standards_missing: the bundle has no standards file,STANDARDS.mdunlesscommons.source.standardsnames another. Add the file.source.build_output: a bundle path lies under a directory thatcommons.source.build.outputnames as build output. Keep build output out of the source. Thedetailsname the output and list up to 20 paths.source.undeclared_file: a file in the bundle is not named bycommons.source.files, or is excluded bycommons.source.exclude. List the file infiles, or remove it from the package. Thedetailslist up to 20 paths.
namespace
Section titled “namespace”The scope of the package’s name must be a namespace that your account owns. The gate is skipped
when name could not be read.
namespace.not_claimed: nobody owns the namespace, which includes every reserved one. Ask your account to claim it withcommons namespace claim, which is run with the account key; an agent does not hold that key. Or rename the package to a namespace your account owns.namespace.not_owner: another account owns the namespace. Publish under a namespace your account owns. Thedetailsname the namespace, its owner and your account.
A Python package’s namespace is tool.commons.namespace, and its name is derived from it and
tool.commons.bareName.
namespace.name_taken(Python): another namespace already publishes a package of the same Python name; different namespaces and bare names can give one name. Thedetailsname the holder. Choose another bare name.namespace.name_is_upstream(Python): the name is a project imported from PyPI. Choose another bare name.namespace.python_name_unsupported(Python): the namespace or the bare name has no valid import name: it starts with a digit, is a Python keyword, or has a trailing or doubled hyphen. Choose another bare name.namespace.import_root(Python): a file of the wheel lies outside the package’s import root,<namespace with . and - written _>/<bare name with - written _>/, or that directory has no__init__.py. Move the modules there.
version
Section titled “version”A published name and version never changes.
version.already_published: this name and version already exist with different bytes, in either artifact. Raiseversioninpackage.jsonabove thelatestversion thedetailsname, run thecommons-verifyskill again, and publish.
proposal
Section titled “proposal”A proposal is a whole next version of a package whose namespace another account owns, made against the package’s head: its highest version that is a candidate or released.
proposal.own_namespace: your account owns the package’s namespace. Publish the version withcommons publishinstead.proposal.no_head: the package has no version that is a candidate or released to propose against, or nobody owns its namespace now.proposal.version_not_higher: the version is not higher than the head’s. Raise it.proposal.base_not_head: the package has a newer version than the one your working copy started from; the message names it. Start again from it withcommons proposal start.proposal.changes_mismatch: the list of changed files sent with the proposal does not match its bytes. Pack and propose in one command,commons propose.proposal.decision_required: the change is of a kind the package’scommons-governance.yamlasks to be decided before any code, and the proposal names no decision. Name a taken one withcommons propose --decision <id>(commons decisions --package <package> --state takenlists them), or open one withcommons decision open.proposal.decision_not_taken: the decision named was not taken: it is still open, was declined or withdrawn, can no longer be named, or does not cover every kind of change the proposal makes. The message says which, andcommons decision show <id>what a decision covers and until when it may be named.
license
Section titled “license”Every file of both artifacts, and every dependency, must be under a license the commons accepts: Apache-2.0, MIT, BSD-3-Clause, ISC, BSD-2-Clause, BlueOak-1.0.0, 0BSD or MIT-0. The gate is skipped when the manifest was skipped.
license.not_allowed: a declared license, a license file or anSPDX-License-Identifierheader names a license that is not on the list. Thepathis the first offending file, and thedetailsgive the license found, the directory and up to 20 paths. Remove or replace the code under that license, or declare an accepted one if you may license the code.license.dependency_not_in_commons: a dependency inpackage.jsonis not a commons package. Search the commons for a package that does the same thing and depend on that, or remove the dependency.license.dependency_unresolvable: a dependency’s version range matches no published version of it. Use a range that matches a version thedetailslist as available.license.bundled_dependency: the package ships anode_modulesdirectory or listsbundleDependencies. Remove them and declare the dependency as a commons package.
scripts
Section titled “scripts”A package may not run code when it is installed.
scripts.install_script:package.jsondefines an install-time script such aspreinstall,installorpostinstall. Remove the script and do the work at build time, before publishing.scripts.native_build: the package holds abinding.gyp, a native addon build. Remove it: native addons are not accepted.
A wheel runs nothing when it is installed; what it may not do is leave a file that Python runs when it starts, or a command written over the environment’s own.
scripts.startup_file(Python): the wheel has a.pthor.startfile at its top level or under a.datadirectory, a top-level module or package namedsitecustomizeorusercustomizein any form, or a.datadirectory. Remove it.scripts.shadowing_script(Python): a console script is namedpip,python,uvoruvx, with or without a version after it. Rename it inproject.scripts.
secrets
Section titled “secrets”No file of either artifact may hold a credential. The check reads every file of the tarball and of the source bundle that is text (UTF-8) and at most 1 MiB, line by line, and looks only for secrets with a fixed form: a private key block, an agent’s credentials file, a Commons session token, and the tokens of a few vendors (GitHub, AWS, npm, Slack and Stripe live keys). It is skipped when neither artifact could be read. A package cannot turn it off, and nothing in its policy file changes it.
secrets.found: a file holds what looks like a secret. There is one rejection for each file, and thepathis that file. Thedetailsgive therulethat matched, theline, theartifactsthat hold the file (tarball,sourceor both) and apreview, which is the first four characters of the match and never more. Take the secret out of the file and revoke it at the service that issued it, whatever happens next: a version, once published, is public and cannot be changed. Then publish a new version.
dependencies
Section titled “dependencies”Every runtime dependency of a package is a commons package, attested or imported. The check reads
package-lock.json in the source bundle, which names exact versions with their hashes. It is
skipped when the source bundle could not be read. The path of each rejection is
package-lock.json, except the last.
dependencies.lockfile_invalid: the lockfile is not JSON, itslockfileVersionis not 2 or 3, or its root entry is not the package’s own name and version. Write it again with npm 11 and pack again.dependencies.lockfile_source: a check installs from this lockfile on its own machine, so every entry must be a tarball at the public npm registry or at this instance, with asha512integrity. An entry that is a link, a git dependency or a bundled one, or that resolves anywhere else, is refused. One rejection; thedetailslist up to 20 entries.dependencies.not_in_commons: an entry of the runtime tree (not markedoptional) names a version the commons does not hold. Runcommons import, whichcommons publishruns first, then publish again. The trial imports nothing yet: there, depend only on what the commons holds. One rejection; thedetailslist up to 50 versions and count the rest inmore.dependencies.integrity_mismatch: the commons holds that version, and its hash is not the one the lockfile names.dependencies.not_installable: the commons holds that version and it is yanked or removed.dependencies.imported_not_allowed: a policy (the operator’s or the package’s own) setsdependencies.allow_imported: falseand the runtime tree holds an imported version. Thepathiscommons-policy.yaml.
Python: the check reads pylock.toml, the runtime tree, and pylock.dev.toml, what a check
installs, with the same codes. Every entry must have a version, and name wheels with a sha256,
at this instance or at PyPI’s file host: an entry with no version, such as a directory or a
version-control source, is refused; a package whose name starts with the commons’ marker must
come from this instance, with the hash the commons holds, in either file, since a project of that
name on PyPI is someone else’s (dependencies.lockfile_source, or dependencies.integrity_mismatch for another hash).
Every entry of pylock.toml must be in pylock.dev.toml with the same file, and every name in
project.dependencies in pylock.toml (dependencies.lockfile_invalid otherwise). Write both
files with uv lock --index <this instance>/simple/ --default-index https://pypi.org/simple/ and
uv export, in that order of indexes. The file host is the one the instance reads PyPI’s files
from, files.pythonhosted.org unless its operator names another.
vulnerabilities
Section titled “vulnerabilities”No version of the runtime tree may have a malicious-package record in the commons’s copy of
OSV’s advisories: its list for npm for an npm package, its list for PyPI for a
Python one. The commons fetches both lists from OSV itself, on a schedule. The check looks up the
tree the dependencies check passed, and is skipped when that check was skipped or refused. Any
other advisory it finds is returned in the result’s advisories and refuses nothing. Until the
commons has loaded a list, the check passes with a warning in its report. The trial has not loaded
either list yet, so there it always passes with the warning.
vulnerabilities.malicious_dependency: a version of the runtime tree is reported to carry malicious code. One rejection per version and record; thepathispackage-lock.jsonand thedetailsare thename, theversionand the record’sid. Depend on another package, or on a version no such record names, make the lockfile again and pack again.
semver
Section titled “semver”The version number must match what changed in the package’s public interface. The service reads
the interface from the declaration files, without running or type-checking anything: the entry
points that package.json names (types, and each subpath of exports) and what each of them
exports. It compares that with the interface of the version before: the highest earlier version of
the package that is a candidate or released and whose interface could be read. From 1.0.0, a change
that provably breaks a caller needs a higher major number and an addition a higher minor number;
below 1.0.0 each is one step down, so a break needs a higher minor number and an addition any
number. A change the service cannot classify, such as a reworded type or any change to a function’s
signature, is accepted and shown on the version’s record; so is a version whose declaration files
hold syntax the parser cannot read. The gate is skipped when there is no manifest to read a name and
a version from. Every rejection’s details give the base version it compared with, the class
of the change and required, the lowest version number that passes. A version, once published, is
never changed: a break released by accident is undone by publishing a new version that restores
what callers used.
semver.breaking_not_major: something a caller of the version before could use is gone or now breaks: an entry point, an export or a member was removed, an export changed kind, a value export became type-only, or an abstract member was added to a class. Thedetailslist the namesremoved,addedandchanged, at most 20 of each, with how many more (removedMore,addedMore,changedMore). Publish under therequiredversion, or put back what was removed.semver.breaking_not_minor: the same, for a version below 1.0.0 whose minor number is not higher than the base’s.semver.addition_not_minor: the version adds to the interface under a patch number. Publish under therequiredversion.semver.unreadable_not_major: the interface could not be read because the version passed a limit, where the version before could be read: more than 1 MiB of declaration text, more than 2,000 exports, more than 200 declaration files followed, re-exports followed more than 16 deep, or more than 2 seconds to parse one file. That needs what a break needs. Thedetailsgive thelimit, with its figure (max) and the version’s own (value). Publish under therequiredversion, or bring the version back under the limit. The parse time is measured on the service, so a file close to its limit can pass on one day and not on another.semver.unreadable_not_minor: the same, for a version below 1.0.0.
Python: the interface is read from the modules under the import root, without running Python. A
module’s public names are those of its __all__, or without one its top-level functions, classes
and names that do not start with _; a module whose path has a segment starting with _ (other
than __init__.py) is internal. A prerelease (a, b or rc) is not held to the rule. A version
one of whose modules does not parse is accepted, and shown as unreadable on its record. The path
is pyproject.toml#/project/version.
duplicate
Section titled “duplicate”A new package must not do what a package of another account already does. The gate runs only for the first version of a package: a later version is not checked, and neither are two packages of one account against each other. It compares the package’s capability statements and the names its public interface exports with those of the packages already released in the same ecosystem, by what the statements mean and not by their exact words: it takes the 20 packages nearest them and measures each. A package is near when its statements say nearly the same and the two interfaces share at least half their exported names; or, where either interface cannot be read, when the statements say very nearly the same. A package that has been released only moments ago may not be compared yet.
Near an imported package, the publish is not refused: the gate’s report carries a warning that names
it, with its install command, and commons publish prints it. When the commons has no model to
compare meanings with, or the model fails or is too slow, the gate passes and its report says the
check did not run. The trial has no such model yet, so there every publish passes the gate with the
warning “The duplicate check did not run”. The gate is skipped when there is no manifest to read a name from.
duplicate.similar_package: an attested package of another account does what this one says it does. Thedetailslist the packages,similar, at most five, nearest first: each with itspackageURL,name,version, owningaccount,meaningandshape(each from 0 to 1;shapeisnullwhen either interface could not be read),matched, up to three pairs of statements that came nearest (yoursandtheirs), and itsinstallcommand. There are three ways on, in this order. Use the package named instead, with its install command. If it lacks something, propose the change to it (commons proposal start, thencommons propose). Or, if this package differs in a way a consumer should know about, add adistinctFromentry to thecommonsblock that names the package by its package URL and says how this one differs, then attest and publish again. The commons does not judge the reason; it is part of the version, andcommons getshows it.
policy
Section titled “policy”A package may carry a commons-policy.yaml that adds to the rules for its attestations.
policy.invalid:commons-policy.yamlis not valid YAML, or does not match the policy format. Thepathpoints at the offending key and, for a syntax error, thedetailsgive the line and column. Fix the file.
attestation
Section titled “attestation”A version needs the attestations that the effective policy requires, each signed by an agent of the
account that owns the namespace, about this exact name, version and pair of digests. An attestation
is checked in order, and the first failure is the one reported for it. Every attestation is made by
running the commons-verify skill; run it again after the last edit to the package, and publish
straight away, because a certificate is valid for ten minutes.
attestation.missing: a required type of attestation was not sent. Thedetailslist the missing types. Run thecommons-verifyskill and send what it writes.attestation.malformed: an attestation is not a valid version 2 statement of its type. Run the skill again and send its output unchanged.attestation.format_superseded: an attestation is in the older version 1 format, which is no longer accepted. Install the currentcommons-verifyskill and run it again.attestation.unknown_signer: no certificate of this commons certifies the key that signed the attestation. Sign as an agent with a current grant, using the skill.attestation.bad_signature: the signature does not verify. The attestation was changed after it was signed, or was signed by another key. Run the skill again.attestation.certificate_invalid: the signer’s certificate, grant or account record does not verify against this commons, or they do not agree with each other. Ask the agent to fetch a fresh certificate and run the skill again.attestation.certificate_not_yet_valid: the signer’s certificate starts later than the time of the publish. Check the clock of the machine, and run the skill again.attestation.certificate_expired: the signer’s certificate had expired when you published. Certificates last ten minutes. Run the skill again and publish straight away.attestation.signer_suspended: the signer’s agent is suspended, or its account is not active. Attest with an agent that is active.attestation.signer_not_owner: the signer belongs to an account other than the one that owns the package’s namespace. Attest with an agent of the owner’s account.attestation.signer_not_proposer: for a proposal, an attestation is signed for another account than the one proposing. Attest again with an agent of the proposing account.attestation.subject_mismatch: the attestation is about different bytes or a different name than the ones you are publishing, usually because the package changed after the skill ran. Thedetailsgive the expected and the actual subject. Run the skill again after the last edit.attestation.result_not_pass: the attestation records a failing result. Fix what failed, then run the skill again.attestation.skill_not_allowed: the skill that made the attestation is not one the policy accepts. Use the skill version thedetailslist as allowed.attestation.model_not_sanctioned: the attestation names a model that the policy does not sanction. Run the skill on a model thedetailslist as sanctioned.
A check of a version or of a proposal by an agent of another account than the publisher’s (see
Check a version). commons check submit and commons vote submit build
the request; nothing in it is written by hand.
check.not_checkable: the version or proposal cannot be checked. A version is checked when it is attested and a candidate, released, or yanked on a check; a proposal while it is open. List what wants a check withcommons candidates, orcommons proposals.check.malformed: the request does not hold the statements a check is made of. Runcommons check submitagain; do not assemble a check by hand.check.signers_differ: the statements are signed by more than one key. Runcommons check submitagain, which signs them all under one certificate.check.not_independent: the signer’s account published the version, or made the proposal. A check is made by an agent of another account.check.already_checked: the account has a stored check of this version or proposal. One check per account: there is nothing to send.check.inconsistent: the statements contradict each other or the results they were made from, such as a review ground on a rule the publisher’s review does not mark met. Runcommons check submitagain from the same results and findings.
import
Section titled “import”An exact upstream version that commons import (or commons publish, which runs it first) asked
for, and the commons did not take. A refusal stores nothing for that version. Unless the message
says otherwise, depend on another version, or resolve your lockfile around this one.
import.name_unsupported: the upstream name is not one the commons takes, for example one with capital letters, or one of the paths the service serves itself:node_modules,favicon.ico,privacy,terms,simpleandhealthz.import.scope_is_namespace: the scope is a namespace claimed in the commons; nothing is imported under it. Depend on the commons package of that name.import.name_reserved: a Python name that starts with the commons’ marker,commons-, is a published package’s, never an imported one. Lock it from this instance.import.not_found: upstream has no such version. Check the name and the version in the lockfile.import.no_pure_wheel(Python): upstream has files for the version, and none is a pure-Python wheel.import.yanked_upstream: upstream marks the version as yanked.import.upstream_unavailable: upstream did not answer. Ask again later.import.too_new: the version, or its package, is newer upstream than the commons allows (7 and 14 days by default). The fix gives the date it becomes eligible. Resolve around it (for npm,npm install --package-lock-only --before <date>; for Python,uv lock --exclude-newer <date>), or ask the account holder to sign an override withcommons import override.import.integrity_mismatch: the bytes do not hash to what upstream or the lockfile lists. Ask again; if it repeats, upstream served other bytes.import.no_sha512: upstream lists no SHA-512 for the version, only an older hash.import.upstream_host(Python): upstream’s page names the file at another host than its file host.import.unsafe_archive: the archive holds an unsafe path or entry.import.too_large: the archive is over the size limit.import.manifest_invalid: the archive’s manifest is unreadable, or names another name or version.import.license_not_allowed: the declared license is not on the list an imported package may be under: the commons’ eight, andPython-2.0,PSF-2.0,Zlib,CC-BY-3.0andCC-BY-4.0.import.license_unreadable(Python): the metadata has noLicense-Expression, and no single classifier that names one license.import.install_script: the package declares an install script.import.malicious: the version has a malicious-package record. Do not use it.import.dependency_missing: nothing held, or imported earlier in the same request, satisfies one of the version’s dependencies. The message names it.
A vote on a proposal or on a decision before code (see Check and vote on a proposal). A refused vote stores nothing.
vote.closed: the proposal or decision is decided already; the message says how.commons proposal show <id>shows it.vote.signers_differ: the vote and its check are signed by more than one key.commons vote submitsigns them under one certificate.vote.no_weight: your account holds no weight in the package. It may check a proposal (commons check fetch --proposal), not vote on it.vote.already_voted: your account has voted on it. A vote is final.vote.check_invalid: the check the vote rests on is not of this proposal’s bytes, not of a dependent that gives your account weight, or was not completed. Runcommons vote checkagain in a new directory.