check
On this page
check is the fail-closed CI gate. It evaluates the resolved lockfile graph — direct and transitive — and exits non-zero if anything is younger than its cooldown. It reads the lock as-is and never mutates it; --lock is the one opt-in exception.
cooldown check$ cooldown check --tool cargo
✓ 72 dependencies pass the cooldown gate (lockfile-graph scope).
checked 72 (10 direct) · 0 violations · 1 exempt · 1 security-relevantA clean run exits 0. When a dependency is too fresh, check lists the violation and exits 1. Here the same project under a 30-day window: four transitives are younger than that, and each row names its graph floor, the lowest version its requirers allow:
$ cooldown check --tool cargo --min-age 30d
──────────────────────────────────────────────────────────────────
Package Version Cooldown Status Notes
══════════════════════════════════════════════════════════════════
displaydoc 0.2.6 26d/30d violation graph floor 0.2.3
──────────────────────────────────────────────────────────────────
memchr 2.8.2 10d/30d violation graph floor 2.4.0
──────────────────────────────────────────────────────────────────
smallvec 1.15.2 10d/30d violation graph floor 1.13.1
──────────────────────────────────────────────────────────────────
yoke 0.8.3 18d/30d violation graph floor 0.8.2
──────────────────────────────────────────────────────────────────
checked 72 (10 direct) · 4 violations · 1 exempt · 1 security-relevantBecause the gate is fail-closed, a non-zero exit is its contract — wire it into CI as-is and a too-fresh dependency stops the build. See Exit codes for what each code means.
The risk surface is the resolved graph#
check evaluates direct and transitive dependencies by default, because the resolved graph — not your manifest — is what actually ends up in your build. A floor applies to transitive dependencies too.
For a too-fresh transitive you can’t act on (a graph-held pin, or one you’d rather not block CI on), --transitive relaxes the gate — but the strict default stays opt-out, never opt-in:
--transitive allow— keep too-fresh transitives visible but non-fatal.--transitive hide— skip evaluating transitive dependencies entirely (a direct-only gate).
Flags#
| Flag | Effect |
|---|---|
--transitive <mode> | allow (visible, non-fatal) or hide (direct-only). Default: fail on too-fresh transitives. |
--all-artifacts | Gate every artifact in a universal lock, not just the ones relevant to the current environment. |
--fail-on-unknown-age | Fail (rather than warn) on dependencies with no known publish time. |
--lock | Refresh lockfiles before checking (mutates lockfiles; ignored under --dry-run). Cargo runs cargo update --workspace (a missing lock is generated and the members’ own requirements re-resolved; a locked version the manifests still admit stays put, one they no longer admit is re-resolved or dropped) and pnpm runs pnpm install --lockfile-only; the other tools, npm among them (re-lock with npm install), have no standalone refresh, say so with a warning, and read the existing lock as-is. Only the projects the run evaluates are refreshed (-C incubator refreshes the nested workspace’s lock, not the enclosing one’s), and every such project is refreshed before --package narrows the rows. A refresh the tool rejects is an error even under --allow-stale-lock, and --offline rejects the flag outright because the refresh needs the resolver’s network access. The refresh is the tool’s own resolve against the manifests as written, so [tool.pnpm] single-copy does not judge it. |
--fail-on-stricter-native | Fail (exit 2) when repo policy overrides a stricter native cooldown value. Config: top-level strict-native = true. |
--no-fail-on-stricter-native | Turn off a config-set strict-native (the only way to disable it on the CLI). |
--fail-on-advisory-source | Fail (exit 4) when the enabled advisory feed yields no usable evidence — unreachable, unimplemented, or too stale to shorten — instead of warning. An uncovered ecosystem stays a warning. |
Security-relevant pins#
With the advisory feed enabled, a locked version
that is itself an advisory’s fix version is counted in the summary (… · 1 security-relevant) and
carries a security object in --json. Under the feed’s shorten mode such a pin resolves
against the shorter security window, so merging a security bot’s bump stops failing the next gate
run. The TTY Notes column adds security window applied, and the Cooldown cell names the advisory
that shortened it, so the shorter number cannot be mistaken for ordinary configuration.
check never fails because a pin is vulnerable — that job stays with govulncheck /
cargo audit, so exit 1 keeps exactly one meaning.
Handling a red gate#
When check goes red, there are three ways forward — covered in Getting started:
- Wait for the version to mature.
baselineit — acknowledge the specific version socheckadopts it cleanly.fixit — downgrade the violating dependency to a matured version.
Note
check never trusts a backdated timestamp: a cached publish time may only ever move later on refresh (a monotonic floor), so an upstream that reports an earlier date is rejected, not adopted. See the Security model.
Unknown ages and stale locks#
A dependency whose publish time can’t be determined is reported as
unknown-age. By default that is a warning;--fail-on-unknown-agemakes it fatal, and--offlineturns every cache miss intounknown-agerather than a false “ok”.A stale or absent lock is an error (exit
4) by default, because gating an out-of-date graph is meaningless. The error names the project whose lock is stale (Cargo.lock is stale in /repo/incubator; run …), so in a repository with several lockfiles you know which one to refresh.--allow-stale-lock(orCOOLDOWN_ALLOW_STALE_LOCK) demotes it to a warning and skips dependency evaluation for that project; the stale graph is never treated as checked. Only the tool’s own stale-lock verdict counts:- npm:
npm ci’sEUSAGErefusal of a lock out of sync withpackage.json, or of a missing lock. - pnpm: the frozen verification’s
ERR_PNPM_OUTDATED_LOCKFILE,ERR_PNPM_LOCKFILE_CONFIG_MISMATCH,ERR_PNPM_NO_LOCKFILE, orERR_PNPM_FROZEN_LOCKFILE_WITH_OUTDATED_LOCKFILErefusal. - Yarn Berry:
YN0028(the lockfile would be modified). - Poetry:
poetry check --lock’s refusal of a lock whose content hash no longer matchespyproject.toml, or of a missing lock, when it is Poetry’s sole error beside nothing but warnings.
Any other verification failure, such as a registry, authentication, or configuration error, is a
tool_failederror that--allow-stale-locknever demotes. Refresh in place with--lockwhen the project must be evaluated.- npm:
A lock whose currency cannot be established is reported
lock_unknown, an error--allow-stale-lockdoes not waive.checkestablishes it for the locks of Cargo, Go, uv, Poetry, npm, pnpm, Bun, Yarn Berry, Yarn Classic, Bundler, Hex, Swift, and Deno, each verified by its own tool; every other lock, pip’srequirements.txtamong them, is alwayslock_unknown. Five of these checks have limits of their own:- npm: verifies a
lockfileVersion2 or 3package-lock.jsonwithnpm ci --dry-run, which needs npm 10.5.1 or newer. A lock its check cannot cover, such as one beside annpm-shrinkwrap.json, under a configuredworkspacefilter, or with anoverridesentry naming another source than a registry range, is unknown rather than current. - Bun: verifies a text
bun.lockwithbun install --frozen-lockfile --dry-run, which needs a stable Bun 1.4.5 or newer. A lock its check cannot cover, such as one whose cache configuration is disabled, under an enclosing workspace, or whose workspace members or a member’s version differ from what the lock recorded, is unknown rather than current. - Poetry: verifies a
poetry.lockwithpoetry check --lock, which needs a stable Poetry 2.3 or newer. A lock its check cannot cover, such as one with a URL, git, or path dependency, a package source other than PyPI, a project plugin,project.dynamic, an unsupportedlock-version, or no packages whilepyproject.tomldeclares some, is unknown rather than current. - Yarn Berry: Yarn itself verifies the lock, offline, in a throwaway copy of the project, so a lock that would need registry metadata to judge, or a configuration the copy cannot reproduce, is unknown rather than stale.
--lockrefreshes no Berry lock. - Yarn Classic: Yarn Classic verifies the lock by writing it in a throwaway copy, as a landing does, so it is unknown off Linux, under
--offline, and wherever Yarn exits without writing it.
- npm: verifies a