gsxdsm
4df5c62854
FN-8133: add local codebase context metrics
Expose local codebase token estimates and apparent disk size in the project dashboard.
- Add a bounded, cached, symlink-safe codebase metrics service and project API.
- Display token and disk indicators across Command Center overview states.
- Add formatting, route, UI, and metric calibration coverage with a minor changeset.
Files changed:
.changeset/fn-8133-codebase-metrics.md | 7 +
docs/dashboard-guide.md | 2 +-
.../dashboard/app/__tests__/api-projects.test.ts | 12 ++
packages/dashboard/app/api/legacy.ts | 14 ++
.../components/command-center/CommandCenter.css | 5 +
.../components/command-center/CommandCenter.tsx | 65 +++++++--
.../CommandCenter.mobile-chart-layout.test.ts | 4 +
.../__tests__/CommandCenter.test.tsx | 10 ++
.../__tests__/SystemStatsArea.test.tsx | 8 +
.../command-center/areas/SystemStatsArea.tsx | 8 +-
.../app/utils/__tests__/formatBytes.test.ts | 18 +++
packages/dashboard/app/utils/formatBytes.ts | 11 ++
.../src/lib/__tests__/codebase-metrics.test.ts | 62 ++++++++
.../lib/__tests__/fixtures/token-corpus/README.md | 17 +++
.../fixtures/token-corpus/calibration/component.ts | 1 +
.../fixtures/token-corpus/calibration/config.json | 1 +
.../lib/__tests__/fixtures/token-corpus/example.ts | 1 +
.../lib/__tests__/fixtures/token-corpus/notes.md | 3 +
.../fixtures/token-corpus/reference-counts.json | 9 ++
.../__tests__/fixtures/token-corpus/settings.json | 1 +
.../lib/__tests__/fixtures/token-corpus/view.tsx | 1 +
packages/dashboard/src/lib/codebase-metrics.ts | 161 +++++++++++++++++++++
.../__tests__/codebase-metrics-route.test.ts | 34 +++++
.../src/routes/register-project-routes.ts | 19 +++
24 files changed, 456 insertions(+), 18 deletions(-)
Fusion-Task-Id: FN-8133
Fusion-Task-Lineage: d591636b-d4b8-469e-8788-c4516eeb8405
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-16 14:08:43 -07:00
..
2026-07-16 14:08:43 -07:00
2026-07-15 22:11:26 -07:00
2026-05-04 21:21:22 -07:00
2026-07-06 19:03:06 -07:00
2026-06-29 21:02:34 -07:00
2026-07-01 11:12:59 -07:00
2026-07-01 07:33:56 -07:00
2026-06-30 18:15:10 -07:00
2026-04-30 22:55:48 -07:00
2026-06-22 15:23:43 -07:00
2026-05-14 02:23:45 -07:00
2026-05-18 03:10:52 -07:00
2026-07-16 03:17:35 -07:00
2026-05-21 08:43:57 -07:00
2026-07-15 14:06:42 -07:00
2026-06-27 17:22:12 -07:00
2026-06-25 12:25:13 -07:00
2026-05-22 17:24:38 -07:00
2026-05-12 21:55:43 -07:00
2026-06-14 13:50:17 -07:00
2026-07-16 14:08:43 -07:00
2026-06-27 23:53:51 -07:00
2026-04-23 00:06:03 -07:00
2026-04-02 09:58:04 -07:00
2026-07-15 10:36:10 -07:00
2026-07-04 21:28:19 -07:00
2026-06-26 09:32:53 -07:00
2026-04-23 23:02:36 -07:00
2026-04-03 18:33:23 -07:00
2026-05-08 18:44:16 -07:00
2026-06-30 19:21:53 -07:00
2026-04-29 07:10:52 -07:00
2026-06-27 23:47:21 -07:00
2026-06-28 02:04:31 -07:00
2026-07-11 22:16:48 -07:00
2026-04-08 14:38:36 -07:00
2026-06-02 14:14:24 -07:00
2026-07-12 12:52:30 -07:00
2026-07-02 11:38:31 -07:00
2026-07-11 18:07:00 -07:00
2026-06-17 17:57:19 -07:00
2026-05-21 08:43:57 -07:00
2026-07-16 01:32:23 -07:00
2026-05-20 20:27:11 -07:00
2026-05-07 18:35:45 -07:00
2026-05-14 18:35:30 -07:00
2026-07-16 02:41:27 -07:00
2026-07-16 02:01:56 -07:00
2026-05-14 05:55:16 -07:00
2026-05-19 18:56:24 -07:00
2026-06-14 13:50:17 -07:00
2026-07-11 20:37:26 -07:00
2026-07-16 03:00:59 -07:00
2026-05-13 06:29:35 -07:00
2026-07-15 10:39:57 -07:00
2026-04-12 07:00:49 -07:00
2026-05-15 07:50:34 -07:00
2026-07-11 18:07:00 -07:00
2026-07-12 13:06:08 -07:00
2026-04-28 22:43:51 -07:00
2026-05-29 20:05:14 -07:00
2026-04-29 07:10:52 -07:00