feat(enrichment): native-build / install-cost dependency analyzer#1742
feat(enrichment): native-build / install-cost dependency analyzer#1742nickmopen wants to merge 1 commit into
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-06-29 15:17:48 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 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.
|
Add a REES analyzer that flags the dependencies a PR adds/upgrades whose install does real work the manifest diff never shows — a hidden CI cold-start cost and a frequent cross-platform breakage source: - npm: a version that compiles a native addon on install (gypfile, or an install/preinstall/postinstall script that runs node-gyp/cmake-js/etc). When a prebuilt-binary path exists (node-pre-gyp/prebuild or a `binary` field) the reason notes the compile is a fallback for an unmatched platform/ABI. - PyPI: a version that ships no prebuilt wheel (sdist-only), so pip compiles from source on install. Factual registry-metadata signals only (npm packument, PyPI per-version JSON) via an injected fetch; non-ok/unknown states fail safe (no finding). Reuses extractDependencyChanges, registered in the brief orchestrator, rendered as a public-safe block (package@version + reason). Tests in their own file. Closes JSONbored#1512
73d2fcd to
84550bd
Compare
Summary
Adds a REES analyzer (#1512) that flags the dependencies a PR adds/upgrades whose install does real work the manifest diff never shows — a hidden CI cold-start cost and a frequent cross-platform breakage source. Additive + fail-safe: fills its own
nativeBuildfindings key and degrades independently.Detects (factual registry-metadata signals only)
gypfile: true, or an install/preinstall/postinstall script that runs a native toolchain (node-gyp,cmake-js,node-pre-gyp,prebuild…). When a prebuilt-binary path exists (node-pre-gyp/prebuild-install, or abinaryfield), the finding notes the compile is a fallback for an unmatched platform/Node ABI rather than guaranteed — sobcrypt/sqlite3-style packages aren't mischaracterized.bdist_wheel(only an sdist), sopipcompiles from source on install.These are objective properties read from the npm packument and the PyPI per-version JSON (not heuristics), so there are no fuzzy false positives. Unknown/non-ok registry responses fail safe (no finding).
Implementation (established
review-enrichment/pattern)NativeBuildFindingtype +nativeBuild?key insrc/types.tssrc/analyzers/native-build.ts— pure helpers (npmNativeBuild,pypiSdistOnly) +scanNativeBuild(req, fetch, opts); reusesextractDependencyChangessrc/brief.tsANALYZERS registrysrc/render.ts(renderspackage@version+ reason only)node:testunits in a separatetest/native-build.test.tsValidation
From
review-enrichment/(Node 24):Covers gypfile/native-tool detection, prebuilt-fallback nuance, pure-JS negatives, PyPI sdist-only vs wheel, Go/invalid-name skips, fetch 404/throw/abort fail-safe, and the rendered block.
Closes #1512