Skip to content

feat: add daily dashboard with CLI/model grouping#7

Merged
Miss-you merged 1 commit into
mainfrom
feat/daily-dashboard-grouping
Feb 21, 2026
Merged

feat: add daily dashboard with CLI/model grouping#7
Miss-you merged 1 commit into
mainfrom
feat/daily-dashboard-grouping

Conversation

@Miss-you

Copy link
Copy Markdown
Owner

Summary

  • Switch codetok daily default terminal output to a three-section dashboard.
  • Add explicit aggregation dimension control via --group-by (cli default, model opt-in).
  • Add --top to control share section size and propagate grouping metadata in JSON (group_by, group, providers).
  • Populate SessionInfo.ModelName across Kimi/Claude/Codex parsers and normalize common model aliases for stable model grouping.

Changes

  • cmd/daily.go: introduce dashboard rendering, --group-by, --top, and updated unit default (m).
  • stats/aggregator.go: add dimension-aware aggregation and model alias normalization.
  • provider/provider.go: extend data model with ModelName and grouping fields in DailyStats.
  • provider/kimi/parser.go, provider/claude/parser.go, provider/codex/parser.go: add model extraction/fallback paths.
  • cmd/daily_test.go, stats/aggregator_test.go, provider/*_test.go, e2e/e2e_test.go, provider/provider_test.go: expand coverage for new flags, dashboard output, JSON semantics, parser model extraction, and alias behavior.
  • README.md, AGENTS.md: sync docs/contracts with new defaults and output semantics.

Validation

  • test: make test
  • lint: make lint
  • build: make build
  • static check: make vet

Risks / Notes

  • --top validation is now skipped for --json mode to keep JSON behavior aligned with --unit (ignored in JSON path).
  • Dashboard output is validated via unit + e2e string assertions; future formatting tweaks should update expected snapshots/assertions accordingly.

Copilot AI review requested due to automatic review settings February 21, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new dashboard-based terminal output for codetok daily with configurable grouping dimensions. It introduces model-based aggregation as an opt-in alternative to the default CLI/provider grouping, extracts model names across all three providers (Kimi, Claude, Codex), and normalizes common model aliases for stable grouping.

Changes:

  • Introduced three-section dashboard layout (Daily Trend, Group Ranking, Top Share) replacing the previous table output for codetok daily
  • Added --group-by flag (cli/model) and --top flag to control aggregation dimension and share section size
  • Populated SessionInfo.ModelName across parsers with fallback extraction from multiple sources (wire events, metadata, Kimi logs)

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cmd/daily.go Implements dashboard rendering with three sections, adds --group-by and --top flags, changes default unit from k to m
cmd/daily_test.go Unit tests for new flags, dashboard output validation, and edge case handling
stats/aggregator.go Dimension-aware aggregation with model/CLI grouping support, model alias normalization, and multi-provider group handling
stats/aggregator_test.go Comprehensive test coverage for model/CLI grouping, multi-provider scenarios, unknown model handling, and alias normalization
provider/provider.go Extends data model with ModelName in SessionInfo and grouping fields (GroupBy, Group, Providers) in DailyStats
provider/provider_test.go JSON serialization tests for single and multi-provider grouping semantics
provider/kimi/parser.go Model extraction from wire StatusUpdate, metadata JSON, and fallback from Kimi log files with session-to-model index
provider/kimi/parser_test.go Tests for model extraction from all sources and normalization of Kimi-specific aliases
provider/claude/parser.go Model extraction from Claude event messages
provider/claude/parser_test.go Tests for Claude model extraction
provider/codex/parser.go Recursive model extraction from Codex event payloads with multiple field name candidates
provider/codex/parser_test.go Tests for Codex model extraction from various payload structures
e2e/e2e_test.go Integration tests for JSON output with both grouping modes and dashboard output validation
README.md Updated documentation for new dashboard output, flags, and JSON semantics
AGENTS.md Updated contract documentation for new defaults and grouping behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Miss-you
Miss-you merged commit 6625eb7 into main Feb 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants