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:01:59 -07:00
2026-07-13 10:32:12 -07:00
2026-07-16 13:41:14 -07:00
2026-07-16 14:08:43 -07:00
2026-07-15 14:41:05 -07:00
2026-07-13 10:32:12 -07:00
2026-07-16 13:48:00 -07:00
2026-07-16 13:41:14 -07:00
2026-07-13 10:32:12 -07:00
2026-07-13 10:32:12 -07:00
2026-06-08 15:19:27 -07:00
2026-07-15 08:44:11 -07:00