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

Abierto
#4,030 3 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@laypatel13 ya está trabajando en esto.

Desde el 3/12/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
246
Forks
436
Merge medio
9 h 33 min
PR fusionados (30 d)
213

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Priyanshu-byte-coder/devtrack

Todos los issues de Priyanshu-byte-coder/devtrack

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.