feat: churn-based hotspot orientation pass for the analyzer - #22
Draft
moyom96 wants to merge 1 commit into
Draft
Conversation
Add HotspotCollector, a fifth collector that surfaces maintenance hotspots (files with high git churn and large size) so the LLM triage also reviews files the AST and dead-code collectors never flag. Hotspots are input seeds only: the model diagnoses each into the existing debt taxonomy and never emits hotspot as an output type. The --skip-llm path keeps the raw type and is handled generically. - HotspotCollector: git churn over a window times file size, with per-file thresholds and a cap, all configurable. - Wire into Analyzer#collect_candidates and add hotspot baseline metrics. - Config.hotspot settings with defaults (window_months, min_commits, min_loc, max_files) and an enabled toggle. - score_details label so skip-llm hotspot issues read honestly. - Settings and analysis-prompt templates document the hotspot signal. - Scan workflow checks out full history (fetch-depth: 0) so git churn is available in CI; without it the pass finds nothing. - Spec covering thresholds, scope, scoring, cap, and disabled paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
wall-e's findings were capped by what four collectors detect (
debride,flog,flay, layer heuristics). Files that are simply large and changing constantly, where defect and review cost concentrate, stayed invisible because no collector was built to flag them. This adds an orientation pass so the LLM triage also reviews those files.The approach is borrowed from the churn-vs-complexity hotspot literature (Michael Feathers, CodeScene): the intersection of high git churn and large size is where debt accumulates.
What Changed
HotspotCollector(fifth collector): counts commits per in-scope Ruby file over a window viagit log, multiplies by file size, applies per-file thresholds, and emits the top files ashotspotcandidates.hotspotis an input seed only. The LLM triage diagnoses each hotspot file into the existing debt taxonomy (or rejects it) and never emitshotspotas an outputdebt_type. This means zero changes to issue creation or fingerprinting. The--skip-llmpath keeps the raw type and is handled generically.Analyzer#collect_candidates, with hotspot baseline metrics for verification metadata.Config#hotspotsettings with defaults and anenabledtoggle:window_months(6),min_commits(5),min_loc(100),max_files(10).score_detailslabel so--skip-llmhotspot issues read honestly.hotspotcandidates are orientation signals to diagnose, not findings to echo.fetch-depth: 0). Required:actions/checkoutdefaults to depth 1, so without thisgit log --sincesees one commit and the pass finds nothing in CI.max_filescap, and the disabled/no-git paths.How to Test
mise exec ruby@3.3.6 -- bundle exec rspec spec/tech_debt/collectors/hotspot_collector_spec.rb(system Ruby 2.6 is incompatible). Expect 10 examples, 0 failures.mise exec ruby@3.3.6 -- bundle exec wall-e --dry-run --skip-llmin a repo with history. Hotspot candidates appear for the largest, most-churned files.fetch-depth: 0.analysis.hotspot.enabled: false: the collector is skipped entirely (nogit logcall).min_commits/min_locdown on a small repo to see candidates surface.Deployment Tasks
rails g wall_e:installget thefetch-depth: 0scan workflow and thehotspotconfig block. Existing installs that want the pass to work in CI must addfetch-depth: 0to theirwall_e_scan.ymlcheckout step. No migrations or env vars.Notes
--follow), so a recently-renamed file under-counts. Acceptable for a heuristic.main(not the per-PR debt-delta branch). Both touch the analyzer/collectors, so expect a small, mechanical merge conflict when the second of the two lands.