You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add repository code volume to insights and user detail pages
Collect AI code commits per repo (schema migration adds repo_name to
ai_code_commits PK). Show top repos by lines with % of total and AI %
on both the insights page and per-user detail page. Remove misleading
tab/composer/manual breakdown (unreliable due to squash merges). Fix
card height mismatch between Daily Spend and AI Adoption cards.
Made-with: Cursor
Copy file name to clipboardExpand all lines: .cursor/rules/cursor-api-data-guide.mdc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,7 @@ Investigated Feb 2026 by comparing real user data against git history and studyi
142
142
- Plan mode adoption from `/analytics/team/plans` - plan mode usage by model. Stored in `analytics_plans` table.
143
143
- Per-user MCP tool usage from `/analytics/by-user/mcp` - which MCP tools each user uses. Stored in `analytics_user_mcp` table.
144
144
- Per-user command usage from `/analytics/by-user/commands` - which commands each user uses. Stored in `analytics_user_commands` table.
145
-
- AI Code Tracking from `/analytics/ai-code/commits` - per-commit AI vs manual line attribution. Stored in `ai_code_commits` table (aggregated per user per day). Provides `tabLinesAdded`, `composerLinesAdded`, `nonAiLinesAdded` per commit. Used for AI Adoption % on user detail page. Only tracks commits made through Cursor's Source Control panel — terminal git commits are not captured.
145
+
- AI Code Tracking from `/analytics/ai-code/commits` - per-commit AI vs manual line attribution. Stored in `ai_code_commits` table (aggregated per user per day per repo). Primary key is `(email, date, repo_name)`. Provides `tabLinesAdded`, `composerLinesAdded`, `nonAiLinesAdded` per commit. Used for repository code volume on insights page and per-user repo breakdown. Note: tab/composer/nonAI breakdown is unreliable (see limitations above) — only total lines and AI % are shown in the UI. Only tracks commits made through Cursor's Source Control panel — terminal git commits are not captured.
146
146
147
147
### Not Currently Collected (but available)
148
148
- Per-user breakdowns from `/analytics/by-user/*` endpoints for: agent-edits, tabs, models, plans, ask-mode, client-versions, top-file-extensions (we collect mcp and commands per-user, but not these others)
Copy file name to clipboardExpand all lines: .cursor/rules/project-context.mdc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -67,8 +67,8 @@ Single cron endpoint `POST /api/cron` does both: collect → detect → alert in
67
67
## Dashboard Pages
68
68
69
69
- `/` — Team overview: stat cards, model cost comparison table ($/request relative multipliers), daily spend trend (sourced from `usage_events` with `daily_spend` fallback, last 2 days marked provisional), spend breakdown by user, members table with search/sort, **group filter dropdown**, time range picker (24h/3d/7d/14d/30d), billing cycle progress
70
-
- `/insights` — Analytics: DAU chart, model adoption, model efficiency rankings, MCP tool usage, file extensions, client versions
71
-
- `/users/[email]` — Per-user detail: KPI cards (cycle spend, $/req, agent reqs, diffs accepted, team rank), spend trend chart, AI adoption card (tier, score bar, stat pills with tooltips), cost breakdown by model, tools & features (MCP tools + commands per user), model preferences, daily activity table, anomaly history
70
+
- `/insights` — Analytics: DAU chart, model adoption, model efficiency rankings, repository code volume (lines, % of total, AI %), MCP tool usage, file extensions, client versions
71
+
- `/users/[email]` — Per-user detail: KPI cards (cycle spend, $/req, agent reqs, diffs accepted, team rank), spend trend chart, AI adoption card (tier, score bar, stat pills with tooltips), cost breakdown by model, tools & features (MCP tools + commands per user), repositories (top 15 by lines, % of total, AI %), model preferences, daily activity table, anomaly history
72
72
- `/anomalies` — MTTD/MTTI/MTTR metrics, open incidents (acknowledge/resolve), anomaly table
73
73
- `/settings` — Detection thresholds, **billing group management** (rename, assign, create), **HiBob CSV import** with change preview
|**Team Overview**| Stat cards, spend by user, daily spend trend, spend breakdown, members table with search/sort, **group filter dropdown**, billing cycle progress, time range picker |
161
-
|**Insights**| DAU chart, model adoption trends, model efficiency rankings (cost/precision), MCP tool usage, file extensions, client versions |
|**Team Overview**| Stat cards, spend by user, daily spend trend, spend breakdown, members table with search/sort, **group filter dropdown**, billing cycle progress, time range picker |
161
+
|**Insights**| DAU chart, model adoption trends, model efficiency rankings (cost/precision), repository code volume (lines, % of total, AI %), MCP tool usage, file extensions, client versions|
162
+
|**User Drilldown**| Per-user token timeline, model breakdown, feature usage, repository breakdown, activity profile, anomaly history |
163
+
|**Anomalies**| Open incidents, MTTD/MTTI/MTTR metrics, full anomaly timeline |
164
+
|**Settings**| Detection thresholds, expensive model alerts, billing group management, HiBob CSV import, group export/import |
165
165
166
166
> For a detailed breakdown of every section, metric, badge, and chart, see [FEATURES.md](docs/FEATURES.md).
0 commit comments