feat(enrichment): skip all binary + lockfile files in history analyzers - #3359
Conversation
blame-link (JSONbored#2034) and churn-hotspot (JSONbored#1513) each carried an identical hand-maintained SKIP_RE listing a narrow subset of binaries (png/jpg/gif/ svg/ico/pdf/zip/gz/woff) and lockfiles. Any binary the list did not enumerate — webp, avif, heic, mp4, wasm, safetensors, and the rest of the shared inventory — plus Rust/PHP/Bun lockfiles were still treated as candidate "who-introduced-this" / churn-fragility signals, producing noise on files whose commit history carries no code signal. Extract the rule into a shared isHistoryUninformativePath() (new analyzers/history-path.ts) that keeps the original regex verbatim and additionally delegates binary and lockfile recognition to the unified inventories (binary-extensions' BINARY_EXT_RE, lockfile-path's isSupportedLockfile). Both analyzers now import it, removing the duplicated regex so the two can no longer drift apart. The change is purely additive — it only ever skips more, never fewer, files.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-05 04:46:02 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.
|
Summary
The two history-class analyzers —
blame-link(#2034) andchurn-hotspot(#1513) — each carried an identical, hand-maintainedSKIP_REthat skips files whose commit history is not a useful "who-introduced-this" / fragility signal (lockfiles, generated output, binaries). That regex only enumerated a narrow binary subset (png/jpe?g/gif/svg/ico/pdf/zip/gz/woff2?) and the five npm/yarn/pnpm/poetry/go lockfiles. So any binary it didn't list —webp,avif,heic,mp4,wasm,safetensors, and the rest of the shared inventory — plus Rust/PHP/Bun lockfiles were still treated as candidate history signals, producing noise on files that carry no code signal.This change:
isHistoryUninformativePath()(newanalyzers/history-path.ts). Both analyzers import it and drop their local copy, so the two can no longer drift apart (the duplicated regex was a latent desync hazard).binary-extensions'BINARY_EXT_REandlockfile-path'sisSupportedLockfile— instead of a hand-maintained list, so it stays in sync as those grow. This follows the same consolidation direction as feat(enrichment): unify binary extension inventory for asset-weight and provenance #3252 (unified binary-extension inventory).OR-ed on top, so it only ever skips more files, never fewer. No file that was analyzed before is newly skipped except genuine binaries/lockfiles that should have been skipped all along.No linked issue
This is a no-issue PR by design: a self-contained analyzer refactor + coverage fix touching only
review-enrichment/. It removes a duplicated skip regex and broadens binary/lockfile coverage using existing shared helpers; no new external behavior beyond skipping more non-code files. It mirrors the accepted no-issue precedent for the same kind of enrichment change (e.g. the recently-merged#3264and#3329).Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coverage— nosrc/**lines changed (this change is underreview-enrichment/, which Codecov does not measure), socodecov/patchhas no diff to gate; suite is green.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderatereview-enrichment/test/history-path.test.tsunit-coversisHistoryUninformativePathacross every branch (original lockfile/generated/dir set, the broader shared binary inventory, the full lockfile inventory, and negatives likeCargo.toml/cargo.lock.md/source files); the existingchurn-hotspotskip test is extended to prove a.safetensorsblob and aCargo.lockare now skipped without a fetch.npm run rees:testpasses (929 tests; analyzer-metadata check clean).Validated green against the full GitHub CI
validate-codecheck set —actionlint,db:migrations:check,db:schema-drift:check,cf-typegen:check,selfhost:validate-observability,typecheck,test:coverage,test:workers,build:mcp,test:mcp-pack,build:miner,rees:test,ui:openapi:check,ui:openapi:settings-parity,ui:version-audit,ui:lint,ui:typecheck,ui:test,ui:build. Branch rebased on latestmain.Safety
Notes
Both history analyzers are advisory, metadata-only (they surface a PR number / short SHA / counts from the public commit log, never file contents), and this change does not alter that — it only widens the set of non-code files they decline to spend a GitHub round-trip on. The original
SKIP_REis preserved verbatim inside the shared helper so its.min.js/.map/.snap/.svg/dist|build|vendormatches are unchanged; only binary and lockfile recognition is broadened via the shared inventories.