Resolving a dependency-audit finding
This procedure is implemented as a script, not just documentation: scripts/audit-fix.cjs
does exactly what this page describes, and .github/workflows/dependency-audit.yml's
audit-fix job runs it automatically on same-repo PRs when the audit job goes red,
pushing the fix onto the PR branch and commenting the result. Run the same script yourself
for a manual fix, a fork PR (which the bot can't push to), or a push-to-master failure
(the bot only acts on PRs) — the procedure and the guardrails are identical either way.
Why this doesn't need E1 sign-off
Root CLAUDE.md E1 lists "adding or upgrading any dependency" as ask-first. This procedure
is exempt from that only when both hold:
- The fix is an entry in
pnpm-workspace.yaml'soverrides:block — never adependencies/devDependenciesedit in anypackage.json. pnpm installfollowed bypnpm audit --audit-level=highcomes back clean afterward.
That's the same mechanism every existing entry in that block already uses (see the "Supply-chain security" comment above it) — this skill just makes running it repeatable instead of ad hoc. Anything that doesn't fit those two constraints (below) still needs a human, same as any other dependency change.
Procedure
pnpm run audit:fix
What it does, in order (see scripts/audit-fix.cjs for the implementation):
- Runs
pnpm audit --json, keeps advisories athigh/critical(matches the--audit-level=highgate). - For each, resolves the lowest published version satisfying
patched_versions— smallest possible diff, not necessarily latest. - Writes/updates that version into
pnpm-workspace.yaml'soverrides:block (alphabetically, matching its existing convention). pnpm install, then re-runspnpm auditto confirm the advisory is gone.
Then run the standard gate before committing:
pnpm run build && pnpm run test
(The audit-fix job in CI skips this — the existing build/coveralls workflows already
re-run on the commit it pushes. A manual run should still verify locally.)
Commit as chore(deps): ... (scope deps, R12) — scripts/audit-fix-report.cjs --format=commit <summary.json> renders a ready message from the JSON summary if
AUDIT_FIX_SUMMARY_PATH was set when you ran the fix.
What it refuses to touch, and why
- A finding whose module is a direct
dependenciesentry of a published package (currently:@dailymotion/vast-client,@dailymotion/vmapinpackages/ads). Anoverridesentry only fixes this workspace's lockfile/audit — it does not change whatnpm installing that published package resolves for a downstream consumer, because overrides are a pnpm/root-lockfile-only concept. This needs an actual version bump in that package'spackage.json, which changes what ships to consumers — ask first, same as any dependency change. Cross-check withpnpm why <pkg>to see the real path. - No published version satisfies the patched range yet. Wait for the fix to ship upstream; there's nothing to pin to.
- The resolved version is blocked by
minimumReleaseAge(the 5-day supply-chain cooldown inpnpm-workspace.yaml). This surfaces as apnpm installfailure. Do not add the package tominimumReleaseAgeExcludeto work around it — that list is a deliberate, reviewed exception, not a bypass valve. Wait for the cooldown to pass, or ask the user if it's urgent enough to warrant a reviewed exclusion.
Any advisory in one of these buckets stays unfixed by design — the audit CI job stays red
until a human resolves it, which is the correct outcome, not a bug in the automation.