Skip to content

fix: pin js-yaml to exact version 4.1.1 - #335

Merged
avifenesh merged 2 commits into
agent-sh:mainfrom
xiaolai:fix/nlpm-pin-js-yaml
Apr 23, 2026
Merged

fix: pin js-yaml to exact version 4.1.1#335
avifenesh merged 2 commits into
agent-sh:mainfrom
xiaolai:fix/nlpm-pin-js-yaml

Conversation

@xiaolai

@xiaolai xiaolai commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Automated audit: This PR was generated by NLPM, a natural language programming linter, running via claude-code-action. Please evaluate the diff on its merits.

Bug

package.json declares js-yaml with a caret range:

"js-yaml": "^4.1.1"

The caret (^) permits automatic minor and patch version upgrades. Since js-yaml is a runtime dependency used to parse YAML in the plugin, an unintended version upgrade (e.g., 4.1.1 → 4.2.0 if one is published) could introduce breaking behavior changes across different install environments.

Fix

Pin to the exact version already installed:

"js-yaml": "4.1.1"

This ensures every install resolves to the same version that was tested, regardless of when or where npm install is run.

If js-yaml needs to be updated in the future, the version bump becomes an explicit, reviewable change rather than a silent automatic upgrade.

The caret range ^4.1.1 allows automatic minor and patch version
upgrades on install, which can introduce unexpected behavior changes in
CI and consumer environments. Pin to an exact version for deterministic
installs.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins js-yaml to an exact version in the root package manifest to avoid unintended dependency drift at install time for YAML parsing behavior.

Changes:

  • Change js-yaml dependency range from ^4.1.1 to 4.1.1 in package.json.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request pins the version of the js-yaml dependency to 4.1.1 in package.json. Feedback was provided regarding the need to synchronize the package-lock.json file to reflect this change.

Comment thread package.json Outdated
@avifenesh

Copy link
Copy Markdown
Collaborator

@xiaolai hey, while it might introduce changes, minor and patches are not breaking changes and allowing patches at runtime are the way to make sure that ongoing security changes enforced at runtime. I think that security wise the right thing is to get updated patches live. The lock file assure thise are being noticable when updates actually happened.

Avi's preference: pin minor (block 4.2.x) but allow patches (4.1.x) so
runtime security patches still flow in automatically. Tilde range is
exactly that semantic in npm.

Also addresses bot review: package-lock.json root entry now matches
package.json (was still ^4.1.1 from before xiaolai's pin).
@avifenesh

Copy link
Copy Markdown
Collaborator

Thanks @xiaolai! Took your patch and softened the pin from exact 4.1.1 to tilde ~4.1.1 (commit 56192bd) so runtime security patches still flow in but minor bumps stay blocked. Also synced the lockfile root entry to address the bot reviews. Merging.

@avifenesh
avifenesh merged commit df582c8 into agent-sh:main Apr 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants