From c5689bd90e510237acaa3a51229a6ea1a79a570c Mon Sep 17 00:00:00 2001 From: James Sugrue Date: Sun, 5 Jul 2026 13:18:08 -0400 Subject: [PATCH] fix(scoring): correct "active days this year" copy to match rolling window GitHub's contributionsCollection query has no from/to bounds, so it returns a trailing 365-day window ending now, not the calendar year. Labeling it "this year" let active_days_recent read higher than the number of days elapsed in the current year. --- lib/scoring/attributes.ts | 2 +- lib/scoring/playstyles.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/scoring/attributes.ts b/lib/scoring/attributes.ts index dd2109a..02008d5 100644 --- a/lib/scoring/attributes.ts +++ b/lib/scoring/attributes.ts @@ -54,7 +54,7 @@ export function deriveStyle(s: Signals): { value: string; reason: string } { return { value: "Controlled", reason: "A long, steady track record." }; if (s.max_repo_stars >= 5000 && s.recent_contributions < 200) return { value: "Clinical", reason: "One big hit, quiet lately." }; - if (s.recent_contributions >= 300) return { value: "Industrious", reason: "Steadily active this year." }; + if (s.recent_contributions >= 300) return { value: "Industrious", reason: "Steadily active over the past year." }; return { value: "Measured", reason: "Light recent activity." }; } diff --git a/lib/scoring/playstyles.ts b/lib/scoring/playstyles.ts index c4771ff..b835456 100644 --- a/lib/scoring/playstyles.ts +++ b/lib/scoring/playstyles.ts @@ -17,8 +17,8 @@ interface PlaystyleDef { const CATALOG: PlaystyleDef[] = [ { name: "Star Magnet", icon: "star", noun: "stars earned", value: (s) => s.total_stars_owned, base: 500, plus: 20_000 }, { name: "Viral Hit", icon: "flame", noun: "stars on one repo", value: (s) => s.max_repo_stars, base: 1_000, plus: 20_000 }, - { name: "Workhorse", icon: "zap", noun: "active days this year", value: (s) => s.active_days_recent, base: 120, plus: 250 }, - { name: "Rapid Fire", icon: "fast-forward", noun: "contributions this year", value: (s) => s.recent_contributions, base: 500, plus: 2_500 }, + { name: "Workhorse", icon: "zap", noun: "active days in the past year", value: (s) => s.active_days_recent, base: 120, plus: 250 }, + { name: "Rapid Fire", icon: "fast-forward", noun: "contributions in the past year", value: (s) => s.recent_contributions, base: 500, plus: 2_500 }, { name: "Marathoner", icon: "infinity", noun: "lifetime contributions", value: (s) => s.total_contributions_lifetime, base: 3_000, plus: 25_000 }, { name: "Maintainer", icon: "shield", noun: "reviews & issues", value: (s) => s.reviews + s.issues_closed, base: 30, plus: 300 }, { name: "Connector", icon: "git-pull-request", noun: "pull requests", value: (s) => s.prs_to_others, base: 30, plus: 400 },