feat(enrichment): churn-hotspot analyzer#1882
Conversation
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-06-30 19:18:03 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 (JSONbored#1513) that flags the changed files which are statistical fragility hotspots — a high recent commit frequency AND a high fraction of fix/revert commits — so the reviewer scrutinizes defect-prone areas harder. For each changed (non-added, non-generated) file it reads one page of the file's commit history from the GitHub commits API over a 90-day window, counts the commits, and classifies each subject line as a fix/revert. A file with >=8 commits and >=30% fixes is reported. Counts only — never file contents. Distinct from the history analyzer (JSONbored#1478, author track record); this scores the change AREA's defect density. Pure helpers (isFixCommit/summarizeChurn/isHotspot) + an injected fetch; registered as a descriptor and rendered as a public-safe block. Tests in their own file; analyzer-metadata + the descriptor-derived lists regenerated.
d88ef70 to
ace21da
Compare
Summary
Adds a REES analyzer (#1513) that flags the files a PR changes which are statistical fragility hotspots — a high recent commit frequency and a high fraction of fix/revert commits — so the reviewer scrutinizes areas where defects historically cluster. Additive + fail-safe; fills its own
churnHotspotfindings key.Detects (counts from the public commit log only — never file contents)
fix/bugfix/hotfix/revert/regression).+when the page cap is hit), fix count, and window.Distinct from the history analyzer (#1478), which scores the author's track record; this scores the change area's defect density.
Implementation (established
review-enrichment/pattern)ChurnHotspotFindingtype +churnHotspot?key insrc/types.tssrc/analyzers/churn-hotspot.ts— pure helpers (isFixCommit,summarizeChurn,isHotspot) +scanChurnHotspot(req, fetch, opts), using the sharedboundedFetchJsonsrc/analyzers/registry.ts(category: history,cost: github-heavy,requires: files + github-token)src/render.tsnode:testunits in a separatetest/churn-hotspot.test.ts;analyzer-metadata.json+ the descriptor-derived lists regenerated vianpm run metadataValidation
From
review-enrichment/(Node 24):Covers fix-subject classification (incl. lookalikes like
prefix/fixture/suffixthat must NOT match, and body-vs-subject), count/fraction/threshold logic, hotspot vs low-churn/low-fix, the page-cap (capped) flag, skipping lockfiles/binaries/added files without fetching, token/slug guards, non-ok/throwing-fetch fail-safe, abort, and the rendered block.Closes #1513