fix(rees): classify bower_components and jspm_packages as vendored in provenance - #2799
Conversation
… provenance The provenance analyzer's VENDORED_PATH_RE recognized vendor/node_modules/third_party but not bower_components (Bower) or jspm_packages (JSPM) — installed-dependency directories that are the same vendored case as node_modules. JSONbored#2777 added exactly these to the server-side path classifier (src/signals/path-matchers.ts), but review-enrichment ships as a standalone package with its own copy, so the fix did not reach it. A committed bower/jspm tree therefore fell through to null (ordinary source) instead of "vendored", so the provenance analyzer treated vendored third-party code as reviewable contributor source. Add both directories to VENDORED_PATH_RE (directory-segment anchored, so a source file merely named like the dir is unaffected). Adds a provenance regression.
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-03 19:13:06 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 5 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.
|
What
The rees provenance analyzer classifies a newly-added file as
binary/vendored/ source viaclassifyAddedFile. ItsVENDORED_PATH_RE:/(?:^|\/)(?:vendor|node_modules|third[_-]party|vendors)\//recognizes
vendor/node_modules/third_partybut notbower_components(Bower) orjspm_packages(JSPM) — installed-dependency directories that are the same vendored case asnode_modules.Why it matters
#2777(fix(signals): classify bower_components and jspm_packages as vendored) added exactly these to the server-side path classifier (src/signals/path-matchers.ts), with the rationale "the same vendored case as node_modules." Butreview-enrichmentships as a standalone package with its own inlinedVENDORED_PATH_RE, so #2777'ssrc/change never reached it.Consequence: a PR that commits a
bower_components/orjspm_packages/tree has those files fall through tonull(ordinary source) instead of"vendored", so the provenance analyzer treats committed third-party dependency code as reviewable contributor source — the exact misclassification #2777 fixed on the server side.Fix
Add
bower_componentsandjspm_packagestoVENDORED_PATH_RE, mirroring the path-matchers vendored classifier. The pattern stays directory-segment anchored ((?:^|\/)…\//), so a source file merely named like the directory (src/bower_components.ts) is unaffected.Tests
Adds
review-enrichment/test/provenance.test.ts: bower/jspm trees now classify asvendored, the existing dirs still do (control), and directory-name lookalikes / plain source staynull. Fails on the pre-fix regex, passes with the fix.