feat: Dashboard stats validation with comparison and export utilities #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR lays the foundation for the Dashboard & Visualization epic by implementing comprehensive stats validation, change frequency tracking, and CLI utilities for comparison and export.
What Changed
1. Change Frequency Integration
getStats()avgCommitsPerFileandlastModifiedtotalCommitsandlastModifiedcompareStats()utility for trend analysis2. Kero Logger Integration
loggerparameter toAsyncEventBus3. CLI Stats Subcommands
statscommand with subcommands:dev statsordev stats show- Show current stats (default)dev stats compare <before> <after>- Compare two snapshotsdev stats export --format json|csv|markdown- Export statsExample Usage
Comparison Output:
Testing
Files Changed
Core:
packages/core/src/indexer/index.ts- Change frequency integrationpackages/core/src/indexer/utils/comparison.ts- Stats comparison logic (NEW)packages/core/src/indexer/utils/export.ts- Export utilities (NEW)packages/core/src/events/event-bus.ts- Kero logger integrationpackages/core/src/events/__tests__/event-bus.test.ts- Logger testsCLI:
packages/cli/src/commands/stats.ts- Restructured with subcommandspackages/cli/src/cli.test.ts- Updated structure testsBreaking Changes
None - all changes are backward compatible.
dev statsstill works as before.Next Steps
This PR sets the foundation for:
feat/sqlite-metrics-store) - Persistent time-series dataChecklist
TYPESCRIPT_STANDARDS.md)WORKFLOW.md)Related
Part of the Dashboard & Visualization epic (see
temp/dashboard-epic.md)