fix: catch outdated version pins via package-manager CLI - #69
Merged
Merged
Conversation
…version Bash writes to a manifest via a redirect/tee/sed-i/etc were already caught by looksLikeManifestWrite, but a package manager's own CLI syntax for pinning an exact version (go get mod@v1.2.3, npm install pkg@1.2.3, pip install pkg==1.2.3, cargo add crate@1.2.3, ...) wrote the manifest just as directly and slipped straight past the hook, exit 0, with no outdated-dependency check at all. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
algomaster99
commented
Sep 26, 2026
…nager pins Per review feedback on #69: rather than always blocking a package-manager CLI pin (go get/npm install/pip install/cargo add ...@Version) outright, resolve its actual latest release the same way the Write/Edit path does (reusing pins.Diff) and only block when the pinned version is genuinely outdated, reporting the correct version the same way. An already-latest CLI pin now passes through untouched instead of always being redirected to Write/Edit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
algomaster99
commented
Sep 26, 2026
frankreyesgarcia
added a commit
to frankreyesgarcia/yul
that referenced
this pull request
Sep 27, 2026
…hains-project#65, package-manager CLI pin detection chains-project#69, ecosyste.ms GH Actions SHA resolution chains-project#64, and more)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Bashbranch ofrunHookonly caught manifest bypasses that looked like a direct file rewrite (looksLikeManifestWrite: redirects,tee,sed -i,cp/mv, ...). It didn't recognize a package manager's own CLI syntax for pinning an exact version, which writes the manifest just as directly:go get module@v1.2.3npm install/add/i pkg@1.2.3(alsopnpm/yarn)pip/pip3/poetry/uv install/add pkg==1.2.3cargo add crate@1.2.3These commands exited 0 with no outdated-dependency check at all, so Claude could pin a stale version through the CLI and never see it flagged - found while investigating a benchmark rep (
go-top-03-go-spew, hook condition) wherego get github.com/davecgh/go-spew@v1.1.0slipped through despite the hook being active.A bare install/get with no version, or one pinned to a range (
pkg@^1.2.3,pkg@latest,pip install pkg>=1.0), is left alone - there's nothing outdated to flag yet, or nothing exact for a resolver to check.parsePkgManagerPinextracts the ecosystem/name/version out of a matched command, andcheckPkgManagerPinresolves that package's actual latest release the same way the Write/Edit path does - reusingpins.Diff- and only blocks when the pin is genuinely outdated, reporting the correct version in the samename current -> latestformat Write/Edit already uses. A pin that's already at latest passes through untouched rather than always being redirected to Write/Edit.Before / after
🤖 Generated with Claude Code