Skip to content

fix(sc1): skip requirement ranges recorded in npm lockfiles - #1105

Open
DrVelvetFog wants to merge 1 commit into
NVIDIA:mainfrom
DrVelvetFog:fix/sc1-npm-lockfile-ranges
Open

DrVelvetFog wants to merge 1 commit into
NVIDIA:mainfrom
DrVelvetFog:fix/sc1-npm-lockfile-ranges

Conversation

@DrVelvetFog

Copy link
Copy Markdown

SC1 ran its range patterns over package-lock.json and npm-shrinkwrap.json, so every "name": "^x.y.z" or "name": "*" that an installed package declares for its own dependencies was reported as an unpinned dependency of the skill. The lockfile pins each of those to an exact version.

analyze() now skips the SC1 patterns when the file is an npm lockfile. package.json is still checked, and SC4 still reads exact versions from the lockfile. Python lockfiles are left alone because none of the SC1 patterns match them.

Fixes #1104.

Tests: two new cases in test_static_patterns_supply_chain_lockfiles.py. The lockfile case fails on main and passes here; the package.json case passes on both. ruff check and ruff format --check are clean.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[SkillSpector Review]

Decision: Approved.

Value and readiness

The filename-scoped SC1 exclusion fixes #1104's transitive requirement-range noise. It also follows the issue's explicit treatment of root requirement ranges in lockfile-only bundles. The same package.json declarations still receive SC1 checks, and npm lockfiles remain dependency inputs for resolved-version SC4/SC5/SC6 analysis. Ready from this review.

Material findings

No required change found. The change only gates the SC1 loop with the existing _is_npm_lockfile helper, which recognizes both package-lock.json and npm-shrinkwrap.json by dependency filename, including nested paths. It does not change _is_dependency_manifest, lockfile parsing, exact-version extraction, vulnerability lookup or dependency parse-limit accounting. Added controls cover nested/transitive ranges and peer wildcards in both npm lockfile names, with a package.json positive that retains the same range findings. No public rule ID, severity or report schema changes.

PIC tradeoffs

None requiring an additional decision. The exclusion treats recorded lockfile requirements as metadata around resolved packages; direct package.json requirements remain the pinning-policy surface.

Verification and gaps

Read the complete three-file diff, exact-head surrounding SC1/SC2 dispatch, filename helpers and bounded npm dependency-analysis path, added tests and #1104. All cutoff review/comment/discussion/thread records are empty. Pre-fetch, post-fetch and post-review heads match the inventory. Hosted CI run 43279006177 has this exact head_sha; unit logs include the changed lockfile test module and report 24,648 passed, 28 skipped, 261 deselected and 4 xfailed. All six checks succeeded. This was static source/test and hosted-log review only; no contributor code, tests, imports, builds, setup, hooks, scanner or regex probes were executed locally.

Reviewed head: fa84d65a737711f4c3ba52ca916ebde8fbef3259.

@DrVelvetFog
DrVelvetFog force-pushed the fix/sc1-npm-lockfile-ranges branch from fa84d65 to 7950eba Compare November 14, 2026 13:32

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[SkillSpector Review]

Decision — Approve

Value and readiness — SC1 stops treating dependency requirement ranges recorded in npm lockfiles as unpinned installs. The manifest remains the source for npm pinning policy.

Material findings — None. The current diff has the same added and removed lines as the previously approved head. The filename check covers both npm lockfile names in nested directories. The lockfile remains a dependency-analysis input for its resolved versions.

PIC tradeoffs — Coverage for manifest requirements and lockfile vulnerabilities is preserved, while reported SC1 findings better reflect install-time pinning.

Verification and gaps — Compared the complete rebased diff with the previous approval, traced SC1 and resolved lockfile extraction at this head, and checked tests for both lockfile names and the manifest positive control. All six exact-head hosted checks succeeded. Local review was static. Hosted CI

Reviewed head: 7950eba99f06dd838204ed3b103fe3461736f843

SC1 ran its range patterns over package-lock.json and npm-shrinkwrap.json,
so each range an installed package declares for its own dependencies was
reported as an unpinned dependency of the skill. The lockfile pins those
to exact versions. package.json ranges are still reported.

Fixes NVIDIA#1104

Signed-off-by: Tony Jagodka <tjagodka@gmail.com>
@DrVelvetFog
DrVelvetFog force-pushed the fix/sc1-npm-lockfile-ranges branch from 7950eba to 0b0bb5c Compare November 19, 2026 15:31
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.

SC1 reports the requirement ranges inside package-lock.json as unpinned dependencies

2 participants