On 30 November I bumped CogniPrep's dependencies and added six lines to pnpm-workspace.yaml. The block is four packages long, under a comment that says what it is for:
# Security floors for transitive deps whose parents pin vulnerable versions. overrides: browserslist: ^4.28.7 effect: ^3.22.1 fast-uri: ^3.1.9 vite: ^8.1.6 I have already written about two other ways this repo controls its dependencies: pinning the nine nobody can see and the 24-hour release hold with its waivers. Overrides are a third mechanism, and they do something neither of the others can: they change what a package we do not control asks for.
None of these four is something we installed
I ran pnpm why on each one. Every package hangs off something else.
-
effectarrives through Prisma's config package, pulled in by the Trigger.dev build tooling. It is a dev dependency, two levels down. -
vitecomes from Vitest and its mocker. Test tooling only. -
fast-urisits underajv, underschema-utils, under a webpack plugin, under Sentry's bundler plugin. Seven levels down, and it exists to build the app. -
browserslistis reached through Babel's target helper, and then through Next and Sentry.
None of them is in our package.json. If I wanted a newer fast-uri I could not simply ask for one. Every parent asks for a range, and a parent that pins an exact version wins. The override is the only lever that reaches that deep.
An override is a floor, and the lockfile shows it
I wrote the values as ranges on purpose. The comment says floors, and that is what a caret range gives you: a minimum the resolver may not go below.
Look at what was resolved before and after the same commit:
| package | before | after | floor |
|---|---|---|---|
| browserslist | 4.28.6 | 4.29.6 | ^4.28.7 |
| effect | 3.21.0 | 3.22.5 | ^3.22.1 |
| fast-uri | 3.1.3 | 3.1.9 | ^3.1.9 |
| vite | 8.1.5 | 8.4.0 | ^8.1.6 |
All four now resolve at or above their floor, and three are above it. That is slightly deflating. The lockfile cannot tell me whether the override or the same-day dependency bump moved each package, so I cannot claim the block did anything yet.
The value of the block arrives later. The day a parent re-pins fast-uri@3.1.3 in a patch release, the install resolves at least 3.1.9 anyway, and nobody needs to remember. A pin you write down is a guard against a future version of someone else's file.
fast-uri is the one to watch: its floor equals exactly what was resolved, so it is the entry closest to deciding something.
The lockfile records the rewrite
pnpm does not apply overrides silently. The lockfile gets its own overrides: block at the top, the same four lines, so editing one invalidates the lock. Further down, the entries for packages that depend on vite show a dependency written as vite: ^8.1.6, which is the override's range, not whatever the parent originally asked for. The lockfile is the place to confirm an override took effect.
The commit changed forty-six lines of package.json and rewrote the lockfile with 2,462 insertions and 3,833 deletions, so it shrank. The same commit also moved the framework, next from 16.2.4 to 16.4.6, and React from 19.2.7 to 19.3.1, so the overrides are the small part of a large diff.
A rule of thumb
Write an override only after pnpm why shows you the chain, put the reason in a comment, and write it as a range unless you truly need one exact version. Then check the lockfile, not the yaml.
If you want to see what this tooling is holding up, the product is at cogniprep.app. The free account needs no card, and the practice games are the part of the site that all of this tooling exists to build.