diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-27 22:04:31 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-27 22:04:31 +0300 |
| commit | e2e563264015c35075ae8bbce504124753b3b6da (patch) | |
| tree | 8800a2b8350b7765324af7a6ec8b03f0c0da8a0a /internal | |
| parent | 30df482b7dbacf434a4a2ba5c10a668166803f34 (diff) | |
showcase: simplify inactivity to AvgCommitAge>730 only — drop last-activity guard
The previous condition (AvgCommitAge>730 AND lastActivityDate>365d) allowed
projects like muttdelay to slip through: a single 'add deprecation notice'
commit in March 2026 made LastActivityDate recent while AvgCommitAge remained
4228 days (~11.6 years).
New rule: AvgCommitAge>730 alone. AvgCommitAge is the mean age of the last
42 commits, so a genuinely revived project needs ~42 recent commits before
the average drops below the threshold — one stray commit cannot mask decay.
LastActivityDate (all-branches) is kept in the struct for potential future use.
Also removes the now-unused 'time' import from rank_history_svg.go.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/showcase/rank_history_svg.go | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/internal/showcase/rank_history_svg.go b/internal/showcase/rank_history_svg.go index 16b3a5f..67281cb 100644 --- a/internal/showcase/rank_history_svg.go +++ b/internal/showcase/rank_history_svg.go @@ -5,7 +5,6 @@ import ( "fmt" "math" "strings" - "time" ) // SVG canvas and margin constants (pixels in viewBox coordinates). @@ -209,25 +208,13 @@ func GenerateRankHistorySVG(summaries []ProjectSummary) string { } // A project is inactive when its average commit age (HEAD) exceeds 730 - // days AND no commit on ANY local branch is younger than 365 days. - // Using LastActivityDate (all-branches) avoids false positives for - // projects whose default branch is old but development continues on - // another branch (e.g. a "develop" or "master" branch). - // Code stats (AvgCommitAge, score) remain HEAD-only per config rules. - inactive := false - if s.Metadata != nil && s.Metadata.AvgCommitAge > 730 { - activityDate := s.Metadata.LastActivityDate - if activityDate == "" { - activityDate = s.Metadata.LastCommitDate // fallback if field absent - } - if activityDate != "" { - if last, err := time.Parse("2006-01-02", activityDate); err == nil { - if time.Since(last).Hours()/24 > 365 { - inactive = true - } - } - } - } + // days (~2 years). AvgCommitAge is the mean age of the last 42 commits, + // so a single stray "add deprecation notice" commit does not rescue a + // decade-old dormant project. A genuinely revived project needs ~42 + // recent commits before the average drops below the threshold. + // LastActivityDate (all-branches) is retained in the struct for future + // use but is not part of this check so one-off commits cannot mask decay. + inactive := s.Metadata != nil && s.Metadata.AvgCommitAge > 730 score := 0.0 if s.Metadata != nil { |
