# `upgrade`

`upgrade` moves dependencies **forward** to the newest version that has already matured past its cooldown, then re-locks. It never adopts a too-fresh version — only versions that have cleared the window are proposed. With the [advisory feed](https://romnn.github.io/cooldown/docs/configuration/advisories/)'s `shorten` mode enabled, a candidate that fixes a qualifying advisory clears the shorter security window instead, so a security fix is adopted earlier than a routine bump.

```sh
cooldown upgrade
```

Preview the plan without touching anything with `--dry-run`:

```console
$ cooldown upgrade --tool cargo --major --dry-run
──────────────────────────────────────────────────────────────────────────────────
 Package                   From      To        Status     Reason                  
══════════════════════════════════════════════════════════════════════════════════
 hex                       0.4.2     0.4.3     skipped    pinned to exactly 0.4.2 
                                                          in app; loosen the      
                                                          requirement to adopt    
                                                          0.4.3                   
──────────────────────────────────────────────────────────────────────────────────
 aho-corasick              0.7.20    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 aho-corasick              —         1.1.4     added                              
──────────────────────────────────────────────────────────────────────────────────
 anstream                  —         1.0.0     added                              
──────────────────────────────────────────────────────────────────────────────────
 anstyle                   —         1.0.14    added                              
──────────────────────────────────────────────────────────────────────────────────
 anstyle-parse             —         1.0.0     added                              
──────────────────────────────────────────────────────────────────────────────────
 anstyle-query             —         1.1.5     added                              
──────────────────────────────────────────────────────────────────────────────────
 anstyle-wincon            —         3.0.11    added                              
──────────────────────────────────────────────────────────────────────────────────
 autocfg                   1.5.1     —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 bitflags                  1.3.2     —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 clap                      4.1.0     4.6.1     upgraded                           
──────────────────────────────────────────────────────────────────────────────────
 clap_builder              —         4.6.0     added                              
──────────────────────────────────────────────────────────────────────────────────
 clap_lex                  0.3.3     —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 clap_lex                  —         1.1.0     added                              
──────────────────────────────────────────────────────────────────────────────────
 colorchoice               —         1.0.5     added                              
──────────────────────────────────────────────────────────────────────────────────
 hermit-abi                0.5.2     —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 is-terminal               0.4.17    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 is_terminal_polyfill      —         1.70.2    added                              
──────────────────────────────────────────────────────────────────────────────────
 itertools                 0.10.5    0.15.0    upgraded                           
──────────────────────────────────────────────────────────────────────────────────
 lettre                    0.11.21   0.11.22   upgraded   ⚠ fixes                 
                                                          GHSA-4pj9-g833-qx53     
                                                          (critical); would adopt 
                                                          on the security window  
──────────────────────────────────────────────────────────────────────────────────
 libc                      0.2.186   —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 once_cell_polyfill        —         1.70.2    added                              
──────────────────────────────────────────────────────────────────────────────────
 os_str_bytes              6.6.1     —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 regex                     1.7.0     1.12.4    upgraded                           
──────────────────────────────────────────────────────────────────────────────────
 regex-automata            —         0.4.14    added                              
──────────────────────────────────────────────────────────────────────────────────
 regex-syntax              0.6.29    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 regex-syntax              —         0.8.11    added                              
──────────────────────────────────────────────────────────────────────────────────
 serde                     1.0.150   1.0.228   upgraded                           
──────────────────────────────────────────────────────────────────────────────────
 serde_core                —         1.0.228   added                              
──────────────────────────────────────────────────────────────────────────────────
 serde_derive              —         1.0.228   added                              
──────────────────────────────────────────────────────────────────────────────────
 strsim                    0.10.0    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 strsim                    —         0.11.1    added                              
──────────────────────────────────────────────────────────────────────────────────
 termcolor                 1.4.1     —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 tokio                     1.25.0    1.52.3    upgraded   ⚠ fixes                 
                                                          GHSA-rr8g-9fpq-6wmg     
                                                          (low)                   
──────────────────────────────────────────────────────────────────────────────────
 utf8parse                 —         0.2.2     added                              
──────────────────────────────────────────────────────────────────────────────────
 winapi-util               0.1.11    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 windows-sys               0.42.0    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 windows_aarch64_gnullvm   0.42.2    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 windows_aarch64_msvc      0.42.2    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 windows_i686_gnu          0.42.2    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 windows_i686_msvc         0.42.2    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 windows_x86_64_gnu        0.42.2    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 windows_x86_64_gnullvm    0.42.2    —         removed                            
──────────────────────────────────────────────────────────────────────────────────
 windows_x86_64_msvc       0.42.2    —         removed                            
──────────────────────────────────────────────────────────────────────────────────

6 applied · 17 added · 20 removed · 1 skipped · 0 errors · dry-run (lock untouched)
```


The **From → To** columns show the move from the version your lock had; a row can be a `downgraded` as well as an `upgraded` when your lock already held a too-fresh transitive and the run reconciles it back down (see [Transitive dependencies](#transitive-dependencies)). On Cargo, pnpm and uv, a package the run adds to the lock or drops from it, such as a new transitive a newer release requires, is an `added` or `removed` row (see [Additions and removals](#additions-and-removals)); on the other tools only the lock diff shows it.

For Cargo, pnpm and uv, the rows of a lock are its moves from the lock before the run's first write to it, a refresh of a lock another project staled included, to the lock the run leaves. Each move is proven by one requirement both locks hold:

- a pnpm importer's declaration
- a Cargo workspace member's declaration in the manifest `cooldown` captured beside the lock
- a uv workspace member's dependency entry
- the dependency entry of a package whose own version and source did not change

On uv, an entry is also told apart by its section, the extras it requests and the marker uv recorded for it, and a package's entries continue only while its version, source, fork and, for a local or URL archive, its hash do. So a package uv locks at one version per Python range moves per fork. uv records every marker relative to the lock's `requires-python`, forks and supported environments, so when any of these differ between the two locks, no entry continues and the lock gets no move rows, only an `added` or `removed` row for each release one lock holds and the other does not. uv 0.11.25 and later also record a package's entries relative to where that package, or the extra or group that lists them, is installed, which the lock does not say, so a package's own entries prove a move only where runtime dependency entries without a marker reach the package from a workspace member's own dependencies in both locks, and the entries of a package's extra or group never do. Under declared `conflicts`, uv also leaves out a conflict marker that every path to an entry implies, so in such a lock a member's extra and group entries prove no move either. A row's members are the members whose own declarations moved. Steps in between are never chained, so `web` moving a crate 1.0 → 2.0 while `api` moves it 2.0 → 3.0 are two rows, and a move a later step undid is none. A package whose every requirer changed version with it gets no move row, since nothing proves it moved rather than left and arrived, and neither does an entry that could bind more than one version or a uv fork that split or merged: the version the lock lost is a `removed` row and the one it gained an `added` row. A uv lock that uv itself would refuse to read, with a package locked twice or an entry that names no single package, cannot be compared. A move to another source, index or git revision gets no move row, its two ends a removal and an addition, and neither does a rebind between two versions the lock keeps, which on Cargo is reported as its edge row (see [Lock edge bindings](#lock-edge-bindings-cargo)). A move with the exact versions of a candidate `cooldown` held, such as a copy that advanced for only some of its dependents, gets no row, so it never reads as that candidate landing: the held row stays, and a version that move added or dropped is an `added` or `removed` row. When the two locks cannot be compared, such as when the lock changed between two of cooldown's steps or after its last one, a build that relocks included, the lock gets no rows, edge rows included, and a warning says why. An edit to the lock made while a package-manager command `cooldown` runs is writing it counts as that command's. A uv build-backend floor raised in the manifest alone keeps its row whatever the lock's moves.

Three cases are not detected yet:

- **pnpm packages known by integrity alone:** a pnpm package recorded by its integrity alone in both locks is taken to come from the same registry, so a scope routed to another registry between the two locks can still read as a move.
- **Cargo's in-place path:** on platforms where Cargo cannot stage an isolated trial, `cooldown` captures a member's manifest only when a plan first touches that member, so a move of a member's declaration the first plan did not touch has nothing to pair by and is reported as a removal and an addition.
- **A uv workspace root without a `[project]` table:** it is no package in the lock, which records its own dependency groups by name alone, so a version change of a package only that root requires gets no move row, only a removal and an addition.

The other tools' lock writers cannot prove their lock's moves yet. Their rows are the planned changes of a batch that found the lock as the run first found it and left it as the run leaves it, and one `unpaired_move` warning per lock the run changed says that the lock's collateral changes are unavailable. When two or more batches changed the lock, as a reconcile pass or a second `fix` round does, no batch keeps its rows, whatever the lock the run leaves, so the lock reports no applied row, only the warning, and the run still counts as having applied changes. A build that rewrites the lock is a change too, even on a run no batch changed it in. A build that puts the lock back leaves neither row nor warning, and a build-backend floor raised in the manifest alone keeps its row.

A row that moved for security reasons says so in **Reason** and carries the same `security` object in `--json`, so a fast-tracked adoption is never indistinguishable from a routine bump. The block describes the window, not the outcome, and the wording follows the row:

- **A row that landed:** `⚠ fixes GHSA-… (high); adopted on the security window`.
- **A row the security window made eligible but that did not land** (a skip, an error): `eligible on the security window` instead.
- **A `--dry-run` row that would land:** `would adopt on the security window`.

On a lock `cooldown` pairs, the block is a fact about the row's exact versions: the verdict `cooldown` planned for that same from → to, or else the gate's verdict on the version it lands on. A move through several steps, such as 1.0 → 2.0 → 3.0 with a verdict on each step only, carries none, and neither does a row whose registry label another source shares.

## Additions and removals

On Cargo, pnpm and uv, every release the run added to a lock or removed from it is a row of its own unless a move row ends at it: `added`, with `—` under **From**, or `removed`, with `—` under **To**. A `--dry-run` reports them too. A release is told apart by everything the lock records of it: on Cargo its source and git revision, on pnpm its `packages:` entry, its `resolution` and the patch applied to it, and on uv its source and, for a local or URL archive, its hashes. So a release that switched source at one version is a `removed` row beside an `added` one, even where both sources show the same label. The peers a pnpm package binds are no part of its release, so a package that kept its version and only binds other peers, as after a major of a peer such as `eslint`, gets no row. Such a row carries no update kind, members or security verdict, since the lock alone proves none of them. Its **Reason** names its source when that is not the public registry (`crates.io`, `npm`, `pypi`), by its kind and host alone, such as `git:github.com`, never a path, credential or commit; a local or path release names none. A pnpm package keyed by a git or tarball URL is named by the version its `packages:` entry records; one that left or entered the lock without any version makes the lock uncomparable, though the run still lands its changes. The summary line counts the rows as `added` and `removed`, apart from `applied`, and a run that only added or removed releases still counts as having applied something.

In `--json`, an addition has `from: null` and a removal `to: null`, both with `kind: null`, `applied: true` and `downgrade: false`, and no `direct`, `members` or `security`; `registry` carries the same label as **Reason**, `crates.io`, `npm` and `pypi` included. The summary counts them as `added` and `removed`, and `applied` counts version changes only.

## Lock versus manifest

By default `upgrade` moves the **lock** within your declared version constraint and leaves the manifest alone: a `^1.4` stays `^1.4` while the lock advances to the newest matured `1.x`.

When the target falls outside an **implicit** constraint — most commonly a cross-major bump
(`--major`) past a caret or compatible-release range such as `^5` or `~=5.9` — `cooldown` rewrites
the one owning manifest entry so the version can be adopted, then re-locks. Edits are
**format-preserving** (comments, key order, and spacing are kept), and for a Cargo workspace an
inherited `dep = { workspace = true }` is widened in the root `[workspace.dependencies]`.

An explicit upper comparator written by the author, such as `<6` or `>=5,<6`, is different: it
holds under the default behavior, even with `--major`. Pass `--rewrite` to cross and rewrite that
bound. The same flag still always rewrites an in-range constraint (so `^1.4` becomes `^1.5`), and
on pnpm it is also what converges a workspace *split* — see `multi_version_held` under
[Major versions](#major-versions).

One field is never rewritten, by any flag: **`peerDependencies`** (npm family). That range is not a
declaration of what the package installs but a contract it publishes to *its* consumers, and
widening shifts ranges rather than only loosening them (`>=5.6.0 <5.6.2` would become `^5.6.2`),
which would drop consumers the author still supports. A move that a workspace package's own peer
range provably excludes is reported `peer_held` instead — including a same-line move, since a narrow
bound like `>=5.6.0 <5.6.2` is broken by a mere patch bump. Edit that range yourself to authorize
the move; `--rewrite` does not cross it.

On npm, a dependency a member installs from git or from a local or remote tarball is that
member's direct dependency, but no registry release can replace its source through the
declaration, so `upgrade` and `fix` hold it as `not_eligible`, and it takes no `pinned` status or
declared bound.

A Yarn Classic lock records no workspace member, so `cooldown` discovers the members from the
root `workspaces` field as Yarn 1 does and credits each member the `yarn.lock` entry its own
selector names, the one Yarn's manifest normalization keeps when a name sits in several fields.
Some selectors bind the copy in a way no manifest edit is proven to move:

- a git, URL, `file:`, or `link:` source
- a name the root `resolutions` can rewrite
- a name a workspace package carries
- a `resolved` URL that is no registry tarball

Such a copy is still the member's direct dependency, but `upgrade` and `fix` hold it as
`not_eligible`, naming the member and the reason, and it takes no `pinned` status or declared
bound. An npm alias and a selector the lock does not record bind no copy.

When the members cannot all be discovered (a brace glob, a symbolic link on the way) or the lock
is one Yarn's own reader refuses, `check`, `outdated`, and `upgrade` warn that the rows follow the
root `package.json` alone:

- no member owns a copy
- a landing is judged by the name's newest locked copy
- no member's exact pin is protected from another candidate's resolve

On Yarn Berry (v2+), `upgrade` and `fix` land each target exactly under Yarn 4: every candidate
resolves in a throwaway copy of the project, and only `yarn.lock` is written back, once Yarn proves
it current there. See [Landing on Berry](https://romnn.github.io/cooldown/docs/tools/yarn/#landing-on-berry) for the age gate a landing
runs under and the declarations it holds. A Classic lock is never handed
to a Berry Yarn either, since that Yarn's first install would migrate the lock: when the root
`packageManager` declares Yarn 2 or later, or `yarn --version` in the project reports it, through
a `yarnPath` or Corepack, the run refuses the project and says what to do instead.

On Yarn Classic (v1), `upgrade` and `fix` land each target exactly on Linux, in a throwaway copy of
the project: Yarn installs there with the target pinned, the lock's own selectors are bound to the
entry it recorded, and a second install settles what the target requires, after which only
`yarn.lock` is written back. Every Yarn process runs the Yarn Classic `cooldown` found, whatever a
`yarn-path` names, with lifecycle scripts off, and Linux Landlock (ABI 3, Linux 6.2 or later)
confines what it writes, file contents and directory entries though not metadata such as
permissions, to the copy, Yarn's default cache folder (unless that lies in the project), and the
devices Node opens. A setting that sends such a write elsewhere, such as a modules folder or an
offline mirror, fails the landing with Yarn's own message, and one that keeps Yarn from writing
the lock, such as `pure-lockfile`, publishes nothing. On macOS, Windows, a kernel without
Landlock, or while `YARN_CONFIG` is set, `upgrade`, `fix`, and `outdated` hold Yarn Classic rows
as `not_eligible` before Yarn runs. `--build` runs `yarn install --frozen-lockfile`, which a
`no-lockfile` setting makes ignore the lock.

A package declared in several install fields of one manifest (npm family: `dependencies` beside
`devDependencies` or `optionalDependencies`) is judged by every declaration, not the first: the
target must sit inside each range, and the strictest explicit bound across them caps it. On npm,
pnpm, Bun, and Yarn Classic, a locked copy that every declaration binding it pins exactly is held
at planning (`pinned`), even under `--rewrite`. A *mixed* declaration — an exact pin beside a range, in another field or another
workspace member — leaves the package movable, so the move is planned and the apply holds it
instead of rewriting the pin, even where the lock records only the range (pnpm keeps one specifier
per importer). That row is `pin_held` and names the pin; pass `--rewrite` to rewrite it, or edit it
yourself. Under `fix`, `--downgrade-pinned` rewrites such a pin downward, except a pin beside
another workspace member's range on pnpm, which only an edit reconciles; a held downgrade fails
`fix --strict`, while a held forward move never fails `upgrade --strict`.
An exact pin is any spelling npm reads as one version: `1.2.3`, `=1.2.3`, `v1.2.3`, or
`= v1.2.3`. A rewrite keeps it exact, writing the bare target for a bare spelling and `=target` for
an `=` spelling, and leaves a pin that already admits the target as written; a range that only
carries a `v` (`^v1.2.3`, `>=v1`) is not a pin.

The lock-only default is honored where the tool can pin an exact in-range version without editing the manifest:

| Tool | In-range pin | Behavior |
|---|---|---|
| cargo | `update --precise` | lock-only |
| uv | `lock --upgrade-package` | lock-only |
| pnpm | `update --no-save` | lock-only |
| yarn (Classic) | selector seeding in a confined copy, Linux only | lock-only |
| yarn (Berry) | landing in a copy of the project, writing back only `yarn.lock` | lock-only |
| Bundler | relock with the target as the only candidate | lock-only |
| Hex | relock with the target as the only candidate | lock-only |
| npm, bun | *(no such command)* | always rewrites the manifest |
| Go | `go.mod` *is* the version source | always rewrites the manifest |

Cargo resolver and edge-normalization trials run in an isolated project copy. `cooldown` compares the
source manifests and lock with the preimage used for that trial, then publishes the accepted files
under one owner-only recovery record. On Unix its directory transitions are durable; other
platforms use their best available atomic replacement without promising parent-directory
durability. An interrupted publication can therefore recover the complete
old or accepted state without treating a rejected resolver trial as source-project state.

## Whole-workspace landings (pnpm)

pnpm re-resolves the whole importer graph jointly, and an exact pin is a request for *every*
importer that declares the package. pnpm can land it in some importers and leave one behind (a
subtree whose peers bind the old copy), which would split a package the workspace resolved at a
single version — a runtime break for anything with instance-level state, and one no row would
account for. Such a partial landing is rolled back: the candidate is reported as a resolver
conflict whose row names the importers that took the target and the ones that kept the old
version, and the rest of the batch is re-resolved without it.

When the importer left behind declares the package only in `peerDependencies` — pnpm
auto-installs such a peer and records it in the importer's lock entry, but `pnpm update` has no
install field to advance, and `--rewrite` cannot help because the declared range already admits
the target — the row says so and names the change that lets it move:

- **A library:** adds the package to `devDependencies` as well.
- **An application** (`private: true`): moves the entry to `dependencies`.

Importers the run excludes are not part of that contract. The filtered `pnpm update` never names
them, but when pnpm's native release-age gate rejects the starting lock, or the targeted update
leaves the lock inconsistent, `cooldown` repairs the resolve with an unfiltered install under
temporary overrides for the planned targets, scoped to each target's major line. pnpm applies
those overrides to every declaration whose range intersects that line, so an excluded importer can
move to the target, even when its range admits a newer version; a version its range provably
excludes is never committed.

The excluded importer's manifest is never rewritten, and refusing the move would let the excluded
subtree veto the upgrade, so it is committed and reported as an `excluded_moved` warning naming
the importer and the package; the warning says the move stayed within the declared range only when
`cooldown` can prove it. An excluded importer's exact manifest pin is still protected: a repair
that would move it holds the responsible candidate instead.

The settlement itself is judged case by case:

- **A package the resolver itself splits** — one it was not asked to pin, floated in only some
  importers — is never committed: the batch is refused with the split named, and candidate
  isolation holds the candidate whose landing caused it (a resolver-conflict row carrying that
  detail) while the rest of the batch lands.
- **A split whose managed importers all agree on one version**, with only importers the run
  excludes left behind on the old one, is what the exclusion asked for; it is committed and
  reported as a `duplicate_copy` warning naming those importers, the same kind that names a second
  copy a dependent's own requirement pulls in below the importers' view.
- **Managed importers ending up on two versions** fail the batch however many excluded importers
  stayed behind.
- **A settlement that *re-declares* an excluded importer's dependency** — a changed specifier, an
  entry appearing or disappearing, a version its own range provably excludes — fails the batch
  too. pnpm never does that on its own, and `cooldown` never re-resolves an importer it was told
  to ignore.

Either of the last two refusals leaves the lock as it was and names what the resolve did.

A second copy a *dependent's own requirement* pulls in below the importers' view
(`vite-plugin-solid@2.11` requiring `solid-js@^1.9.15` beside the apps' `1.9.14`) is the
resolver's legitimate answer to that range, so it is committed — and reported as a
`duplicate_copy` warning naming the copy and its requirer (`required at 1.9.15 by
vite-plugin-solid@2.11.14`). For a package that must never run twice — a reactive runtime, a
type checker — list it under [`[tool.pnpm] single-copy`](https://romnn.github.io/cooldown/docs/configuration/selectors/#toolpnpm-single-copy) and the warning becomes a refusal: the
settlement is rejected, the lock restored, and the candidate whose landing added the copy is held
with the copy and its requirer named, exactly as a partial landing is. `--fail-on-new-duplicate`
gates every package for one run without naming any. A gated name is refused even when the second
copy is the one an exclusion asked for (an excluded importer left on the old version): the lock
the workspace installs would still hold two copies.

The report reads each move per copy, from the lock's edges into it. A transitive copy's planned
move lands only when every dependent that bound the old copy now binds the target. A copy that
advanced for only some dependents, or whose target copy was added for other dependents, is held,
and the row names who moved and who stayed. Every copy's own move the lock proves is a row, even
when the copy is not the package's newest, such as an old copy a dependent's range kept on a newer
patch. When a
dependent's records change so that several versions sit on either side, no edge proves which
version replaced which: the versions the lock lost and gained are `removed` and `added` rows
rather than a move, and a planned move of those copies is held. Two copies planned onto the same version are two moves: one
can land while the other is held. When a retry leaves a copy's planned move out and the other
moves advance that copy for only some dependents, that move gets no row either: its target is an
`added` row, and the copy stays held.

## Transitive dependencies

By default `upgrade` moves the **whole graph**: it advances each dependency — transitive ones included — to its newest matured version, and reconciles any too-fresh transitive a re-lock drags in back down, so the new lock is **gate-clean by construction** — a subsequent `check` won't reject it. Advancing a transitive requires an engine that can pin a package no manifest declares: cargo, pnpm, go, uv, Bundler, and Hex have one; **every other adapter (npm, yarn, bun, deno, pip, …) plans direct dependencies only** (their per-package apply needs a declared requirement). A transitive whose parents exclude its matured release (an exact-pinning parent) is reported held rather than forced. On pnpm, each copy of a transitive resolved at several versions advances on its own, through overrides that name the dependents binding that copy; a copy no such override reaches alone (one required through an npm alias, say) is reported `multi_version_held`. `--transitive` relaxes the default:

- **`--transitive hide`** — plan direct dependencies only. A re-lock can still move transitives; such moves stay visible as rows where the lock proves them, and as `added` and `removed` rows where it cannot.
- **`--transitive allow`** — still advance the graph, but leave a floated-up too-fresh transitive in place (reported, not rolled back).

## Held candidates

A candidate the whole-graph resolve could not land is reported `skipped`, and its **Reason** says
which of two things happened, because the way forward differs:

- `graph_ceiling_held` — the resolve **succeeded** and kept the candidate below its target:
  another package's requirement caps it there, and moving it would regress that package. The row
  names the capping package (`held: conflicts with <package>`), or says `held: another package's
  requirement caps it below the target` when it cannot.
  On uv the row says more. It names the requirement the capping package declares when `cooldown`
  can read it (`held: conflicts with docling-ibm-models 3.14.0, which requires
  transformers<5.9.0,>=4.42.0 on sys_platform == "darwin"`). uv reads a workspace source's
  requirement from the lock and a registry package's from the release's PyPI metadata, since a
  modern `uv.lock` records only the resolved edge for those, so a cap two packages share is still
  attributed. When one of the capping package's next releases lifts the cap, the row says which
  and where it stands against the window (`; the cap lifts in docling-ibm-models 4.0.0 (published
  2026-09-03, in cooldown until about 2026-09-17)`), so a hold that only waits on another
  package's cooldown reads as such. A cap the candidate's own target creates — its release
  requires a sibling under a range the locked sibling violates — names the sibling instead
  (`held: conflicts with openai 3.1.2: litellm 1.91.5 requires openai>=2.20.0,<3.0.0`). When no
  requirement can be read, the row names the sole package whose edge reaches the candidate
  (`held: conflicts with huggingface-hub`).
  Wait for the capping package to mature, or move it; the candidate itself is not the thing to
  force.
- `resolver_conflict` — the resolve **failed** with this candidate in it, and `cooldown` isolated
  it and applied the rest. The row carries the resolver's own explanation from its failure
  sentence on, folded onto one line (`the resolver rejected this change: No solution found when
  resolving dependencies … Because litellm==1.91.5 depends on openai>=2.20.0,<3.0.0 and your
  project depends on litellm==1.91.5, we can conclude that … your project's requirements are
  unsatisfiable.`), so the requirement that conflicts and who declares it are on the row. This
  usually means a constraint you own excludes the candidate: change it, or keep the hold.
  A resolve that succeeds without landing the requested target, when `cooldown` finds the miss only
  by reading the resolved graph back, is a `resolver_conflict` too, since a mismatch alone does
  not show why: the row says what the resolve left instead (`requested 4.1.0, resolved 4.1.2`).
  On Cargo, a refusal over a node a workspace member pins exactly names that pin first (`held by
  the exact pin of gpui-pre = 0.3.9 in a workspace member; failed to select a version for
  gpui-pre …`). A move Cargo resolved but `cooldown` restored for breaking one of its own rules,
  such as resolving a direct dependency at a second incompatible line, carries that rule's
  explanation rather than a later Cargo refusal of the same move.

Both fail a `--strict` run. `outdated` reports the same rows as `blocked`, with the same sentence
in `blockedReason` and under `--why`.

On Cargo, a direct dependency that another package pins exactly with `=` is still planned and
tried. The batch can move that package or drop it from the graph, as `wasm-bindgen` 0.2.105 drops
`wasm-bindgen-backend` and with it the backend's pin on `wasm-bindgen-shared`, so only the resolve
can tell whether the pin survives. When it does, the row is `resolver_conflict` with Cargo's
sentence naming the pin, as `--package wasm-bindgen-shared` alone shows (`failed to select a
version for the requirement wasm-bindgen-shared = "=0.2.104" (required by wasm-bindgen
v0.2.104)`), and it fails `--strict` like any other.

A direct dependency its own exact pin holds below a matured target is never moved, but it is
listed as `pin_held`, naming the pin and the members declaring it (`pinned to exactly 0.3.9 in
app; loosen the requirement to adopt 0.3.11`). Like every forward move a pin holds, it never fails
`--strict`.

## Fast mode

By default `upgrade` searches until it has landed every upgrade it can, however long that takes.
`--fast` trades that optimality for speed. It never trades correctness: every version it lands
passes the same cooldown, `max-major`, pin, and transitive gates and the same lock verification
as a full run. It may land fewer upgrades, but each one it lands is a planned target in a
resolve those gates checked.

It shortens two Cargo searches; every other tool runs exactly as without it:

- **Older-version fallback.** When the resolve cannot land a candidate's target, a full run
  retries up to three older matured versions on the same line, first for all held candidates
  together and then for each alone. `--fast` skips those retries and commits what the planned
  targets landed.
- **Joint widen culprits.** When a joint resolve of several widened requirements breaks the
  acceptance rule, a full run drops the candidates the first violation names and resolves again,
  one round per culprit. `--fast` drops every culprit the resolve names at once. Each dropped
  candidate still gets its own attempt, but one that would only land together with another
  culprit may stay held.

A held candidate keeps the reason its planned target got, so `--strict` judges it as it would a
held candidate of a full run. The run adds one `config` warning per project naming every candidate
that stayed held, and the older matured versions it did not try, since a run without `--fast` may
still land some of them:

```text
warning [config] --fast shortened the upgrade search, so a run without it (`--no-fast`) may still
land some of these held candidates or an older matured version of them: web-sys 0.3.103 → 0.3.107
(older matured versions not tried: 0.3.106, 0.3.105, 0.3.104)
```

`fast = true` under `[global]` or `[upgrade]` makes it the default; `--no-fast` runs the full search
over such a config. Only `upgrade` reads it, so `outdated`'s blocked reasons always come from the
full search.

## Lock edge bindings (cargo)

A `Cargo.lock` records not only which versions exist but which coexisting version each dependent's
edge is **bound** to (`dependencies = ["uuid 0.8.2"]`). When a crate declares a range wide enough to
admit two locked versions at once — diesel's `uuid = ">=0.7, <2.0"` beside both a `0.8` and a `1.x`
line — cargo's incremental re-resolves can silently rebind that edge between them. The rebinding is
build-affecting (the dependent compiles against the other copy) yet invisible at the version level,
and `cargo metadata --locked` accepts either binding. `--cargo-edge-policy` decides what
`upgrade`/`fix` do about it:

- **`preserve`** (default) — restore an addressable, unambiguous crates.io edge the re-resolve
  rebound between two still-coexisting versions when its earlier binding still satisfies the
  active requirement.
- **`canonicalize`** — `cooldown`'s owned normalization: bind each addressable, unambiguous crates.io
  edge to the **highest** locked version satisfying the dependent's active requirement, preferring
  candidates whose declared `rust-version` is workspace-compatible and falling back to the
  highest satisfying candidate when none is compatible — a cooldown-owned conservative tier
  inspired by cargo's `incompatible-rust-versions = "fallback"` rule. Unlike
  `preserve` this also heals bad bindings that predate the run, including on a run that applies no
  version change at all. It is a policy over the existing package set, not a re-run of cargo's
  resolver: a workspace on resolver v1/v2 (default `allow`) may see a fresh cargo resolve bind a
  higher, MSRV-incompatible version where `canonicalize` keeps the compatible one.
- **`none`** — leave bindings exactly as the resolver produced them.

Every rebind is reported as its own row naming the dependent whose edge moved, with one of these
statuses:

- **`restored` or `canonicalized`:** a corrected rebind.
- **`held`:** a withheld one.
- **`unaddressable`:** one that cannot be mapped safely to a declared requirement.
- **`rebound`:** a surviving one.

A `restored` row shows the binding the lock kept in both From and To, and its reason
names the binding the re-resolve had chosen (`kept 0.11.0 for prost-derive 0.14.6 (crates.io); the
re-resolve had rebound it to 0.14.0`); in JSON its `from` stays that transient binding. An edge
row names every source, in its `registry`, its `dependentSource` and its `detail`, by a label of
the source's kind and host, such as `sparse:index.example.com` or `git:github.com`, or
`crates.io`, so a token in a private index's or Git remote's URL path never shows. Two sources
that share a label in one report, such as two indexes on one host, are numbered `#1`, `#2` in the
order the report lists them in, and each keeps its number on every row of the report; the
numbers say nothing about the sources themselves, and only rows alike in everything else they
show take their numbers in a random order.

Observation excludes package-set changes, which are not attributable binding-only moves:

- a dependent whose own lock identity changed
- an unpaired entry that appeared or vanished
- renamed entries of one dependent whose moves could pair in more than one way
- an endpoint that did not coexist in both snapshots

Under `preserve` or `canonicalize`, renamed entries that moved
among versions the lock keeps in a way that pairs more than one way still get no row, since no row
could say which entry moved where; when the run's last audit finds such entries, a warning says the
policy cannot verify them, and the run is incomplete under `--strict`. This includes an entry Cargo
only respelled with its source, as it does once a second source locks the same version: the lock
alone cannot tell that from a move, so such a run warns and fails `--strict` under these policies
even though no binding changed. The same warning covers a changed entry that names no single
package block, such as a Git dependency entry that matches two commits. The report is audited from the
run-start and final locks, so a temporary held attempt
that a later batch resolves does not fail `--strict`, and a correction later overwritten does not
remain `applied`. Across passes and reruns, each later pass that starts from the lock the
previous step left audits from the lock before the run's first write, a refresh of a lock another
project staled included, with the earlier audit's corrections as evidence, so `preserve` restores a
binding to the one you had before the run and a rebind a later pass undid is dropped. A pass that
finds the lock changed since, such as by your own edit between two passes, leaves its edge bindings
as it found them: it writes nothing over that edit and reports no edge row, a warning says why, and
a corrective policy is incomplete under `--strict`. Only the last audit is reported, and only while it describes
the lock the run leaves: a lock written after it, such as by a build, gets no edge rows and a
warning, and a corrective policy is then incomplete under `--strict`. Corrections are applied as targeted lock edits and re-verified with
`cargo metadata --locked`. A concrete correction rejected by the orphan guard or verification is
`held`, with `to` naming the withheld target; when the resolver also moved that edge, a separate
`rebound` row records the committed move. If a renamed multi-version or source-qualified lock
entry moves but cannot be mapped safely to one declared requirement, it is `unaddressable` rather
than being mislabeled as an ordinary rebound. A member declared in
[`generated-members`](https://romnn.github.io/cooldown/docs/configuration/selectors/#toolcargo-generated-members)
has its requirements rewritten to follow the run's moves, so its own edges moving is that follow
rather than a rebind: their `rebound`/`unaddressable` observations are not rows (a correction or a
held attempt on such an edge still is). The JSON summary counts edge activity apart from
version changes (`edgesCorrected`, `edgesRebound`, `edgesHeld`, and `edgesUnaddressable`); each edge row's `applied`
says whether its binding outcome is present in the committed lock, while top-level `applied` says
whether `cooldown` wrote a mutation. Either `held` or `unaddressable` fails a `--strict` run because
the corrective policy is incomplete. The policy is cargo-specific, so its config placement is too:
set `edge-policy` under `[tool.cargo]` in the nearest applicable `cooldown.toml`. A nearer project
config overrides a farther one, an explicit `--config` overrides both, and the CLI flag overrides
all of them.

## Major versions

A cross-major bump is usually breaking work you opt into, so `--major` is **off** by default for `upgrade`. With `--major` it applies to every eligible dependency; narrow it to a subset with `--package`:

```sh
cooldown upgrade --major -p 'serde*'
```

When `upgrade` holds a cross-major update back, it explains the required action:

- `needs --major` means re-run with `--major`.
- `declared_bound_held` means pass `--rewrite` to cross and rewrite the manifest's explicit
  `<`/`<=` bound. Bundler and Hex never rewrite the manifest (`Gemfile`, `mix.exs`), so there the
  row asks you to loosen the requirement yourself, and `--rewrite` leaves the bound in place. Only
  cargo, uv and the npm family widen a bound.
- `max_major_held` means raise the package's `max-major` in `cooldown.toml`; no CLI flag overrides
  this ceiling. When the row names another package, adopting the candidate would lift that package
  above its own ceiling.
- `dist_tag_held` (npm family) means the target sits above the registry's current `latest`
  dist-tag, so it is not what a default `npm install` would resolve to today. Version-adopting
  commands (`upgrade`, `fix`) revalidate the package document against the registry so the mutable
  tag is judged live; read-only `outdated` may see a copy up to an hour old (`--fresh` forces
  live reads everywhere). Pass
  `--no-respect-dist-tags` (or set `respect-dist-tags = false` under `[global]` or a command
  section in `cooldown.toml`) to adopt it deliberately.
- `multi_version_held` (pnpm) means the workspace declares the package under ranges that do not
  all admit the target (`~7.3.0` beside `^7.0.0` for a `7.4.0` target, `^3.4.19` beside `^4.3.3`
  for a v4 one), so pinning every importer to it would drag the narrower one off its own declared
  range; each importer is kept on its own line instead. Only a range that provably *excludes* the
  target — or one `cooldown` cannot judge (a `||` union, a hyphen range, a dist tag) — holds: two
  importers on `^4.17.20` and `^4.17.21` both take `4.17.22`, and one range resolved at two
  versions converges on a target it admits. An importer the run excludes (`exclude-folders`,
  `exclude-packages`, a `-C` selection) contributes no range and no version to this judgment, so
  a copy `cooldown` was told to ignore cannot hold an update in an included importer; the report
  says when such a copy is left behind on its old version, or moved within its own range because
  `cooldown`'s override repair reaches every importer whose range intersects the override. Pass `--rewrite`
  to converge a genuine
  split: every declaring importer's range is widened to admit the target and the name is pinned
  there. A name planned at two targets (a `^22` and a `^25` line each advancing within itself
  without `--major`) cannot be pinned by one joint update — even when one permissive range such as
  `>=22` admits both — and stays held until `--major` admits one line for every importer.
- `peer_held` (npm family) means a still-present dependent's recorded peer range excludes the
  target (`held: fumadocs-mdx@15.1.1 requires fumadocs-core@^16.0.0`) — pnpm's resolver only
  warns on that break, and npm, which rejects it by default (`ERESOLVE`), commits it under
  relaxed enforcement such as `legacy-peer-deps`. Upgrade the dependent itself. The two package
  managers differ:

  - **pnpm:** both can move in one run. The joint move is the whole-graph resolve's decision, and
    `cooldown` re-checks the result — a landing that provably breaks a recorded peer contract
    *between packages your workspace itself declares, in a context that demonstrably binds them*
    (npm's hoisted tree is judged physically, pnpm importers by their own declarations) is
    rejected and rolled back. Contracts involving transitive packages, contexts that never bind
    the moved copy, or unprovable ranges stay the resolver's call, so still review its peer
    warnings on a joint move.
  - **npm:** moves apply one at a time with no joint resolve, so the target stays held while the
    dependent moves — and the dependent's own landing is verified after the fact: if its *new*
    peer range provably excludes the still-held target (which relaxed enforcement like
    `legacy-peer-deps` would commit with only a warning), that move is rolled back too. A lockstep
    pair whose new versions admit only each other therefore stays held on both sides, each row
    naming the other; move such a pair in one command (`npm install react@19 react-dom@19`) and
    `cooldown` maintains it from there. A dependent whose new range still admits the current
    version lands normally, and the next run releases the hold.

  A *workspace-local* dependent (a `workspace:*` package, symlinked or injected — or the root
  project itself, which peer-requires the moving package) never moves in a run, and `cooldown`
  never rewrites its published contract, so editing its own `peerDependencies` range is what lifts
  that hold. Such a hold applies to same-major moves too, since a narrow author-written bound can
  exclude a patch bump. There is deliberately no flag to force the break.

Only a matured release beyond the hold is reported. A fresh release still in cooldown does not
produce an action that cannot yet be taken. Suppress command tips with `--no-suggestions`.

On the npm family, a held cross-major target does not cost the move on the current line. When the
planned major is held or rejected (`peer_held`, `multi_version_held`, `pin_held`, a resolver
conflict, a transitive it would drag into cooldown), `upgrade --major` still tries the newest
matured release on the current major line in the same run, the release `--no-major` would take.
That move is reported as its own applied row beside the held major row, which keeps its reason,
and `outdated --major` reports the in-line release as the row's adoptable target. A package held as `not_eligible` has no
editable requirement to move, so it is not retried; a `pin_held` major is, since the pin can admit
the in-line release. The retry is bounded and best effort: one attempt with
every such in-line move on top of what already landed, then one per package when there are
several. Nothing that already landed is traded away for it.

## Projects that resolve against each other

A project can resolve against another project's manifest: a cargo-fuzz crate or a nested workspace
that reaches a root workspace member through a `path` dependency reads the root's
`[workspace.dependencies]`. When the run rewrites that manifest, the other project's lock goes stale
because of the run itself, not because it was left stale.

So before anything moves, a run over several projects of one tool records which of their locks are
current, for the tools that can refresh a lock on their own (cargo and pnpm, the ones
[`check --lock`](https://romnn.github.io/cooldown/docs/commands/check/#flags) refreshes). When a recorded lock is stale by its
project's turn, the run refreshes it with that same command and reports a `stale_lock` warning
naming the cause. It
then runs a `fix` pass under the same `--transitive` mode before the upgrade itself, because a
refresh resolves whatever is newest and the upgrade would otherwise accept that as its starting
point; the refreshed lock ends gate-clean. A project whose lock goes stale only after its turn,
because a later project rewrote a manifest it reads, is caught by a second probe once every project
has run, and runs again the same way. Projects that keep staling each other are re-run for up to one
round per recorded project; a lock still stale after that is a `stale_lock` error that names the
cause, or a warning under `--allow-stale-lock`.

A lock that was already stale when the run began is not the run's doing: it keeps the ordinary
`stale_lock` error (a warning and a skipped project under `--allow-stale-lock`). A `--dry-run`
mutates only a throwaway copy, so it never stales, probes, or refreshes a lock.

## Flags

| Flag | Effect |
|---|---|
| `--transitive <mode>` | `allow` or `hide` — how to treat transitive dependencies (see above). |
| `--rewrite` | Always rewrite the manifest constraint; also the only way to cross an explicit `<`/`<=` bound, and (pnpm) to converge a workspace split onto one line. |
| `--cargo-edge-policy <policy>` | cargo: `preserve` (default), `canonicalize`, or `none` — how lock edge bindings are treated after the re-resolve (see above). Config: `[tool.cargo] edge-policy`. |
| `--build` | Also compile / sync after re-locking. |
| `--major` | Allow cross-major bumps; explicit manifest bounds, config `max-major` ceilings, and the npm `latest` dist-tag still hold. |
| `--no-respect-dist-tags` | Adopt npm-family releases above the `latest` dist-tag too. |
| `--strict` | Exit `1` if the mutation cannot complete cleanly. |
| `--fast` | Trade optimality for speed: Cargo skips the older-version fallback trials and drops every joint-resolve culprit at once. Every landed version still passes the same gates; fewer upgrades may land, and a `config` warning names the candidates that stayed held (see [Fast mode](#fast-mode)). `--no-fast` overrides a config `fast = true`. Config: `[global]`/`[upgrade] fast`. |
| `--fail-on-new-duplicate` | Cargo and pnpm: refuse a resolve that gives *any* package a second resolved copy — the candidate whose landing added it is held with the copy and its requirer named and the lock restored — instead of committing it with a `duplicate_copy` warning. Config: `[global]`/`[upgrade] fail-on-new-duplicate`; `[tool.pnpm] single-copy` gates named packages on every run. On a tool without Cargo or pnpm's settlement guard the flag has no effect and the run says so. |
| `-n, --dry-run` | Resolve and print the plan; never mutate (env `COOLDOWN_DRY_RUN`). |

`upgrade` always re-locks. Use `--dry-run` whenever you want to see the plan first; combine it with
`--json` to feed the plan into other tooling. The JSON envelope sets its top-level `dryRun` field
to `true` for a preview and `false` for a real mutation, independently of whether every proposed
item ultimately lands.
