From e2e563264015c35075ae8bbce504124753b3b6da Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 27 May 2026 22:04:31 +0300 Subject: =?UTF-8?q?showcase:=20simplify=20inactivity=20to=20AvgCommitAge>7?= =?UTF-8?q?30=20only=20=E2=80=94=20drop=20last-activity=20guard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/showcase/rank_history_svg.go | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'internal') 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 { -- cgit v1.2.3