fix(enrichment): accept full Go module path punctuation in dependency scan#2121
Conversation
… scan The go.mod line parser used a lowercase-only path class (`/^([a-z0-9.\/-]+)\s+v.../`) that was narrower than Go's actual module-path grammar in two ways: it rejected uppercase segments and the `_`/`~` punctuation that `golang.org/x/mod/module.modPathOK` permits (the full ASCII set is `- . _ ~` plus letters and digits). Go module paths are case-sensitive and legitimately contain these characters (github.com/BurntSushi/toml, github.com/Masterminds/semver, github.com/foo_bar/baz, golang.org/x/~exp). A non-matching line is silently dropped from extractDependencyChanges, so the dependency never reaches any dependency-fed analyzer — the OSV.dev CVE scan, license, provenance, and native-build checks. The result is a real review blind spot: a vulnerable dependency with such a path added in a PR would never be flagged. Widen the class to `[A-Za-z0-9._~\/-]`, matching modPathOK exactly. The change is strictly more permissive, so existing lowercase paths are unaffected, and the case-sensitive name is preserved verbatim for the OSV lookup. A regression test asserts uppercase, underscore, and tilde paths are now parsed.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-01 19:22:43 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 3 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
The
go.modline parser in the REES dependency scanner used a lowercase-only path character class:This was narrower than Go's actual module-path grammar in two ways. Go's
golang.org/x/mod/module.modPathOKpermits ASCII letters (case-sensitive), digits, and the punctuation set- . _ ~(plus/as separator) — but the class accepted only.and-, rejecting uppercase segments and the_/~punctuation.Go module paths legitimately contain all of these —
github.com/BurntSushi/toml,github.com/Masterminds/semver,github.com/foo_bar/baz,golang.org/x/~exp, or any capitalized GitHub owner. A non-matching line is silently dropped fromextractDependencyChanges, so the dependency never reaches any dependency-fed analyzer — the OSV.dev CVE scan, license, provenance, and native-build checks. The result is a real review blind spot: a vulnerable dependency with such a path added in a PR would never be flagged.This widens the class to
[A-Za-z0-9._~\/-], matchingmodPathOKexactly:The change is strictly more permissive, so existing lowercase paths are unaffected, and the case-sensitive name is preserved verbatim for the OSV lookup.
A regression test asserts uppercase, underscore, and tilde Go module paths are now parsed.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm --prefix review-enrichment test(build → validate sourcemaps → analyzer-metadata check → full REES suite) — green; the new uppercase/_/~regression test passes.main— no conflict (coexists with the merged PyPI-extrasPYPI_REchange; both regex fixes and both tests retained).npm run test:cijobs — not exercised by this change; it is confined toreview-enrichment/**, which is outside the rootsrc/**Codecov patch scope. Verified by CI.If any required check was skipped, explain why:
review-enrichment/src/analyzers/dependency-scan.tsand its test; the relevant local gate is the REES suite (rees:test), which is green. The rootsrc/**coverage jobs do not cover this package.Safety