gitfut icon indicating copy to clipboard operation
gitfut copied to clipboard

Style label misreads recent activity: Explosive with no recent activity, Measured despite a recent burst

Open MikeSoroka opened this issue 1 month ago • 0 comments

Problem 1: "Explosive" shown with no recent activity

A profile with no recent activity gets the Explosive style ("A recent burst well above your usual pace.").

Image Image

Expected: a profile with no recent activity shouldn't get a "recent burst" label.

Problem 2: "Measured" shown despite a recent burst

A profile with clearly increased activity over the last weeks gets the Measured style ("Light recent activity.").

Image Image

Expected: a burst well above the profile's usual pace should read as Explosive.

Cause

recent_spike (lib/github/signals.ts) compares contributions over the last 365 days against lifetime / active_years:

  • A year-long window keeps finished bursts "recent". A burst stays counted for up to a year after it ends, which produces Problem 1.
  • The same window flattens fresh bursts. A few busy weeks get averaged across the whole year and rarely clear the threshold, which produces Problem 2.
  • The baseline is skewed. active_years is derived from owned-repo created/pushed years rather than contribution years (see #90), so the lifetime average can be too low or too high.

The flag also affects the card's look: pickFinish gives the TOTW finish to spiking profiles, so wrong spikes can change the card design, not only the Style label.

Suggested fix

Compute the spike from the daily contribution calendar, which is already fetched (currently only to count active days), so it needs no extra API calls:

  • compare the last ~90 days against the profile's usual pace;
  • take the usual pace as the higher of the rest of the last year and the lifetime per-active-year average, so a return to normal activity after a quiet spell isn't read as a burst;
  • require a small minimum count (e.g. 30), so a handful of commits after a quiet period doesn't trigger it.

I have a working fix for this (with tests) and I'm happy to open a PR if the approach above sounds good.

MikeSoroka avatar Oct 13 '26 09:10 MikeSoroka