Originally published on Algosize — service provisioning by algosize.com.
A dependency audit can become a backlog that nobody feels able to finish. New advisories arrive, several findings point to the same package, and the team responsible for remediation is also trying to ship features. Treating every finding as a separate project makes routine updates slow and leaves difficult migrations buried in the queue.
The better workflow groups fixes by the change they require, then prioritizes them by actual exposure and urgency. Compatible updates can often move together. Breaking changes, abandoned packages, and issues without a fix need their own engineering plan.
The original headline used a 95/4/1 split. That is not a measured distribution a reader should assume for their codebase. This revision replaces the percentage claim with a procedure for establishing the split from the actual dependency tree.
Triage by compatibility and exposure
Start with the package manager’s machine-readable audit report and the locked dependency graph. Identify the advisory, affected versions, dependency paths, available remediation, and whether the vulnerable behavior is reachable in the application or build process.
Then group the work:
- Compatible updates: a fixed version can be resolved within the accepted dependency constraints, with a reviewable scope.
- Changes requiring focused review: the version is nominally compatible but affects a sensitive integration, runtime behavior, or a package with uncertain compatibility practices.
- Migrations or unresolved issues: the fix needs an incompatible version, a replacement dependency, or a temporary mitigation because no acceptable fix is available.
Semantic Versioning expresses a publisher’s compatibility contract. A patch version is intended for a backward-compatible bug fix; it is not proof that a release cannot break your application. Versions below 1.0 also need particular attention. A package’s release history and the way the application uses it matter alongside the version number.
Keep urgency separate from implementation size. A small fix for an exposed, actively exploited issue should not wait for a calendar slot. A major migration can be urgent even when it is inconvenient.
The batch-remediation PR
Use a clean branch and the same Node and package-manager versions as CI. Preview the remediation, inspect the resulting change, and run the checks that exercise affected integrations.
For an npm project, a starting sequence is:
git switch -c chore/dependency-remediation
npm ci
npm audit --json > audit-before.json
npm audit fix --dry-run
npm audit fix
git diff -- package.json package-lock.json
npm ci
npm test
npm run build
npm audit --json > audit-after.json
Run these commands deliberately rather than treating the block as an unconditional release script. Audit commands normally exit nonzero when findings remain; distinguish that result from a failed audit request. Adapt npm test and npm run build to the project’s actual verification commands. The audit JSON files are local review records, not files to commit automatically.
npm audit fix attempts available compatible remediation through npm’s installation process. It does not automatically create explicit overrides for every transitive issue. Avoid adding --force to a routine sweep: it can permit changes outside declared ranges, including major-version changes.
npm update is a broader maintenance command that respects dependency constraints. With a caret range, it may include minor updates. Calling it “patch-only” hides a meaningful difference in scope. Keep general updating separate when it would make a security change too difficult to review.
A batch should be large enough to remove repeated overhead and small enough to understand and roll back. If a release changes a critical parser, authentication integration, or payment path, that component may deserve an isolated PR even when its version change is small.
The fixture/snapshot trap
Dependency updates can change snapshots, error strings, request metadata, or serialized output. Some differences expose brittle tests; others expose a real compatibility or security change. The failure alone does not tell you which.
Ask what the assertion protects. If a test compares an incidental timestamp, it may be better to assert the behavior that matters. If it checks signed bytes, a public response schema, or a persisted format, an exact comparison may be essential.
Do not regenerate snapshots simply to make CI green. Read the difference, determine its effect on consumers, and update the test only when the new behavior is intended. Record the reason in the PR so a future reviewer can distinguish an accepted change from a missed regression.
CI: lockfile drift, not just audit
Use both change-level and scheduled scanning. A PR check can identify newly introduced vulnerable dependencies or worsening exposure. A scheduled scan can detect advisories published after the last code change.
If a PR check compares against main, scan both dependency trees against the same advisory snapshot where practical. Comparing today’s branch report with last week’s stored baseline can misclassify a newly published advisory as a dependency change. Document how the tool groups package paths and advisories so its count has a clear meaning.
Existing findings still need owners, deadlines, and escalation. A notification without a response process is a quieter backlog. Let severity, exploitability, exposure, and available mitigation determine urgency; a two-week batch cycle is a maintenance cadence, not a promise to postpone every issue until then.
Build-time dependencies also deserve analysis. A package that is not shipped in the application can still affect the code or artifacts produced by CI. Classify its exposure instead of automatically dismissing it as “dev-only.”
Minor updates and sensitive integrations
A minor update may fit the ordinary batch or require a focused PR. Use the release notes, consumed API surface, compatibility history, and tests to make that decision.
A compact review record should state the old and new versions, why the change is needed, which application paths use the package, and what was verified. It should also identify any configuration or lockfile changes and the rollback plan.
For example, an HTTP client update might need checks for timeouts, redirects, proxy configuration, and error handling. Those tests are more informative than counting how many import statements refer to the package. Keep the effort proportional to the integration rather than assigning a fixed review time to every library.
Major updates and unresolved issues
A major-version fix needs an explicit migration plan: identify consumers, understand changed behavior, update integration code, and verify the result. If the issue is exposed, choose a deadline or mitigation appropriate to the risk rather than leaving the work indefinitely on a roadmap.
Sometimes the right action is to remove a dependency or stop using the affected feature. Sometimes a narrowly scoped override is appropriate, but it needs evidence that the parent package remains compatible. Record such overrides as temporary decisions to revisit, not invisible patches that accumulate forever.
If no fix is available, document the exposure and the compensating control, assign an owner, and set a review date. “No patch” is a state to manage, not a resolution.
Illustrative backlog: 241 findings
Consider a hypothetical audit with 241 findings. Suppose review shows that compatible upgrades address 228, nine need focused compatibility work, and four require migrations or replacements. These are illustrative numbers, not a customer result or a claim about typical repositories.
The useful output is a plan: one or several coherent compatible-update PRs, nine bounded reviews, and four owned migration decisions. Several findings may share one underlying dependency, so the number of tasks can be much smaller than the count on the dashboard.
After each change, rescan and retain the evidence. Confirm the dependency paths that disappeared and investigate any unexpected additions. The result is not just a lower count; it is a clearer explanation of what changed and which risks remain.
A workflow you can paste into a runbook
- Inventory the locked dependency tree and capture a current audit report.
- Triage urgent exposure immediately; assign an owner to each unresolved risk.
- Group compatible, reviewable fixes into scheduled PRs. Separate changes that need focused integration work.
- Preview and inspect the updates, perform a clean install, and run the relevant build, tests, and smoke checks.
- Compare the new report, document residual findings, and review the deployment and rollback plan.
- Track migrations and exceptions to deadlines. Rescan on a schedule and respond to new information.
A dependency program should make routine work routine while keeping the difficult decisions visible. Batching can reduce overhead, but evidence still decides what is safe to release. A declining audit count is useful; a maintained explanation of the remaining exposure is more useful.
Service provisioning by algosize.com — algorithm and allocation profiling, vulnerability scanning, and cloud cost analysis for engineering teams.