[BUG] AI Mentor says "coded on 30 of the last 30 days" with a 1-day streak

Aperta
#4,030 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@laypatel13 ci sta già lavorando.

Dal 3/12/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug needs-triage status:assigned
What happened?

The AI Mentor says "You coded on 30 of the last 30 days". Same dashboard: 1 day streak, 3/7 active days, longest streak ever 18 days. Can't code 30 days in a row with an 18 day best.

The trend is off too. It says ↓1%, but my commits are down 33 vs last week. The AI weekly summary repeats it.

Why: the commit data only has rows for days with commits. In src/lib/ai-mentor.ts:

  • analyzePatterns takes commits.slice(-30): the last 30 rows, not the last 30 days
  • computeTrends splits the rows in half, not the calendar

So anyone with 30+ coding days in the last 90 always gets "30 of 30". The tests never caught it because they give a row for every day, even days with 0 commits.

Expected: count calendar days, so the card matches the streak and active days cards. Compare the trend over two equal date windows.

Attached the failing test that reproduces it below.

Steps to reproduce
  1. Sign in with an account that has 30+ coding days in the last 90, with gaps in the last 30
  2. Open the dashboard (HQ)
  3. Compare the AI Mentor card with the Streak, Active days and Personal records cards
Where is it?

AI features (insights, personality, project tutor, career)

Where did you see it?

devtrack.live

Browser and device

Chrome on macOS

Screenshots, console errors or logs
Screenshot 2026-12-04 at 12 00 31 AM Screenshot 2026-12-04 at 12 00 50 AM Screenshot 2026-12-04 at 12 07 44 AM
Want to fix it?
  • I'd like to work on this. A maintainer will assign you; please don't start before that.
Lingua principale
TypeScript
Stelle
246
Fork
436
Merge medio
9h 33m
PR unite (30g)
213

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Priyanshu-byte-coder/devtrack

Tutte le issue di Priyanshu-byte-coder/devtrack

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.