fix(supply-chain): pin the npm lockfile generator and prove reproduction - #782
Draft
seonghobae wants to merge 13 commits into
Draft
fix(supply-chain): pin the npm lockfile generator and prove reproduction#782seonghobae wants to merge 13 commits into
seonghobae wants to merge 13 commits into
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
| run: test "$(npm --version)" = "$EXPECTED_NPM_VERSION" | ||
| - name: Reproduce package lock without lifecycle execution | ||
| run: npm install --package-lock-only --ignore-scripts --no-audit --no-fund | ||
| - name: Preserve the exact generated lock as review evidence |
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.
Problem
BandScope's protected lockfile is consumed by CI with npm 10.9.8, but the source tree does not declare or enforce that generator. Dependency pull requests therefore include inconsistent metadata churn—most visibly repeated removal of
peer: truefrom unrelated@esbuild/*location records—without proving whether the churn is canonical for the repository's supported npm version.A lockfile is reproducible only when its package manifest, install flags, and generator version are one reviewed contract. Separate dependency PRs must not silently choose a different npm algorithm.
Test-first state
Exact RED head:
4294ddc6c549ba805032e6d828ffbb2ddb9b43a2.The first commit adds only
services/analysis-engine/tests/test_npm_toolchain_contract.py. It requires:packageManager: npm@10.9.8;engines.npmanddevEngines.packageManager;git diff; andProtected
developlacks the first four contracts, so the new test must fail before implementation.Intended GREEN implementation
npm --version, perform the normal clean install, regenerate only the lockfile with scripts/audit/funding disabled, and reject any diff.devEngines,npm ci, and package-lock documentation.CHANGELOG.mdunder Unreleased.Merge gate
Keep Draft until RED evidence is observed, the exact generator produces a stable lock twice, all repository quality/security/supply-chain checks succeed on the final exact head, CodeRabbit/OpenCode/Noema and a qualifying independent non-author approval are current, actionable threads are zero, and branch protection permits merge without bypass.