chant release doctor
Asks each target release.publish declares whether a publish from this environment can succeed, before anything is cut (#5161). It needs no release and changes nothing on any registry. Run it on a workstation to read what the registries show anyone, and in the release workflow to test what only that workflow can.
chant release doctor [--from cut] [--json]Release doctor, from a workstation: OIDC no; the release workflow is .github/workflows/chant-release.yml in acme/appnpm @acme/core ok npm-registry: @acme/core is on https://registry.npmjs.org, latest 1.3.0 warn npm-last-publisher: @acme/core@1.3.0 was published by trusted publishing from acme/app, .github/workflows/publish.yml, by its provenance, and this release publishes from acme/app, .github/workflows/chant-release.yml. ... fix: On npmjs.com, the package's Settings, Trusted Publisher, name acme/app and the workflow file chant-release.yml. can't tell npm-trusted-publisher: whether @acme/core's trusted publisher names this workflow can only be tested by a run of .github/workflows/chant-release.yml ... can't tell npm-dist-tag: the reveal moves latest with npm dist-tag add; over trusted publishing that needs "Allow npm dist-tag" on @acme/core's record, which npm does not show ...1 ok, 1 warning(s), 0 failed, 2 can't be observed from hereEach check ends ok, warn, FAIL or can't tell. A credential the publish needs and this environment lacks fails in CI and is a warning on a workstation, where the release job’s environment is not the one being checked. can't tell is what can’t be observed from where the doctor runs, and the line says why. The doctor exits 1 when a check fails and 0 otherwise.
| Target | Checks | What it can’t tell |
|---|---|---|
npm | Each package’s package.json names a package that is not private. The registry has the package (npm-registry, which fails with publish-npm-never-published for a package never published: the cut refuses it too). The workflow the latest version was published from, read from its provenance (npm-last-publisher). In the release workflow, npm’s OIDC exchange for the package (npm-trusted-publisher). A token in npm’s config, and whether its user may write the package (npm-token) | The trusted-publisher record itself, which npm shows only to the package’s owners, so npm-last-publisher is evidence of the last publish and nothing more. The exchange outside a run of the release workflow, since npm matches the record against the workflow file whose token asks. Whether the record allows npm dist-tag, which the reveal needs unless the target says stage: false |
oci | Credentials from the declared variables or the docker config. The registry’s token service, asked for pull,push on the repository (oci-push). On GitLab’s registry, which creates an empty repository when it grants a push token, it asks for pull only | Whether the credentials may push, when the registry’s token does not list what it grants, or the registry takes Basic credentials. On GitLab’s registry the check does not ask for push, so it answers can’t-tell |
forge | The token is set, and what it may do on the repository: permissions.push on GitHub and Forgejo, a classic token’s scopes, a GitLab token’s api scope and Developer role | What a GitLab CI_JOB_TOKEN may do, which its API does not say. A GitHub Actions GITHUB_TOKEN gets no write right from the repository API, so the doctor reads the running job’s permissions from the workflow file in the checkout (GITHUB_WORKFLOW_REF, GITHUB_JOB): contents: write is ok, read or none fails, and a job that declares no permissions, or a file it can’t read, is can’t-tell |
homebrew, tauri-updater | The token is set and may write the repository, as for forge | Whether an SSH deploy key has write access, which shows when it pushes |
mcp-registry | The server.json is there and has a name. Under GitHub OIDC the name is under io.github.<owner>/ for the repository’s owner (mcp-registry-namespace). The registry lists the server, or has not seen it yet (mcp-registry-server-listed). In CI, the registry’s exchange for the run’s OIDC token, or for the GitHub token under github-token (mcp-registry-auth) | Whether a registry token may publish, which shows when it publishes. The version, which the cut stamps into the file |
index | Under mode: "commit", as for homebrew (index-access). Under mode: "pull-request": the token sees the index (index-upstream); the fork named by fork takes a push, or the token’s user already has a fork of the index, or a classic token’s public_repo or repo scope lets the publish make one (index-fork); and that scope lets it open the pull request (index-pull-request). A declaration that can’t publish fails index-config | What a fine-grained or app token may do on a repository its owner does not own, which GitHub does not show; opening the pull request shows it |
helm | oci: the registry’s credentials and token service, as for oci, for the repository the charts go under. index: the token is set (helm-index-credentials) and sees the repository (helm-index-access) | As for oci; whether the token may push to the branch, which shows when it pushes |
marketplace | The extension’s publisher and name, from the .vsix or the member’s package.json. Open VSX: the namespace exists, and under trusted-publishing the exchange for a publishing token in CI. VS Code Marketplace: vsce verify-pat for the token or the Entra identity | Whether an Open VSX token may publish, which has no read-only check |
pypi | The project’s name, from a built distribution or [project] name in pyproject.toml, and whether the index has it (pypi-project; a project not there yet is a warning, since trusted publishing then needs a pending publisher). The token is set (pypi-token). Under trusted publishing in CI, the exchange for an upload token (pypi-trusted-publisher) | Whether a token may upload, which PyPI has no read-only check for. The exchange outside CI |
cargo | The crates cargo metadata gives and the order they publish in (cargo-crates), with the plan’s refusals. Which crates the registry’s index does not have yet (cargo-new-crates, a warning: a first version needs a token that may publish new crates). The token is set (cargo-token). Under trusted publishing in CI, crates.io’s token exchange, whose token is revoked at once (cargo-trusted-publisher) | Whether a token may publish, which a registry has no read-only check for. The exchange outside CI |
maven | A bundle that is built: its components, each file signed (maven-bundle), and components the repository already serves (maven-versions, a warning). The user token’s two variables are set (maven-token) | Whether the Central Portal takes the token and for which namespace, which shows at the stage’s upload. A bundle the cut builds |
nuget | Each id of a built package, and whether the feed has it (nuget-package; a package not there yet is a warning). The API key is set (nuget-token). Under trusted publishing, NUGET_USER is set, and in CI nuget.org’s exchange for an API key (nuget-trusted-publisher) | Whether a key may push, which nuget.org has no read-only check for. The exchange outside CI |
rubygems | The gem’s name, from a built gem or the .gemspec, and whether the host has it (rubygems-gem; a gem not there yet is a warning, since trusted publishing then needs a pending trusted publisher). The API key is set (rubygems-token). Under trusted publishing in CI, RubyGems.org’s exchange for an API key (rubygems-trusted-publisher) | Whether a key may push. The exchange outside CI |
Under the forge-checks green gate, the default without ci.green, the doctor also finds the forge and the token the cut would ask, and reads the checks and statuses of the commit checked out (green-forge-checks). It fails when no token is set in CI, or when the forge refuses the token, which on GitHub needs checks: read and statuses: read. Whether the commit’s checks passed is the cut’s question, and the line only reports it. A member with no environments, which releases only what release.publish names, is checked the same way.
Under its first line the doctor prints the crypto module it runs on: the Node and OpenSSL versions, and whether Node runs in FIPS mode. In FIPS mode it also says whether SHA-256, ECDSA P-256 and Ed25519 can be fetched there, and warns (crypto-module) when SHA-256 or ECDSA P-256 can’t. --json carries the same as crypto. Signatures and crypto modules says what each of these means for a signature.
When the publish signs with Sigstore and declares an oci, forge or pypi target, the doctor also checks what signing needs from the job it runs in: an OIDC token cosign can sign with (signing-oidc, which names the identity the certificate will carry), or with release.signing.kms the variables its credentials are in, or with release.signing.key the key’s variable or file and its password variable, and the public key either names (signing-key), the trusted root of a private Sigstore instance (signing-trust-root), cosign 3 (signing-cosign), and which cosign build would sign (signing-cosign-build): the file CHANT_COSIGN names or cosign on PATH, its SHA-256, and whether it is the upstream build the release workflow downloads or one the job supplies. The release workflow gives a key’s variables to the publish step alone, so in the cut job a missing one is unknown. Either one missing fails in CI. The generated release workflow installs cosign in the cut job as well as the publish job, and on GitLab gives the cut job SIGSTORE_ID_TOKEN, so the doctor there sees what the publish will.
When the publish scans before the stage (release.scan, or the supply-chain group) and declares an oci, forge or npm target, the doctor checks that the scanner runs, and syft with an oci target (scan-tool), and says where the scanner’s database comes from (scan-database): downloaded on first use, or read from the directory release.scan.db names. With release.scan.imageScanner: "wiz" it also checks wizcli and that WIZ_CLIENT_ID and WIZ_CLIENT_SECRET are set. A missing scanner fails in CI and is a warning on a workstation, so it shows before a cut, which refuses without one (publish-scan-tool-missing), since it scans before it tags the release.
For each registry a release.images entry’s pull names, the doctor checks that its username and password variables are set (image-pull-login): a failure in CI, a warning on a workstation.
Under verified-releases or who-ran-it, when the origin remote is on GitHub, GitLab or Forgejo, the doctor asks the forge, read-only, whether chant/lifecycle refuses force pushes and deletions (lifecycle-protected): the rulesets and branch protection that apply to the branch on GitHub, the protected branches of the project on GitLab, the branch protection rules on Forgejo. An unprotected branch is a warning that says how to protect it. A token that can’t read the setting, or no token, is unknown. See the ref gate.
Under supply-chain, the doctor also reads each Dockerfile release.images names, with the entry’s args, and warns of a FROM that is not pinned by digest (image-base-pinned). See Pin image bases by digest.
Seven checks hand back a short-lived publishing token, which the doctor masks and drops: npm’s OIDC exchange, Open VSX’s, PyPI’s, crates.io’s, nuget.org’s and RubyGems.org’s trusted-publishing exchanges, and the MCP Registry’s token exchange. They are the requests a publish makes first, and crates.io’s token is revoked straight away. No other check sends a request that changes anything. Every line and the --json document go through the publish’s redactor.
--from cut says the doctor runs in the cut job of the release workflow. That job runs the project’s build, so the generated workflow gives it no id-token: write; the publish job holds the permission (on GitLab, its id_tokens). With the flag, the checks that need an OIDC token (the exchanges for npm, PyPI, crates.io, nuget.org, RubyGems.org, Open VSX and the MCP Registry, and a token the target would replace with one) report can't tell and name the publish job, rather than FAIL. The forge target’s write is checked the same way: a cut job whose GITHUB_TOKEN is not granted contents: write reports can't tell and names the publish job. Every other check runs as before, and a job that does have a token still tests the exchange. The generated dispatch workflow passes it, as does workspace train cut --doctor in CI. A tag-triggered workflow’s doctor runs in the publish job and takes no flag.
The release workflow file is release.workflow.file in the workspace root’s chant.config.ts, else the forge’s default (.gitlab-ci.yml on GitLab, whose trusted publishers name the top-level file). In GitHub Actions, the run’s own file comes from GITHUB_WORKFLOW_REF.
--json prints environment (ci, oidc, workflow, repository, releaseWorkflow, and from under --from cut), targets (each kind, name and checks, each with check, status, message and fix) and counts. A config that does not load exits 1 with doctor-config-invalid.
A dispatched release runs it in the cut job before the cut (see The whole release from the config).