Skip to content
This repository was archived by the owner on Jul 30, 2026. It is now read-only.

feat(cli): make TUI the canonical local report surface - #190

Merged
makoMakoGo merged 8 commits into
personal/local-clientsfrom
codex/align-cli-with-tui
Jul 23, 2026
Merged

feat(cli): make TUI the canonical local report surface#190
makoMakoGo merged 8 commits into
personal/local-clientsfrom
codex/align-cli-with-tui

Conversation

@makoMakoGo

@makoMakoGo makoMakoGo commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • make the TUI the canonical local-report surface and keep all ten tabs available through tokscale tui --tab
  • make tokscale models consume the TUI Models projection, default to model, and accept only the four TUI Group By values
  • remove duplicate Monthly, Hourly, Time Metrics, Graph, and Clients CLI/report stacks
  • remove remote Warp credentials, GraphQL sync, cache, and command namespace while retaining local warp.sqlite Client parsing
  • keep Subscription Usage separate, including usage --json for automation
  • split cached TUI data into one Group By-invariant projection plus four Grouped projections
  • define Agent identity as (Client, Agent) and keep parser-specific normalization at parser boundaries
  • remove Wrapped Agent ranking; Wrapped now reports Top Clients only
  • document the breaking command and cache boundaries in ADRs 0006, 0008, 0026, 0028, 0029, 0030, and 0033

Architecture

client parsers
    |
    v
UnifiedMessage { client, agent, usage }
    |
    v
TuiAcc canonical fold
    |
    +-- Group By-invariant projection (stored once):
    |      agents, totals, daily/hourly totals, graph, streaks
    |
    `-- Grouped x4:
           model / client+model / client+provider+model / workspace+model
  • There is no separate “common aggregation”: both projection classes come from the same canonical TuiAcc.
  • The invariant projection is invariant only under Group By for one committed Client scope.
  • TuiAcc keeps a low-cardinality usage_totals_by_client fold so full and Client-subset report totals do not re-sort the fine-grained model map.
  • Cache schema 45 stores the invariant projection and all four Grouped projections in one atomic bundle.
  • Startup validates every persisted Grouped projection, including inactive ones, for required fields, Common shape, model identity, and model Client attribution within the immutable Client universe.
  • Full-universe Group By changes reuse the invariant projection from the pinned bundle; proper Client subsets lazily project from the canonical accumulator.

Breaking changes

  • removed root commands: monthly, hourly, time-metrics, graph, clients, and warp
  • Monthly, Weekly, Daily, Hourly, Stats, Agents, and Sessions are TUI-only
  • removed Session Group By variants and hidden hyphenated Group By aliases
  • removed the matching legacy public core report DTOs and aggregation entry points
  • removed Wrapped --ranking and --disable-pinned
  • changed serialized Agent rows from plural clients to singular client
  • cache schema 44 and older are explicit misses

Review follow-up

  • malformed active or inactive Grouped projections now invalidate schema 45 at startup
  • top-level model Client keys in all four Grouped projections must belong to the immutable Client universe
  • contribution graph and streak calculations share one captured local date
  • Group By-invariant report totals fold from canonical per-Client totals instead of the fine-grained model map
  • Wrapped active-day counts exclude zero-token buckets
  • Wrapped no longer combines same-named agents across Clients because Agent ranking was removed entirely
  • Agent and daily exports retain reasoning-token counts
  • test Client counters initialize with std::array::from_fn and do not depend on a catalog-size limit
  • OpenCode blank modes fall back to the parsed Agent; Roo Code, Kilo, and Junie normalize Agent names inside their own parsers

Validation

  • cargo test -p tokscale-core --lib — 1404 passed, 2 ignored
  • cargo test -p tokscale-cli — 757 unit tests, 87 CLI integration tests, 1 Copilot memory test, and 2 TUI exit tests passed; 1 ignored
  • focused schema-45 cache bundle suite — 16 passed
  • stabilized back-to-back release benchmarks removed the prior 12–16% projection regressions
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

该 PR 将本地报告统一到 TUI-backed UsageDatamodels headless projection,移除旧报表、Graph、clients、session 分组及 Warp 远程订阅集成,并同步更新 CLI 路由、缓存、测试、文档和性能脚本。

Changes

Canonical usage surface

Layer / File(s) Summary
Core usage projection and grouping
crates/tokscale-core/src/aggregate/*, crates/tokscale-core/src/lib.rs, crates/tokscale-core/src/usage_views.rs
聚合引擎仅生成 TUI usage;GroupBy 收敛为四种公开维度,UsageData 拆分为 Common 与 Grouped 投影。
Models CLI and cache projection
crates/tokscale-cli/src/commands/models.rs, crates/tokscale-cli/src/tui/export.rs, crates/tokscale-cli/src/tui/cache.rs
models 改用统一 UsageData 生成表格和 JSON;TUI 缓存升级为 schema 45,并增加投影形状、重复键和客户端成员校验。
CLI surface, Wrapped, and providers
crates/tokscale-cli/src/cli.rs, crates/tokscale-cli/src/main.rs, crates/tokscale-cli/src/commands/wrapped.rs, crates/tokscale-cli/src/commands/usage/*
CLI 保留 TUI、Models、Usage、Pricing、Wrapped 和 Cache;Wrapped 使用 TUI usage,Warp 远程 provider 与旧命令路径被移除。
Validation and supporting updates
crates/tokscale-cli/tests/*, crates/tokscale-core/src/lib_tests.rs, scripts/*, docs/*, README.md
测试迁移到新的 JSON、分组和拒绝规则;文档及性能脚本改用 Models、TUI-only tabs 和 Usage。

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related issues

Possibly related PRs

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ModelsCLI
  participant Core
  participant TUIProjection
  participant Renderer
  User->>ModelsCLI: models --json or table
  ModelsCLI->>Core: get_usage_data(ReportOptions)
  Core->>TUIProjection: aggregate with ViewSet::TUI
  TUIProjection-->>Core: UsageData and health
  Core-->>ModelsCLI: UsageData
  ModelsCLI->>Renderer: build JSON or render table
  Renderer-->>User: models projection
Loading

Poem

小兔敲键盘,旧命令轻轻藏,
Models 披月光,TUI 聚成一方。
Graph 跳进回忆,Warp 远行无响,
JSON 排成胡萝卜,
新路径闪闪亮。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 87.05% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了本次将 TUI 设为本地报告规范入口的主要变更。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/align-cli-with-tui

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20291d6c86

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/tokscale-cli/src/commands/wrapped.rs Outdated
Comment thread crates/tokscale-cli/src/commands/wrapped.rs Outdated
@codspeed-hq

codspeed-hq Bot commented Jul 23, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 30.56%

⚡ 9 improved benchmarks
✅ 24 untouched benchmarks
🆕 4 new benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
tui_accumulator_build[production_shaped_repeated_fine_keys_100k] 348.7 ms 232.1 ms +50.27%
tui_accumulator_lifecycle[build_plus_initial_model_projection] 369.5 ms 252.5 ms +46.32%
tui_accumulator_lifecycle[build_plus_initial_model_plus_1_switch_to_workspace_model] 394.6 ms 276.3 ms +42.82%
tui_accumulator_lifecycle[build_plus_initial_model_plus_2_switches_to_workspace_then_client_provider] 418 ms 298.1 ms +40.22%
tui_accumulator_build[high_unique_fine_keys_100k] 514.5 ms 397.6 ms +29.4%
aggregation_engine_push_finish[tui_model] 670.5 ms 552.3 ms +21.39%
aggregation_engine_push_finish[tui_client_model] 675 ms 557.1 ms +21.17%
aggregation_engine_push_finish[tui_workspace_model] 716.9 ms 599.7 ms +19.54%
aggregation_engine_push_finish[tui_workspace_high_cardinality] 1.9 s 1.7 s +10.06%
🆕 aggregation_engine_push_finish[tui_client_provider_model] N/A 637.9 ms N/A
🆕 aggregation_engine_push_finish[tui_model_high_session_cardinality] N/A 621.2 ms N/A
🆕 tui_accumulator_lifecycle[build_plus_initial_model_plus_3_public_grouping_switches] N/A 317.8 ms N/A
🆕 tui_accumulator_project[high_model] N/A 181.7 ms N/A

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/align-cli-with-tui (54f009e) with personal/local-clients (07c6f34)

Open in CodSpeed

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/tokscale-cli/src/tui/export.rs (1)

60-76: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

agents/daily 导出的 tokens 明细缺少 reasoning,与新 models 块不一致。

models 块本次新增了 reasoning/displayedOutput 字段,但 agents/dailytokens 对象仍只暴露 input/output/cacheRead/cacheWrite/total。由于 total() 内部包含 reasoning,当 reasoning tokens 非零时,total 会大于展示字段之和,容易让消费该导出 JSON 的脚本/用户产生对账困惑。

♻️ 建议为 agents/daily 补充 reasoning 字段
                 "tokens": {
                     "input": a.tokens.input,
                     "output": a.tokens.output,
+                    "reasoning": a.tokens.reasoning,
                     "cacheRead": a.tokens.cache_read,
                     "cacheWrite": a.tokens.cache_write,
                     "total": a.tokens.total()
                 },

同理为 daily 块的 tokens 对象补充。

Also applies to: 82-96

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/tokscale-cli/src/tui/export.rs` around lines 60 - 76, 在 agents 导出映射的
tokens 对象中补充 reasoning 字段,并在对应的 daily 导出映射中同步补充相同字段,使用现有的 reasoning token 属性;保持
input、output、缓存字段及 total 的现有行为不变,使明细字段与 models 块保持一致。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/tokscale-core/src/lib_tests.rs`:
- Around line 25-43: Remove the derived Default implementation from
TestClientCounts and provide an explicit default initialization using
std::array::from_fn (or an equivalent closure-based approach) so [i32;
ClientId::COUNT] works for any length. Keep from_messages and get behavior
unchanged.

---

Nitpick comments:
In `@crates/tokscale-cli/src/tui/export.rs`:
- Around line 60-76: 在 agents 导出映射的 tokens 对象中补充 reasoning 字段,并在对应的 daily
导出映射中同步补充相同字段,使用现有的 reasoning token 属性;保持 input、output、缓存字段及 total
的现有行为不变,使明细字段与 models 块保持一致。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 89b99ffa-7f52-41b2-b08b-32ea90e98e6f

📥 Commits

Reviewing files that changed from the base of the PR and between 07c6f34 and 20291d6.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (56)
  • README.md
  • crates/tokscale-cli/Cargo.toml
  • crates/tokscale-cli/src/claude_diagnostics.rs
  • crates/tokscale-cli/src/cli.rs
  • crates/tokscale-cli/src/commands/clients.rs
  • crates/tokscale-cli/src/commands/graph.rs
  • crates/tokscale-cli/src/commands/hourly.rs
  • crates/tokscale-cli/src/commands/integrations.rs
  • crates/tokscale-cli/src/commands/mod.rs
  • crates/tokscale-cli/src/commands/models.rs
  • crates/tokscale-cli/src/commands/monthly.rs
  • crates/tokscale-cli/src/commands/render.rs
  • crates/tokscale-cli/src/commands/shared.rs
  • crates/tokscale-cli/src/commands/time_metrics.rs
  • crates/tokscale-cli/src/commands/usage/mod.rs
  • crates/tokscale-cli/src/commands/usage/warp.rs
  • crates/tokscale-cli/src/commands/wrapped.rs
  • crates/tokscale-cli/src/main.rs
  • crates/tokscale-cli/src/main_tests.rs
  • crates/tokscale-cli/src/tui/app.rs
  • crates/tokscale-cli/src/tui/cache.rs
  • crates/tokscale-cli/src/tui/export.rs
  • crates/tokscale-cli/src/tui/mod.rs
  • crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs
  • crates/tokscale-cli/src/warp.rs
  • crates/tokscale-cli/tests/cli_tests.rs
  • crates/tokscale-core/benches/aggregation.rs
  • crates/tokscale-core/src/aggregate/accumulators.rs
  • crates/tokscale-core/src/aggregate/config.rs
  • crates/tokscale-core/src/aggregate/engine.rs
  • crates/tokscale-core/src/aggregate/graph_result.rs
  • crates/tokscale-core/src/aggregate/keys.rs
  • crates/tokscale-core/src/aggregate/mod.rs
  • crates/tokscale-core/src/aggregate/parity_tests.rs
  • crates/tokscale-core/src/aggregate/tui.rs
  • crates/tokscale-core/src/aggregate/views.rs
  • crates/tokscale-core/src/clients.rs
  • crates/tokscale-core/src/lib.rs
  • crates/tokscale-core/src/lib_tests.rs
  • crates/tokscale-core/src/sessionize.rs
  • crates/tokscale-core/src/usage_views.rs
  • docs/adr/0007-client-identity-catalog.md
  • docs/adr/0014-explicit-subscription-usage-boundary.md
  • docs/adr/0022-deterministic-cli-command-semantics.md
  • docs/adr/0024-subscription-usage-redesign.md
  • docs/adr/0025-antigravity-cli-only-local-input.md
  • docs/adr/0026-group-by-view-scope-contract.md
  • docs/adr/0027-current-input-discovery-and-graph-semantics.md
  • docs/adr/0033-tui-canonical-local-report-surface.md
  • docs/cli.md
  • docs/clients.md
  • docs/configuration.md
  • docs/performance/2026-07-10-scan-rss-optimization.md
  • docs/performance/2026-07-21-public-surface-cleanup.md
  • scripts/measure-scan-performance.sh
  • scripts/test-measure-scan-performance.sh
💤 Files with no reviewable changes (20)
  • crates/tokscale-core/src/aggregate/accumulators.rs
  • crates/tokscale-cli/src/commands/usage/warp.rs
  • crates/tokscale-core/src/aggregate/parity_tests.rs
  • crates/tokscale-cli/src/commands/integrations.rs
  • crates/tokscale-cli/src/commands/monthly.rs
  • crates/tokscale-cli/src/commands/mod.rs
  • crates/tokscale-cli/src/commands/hourly.rs
  • crates/tokscale-cli/src/commands/clients.rs
  • crates/tokscale-core/src/aggregate/graph_result.rs
  • crates/tokscale-cli/src/commands/time_metrics.rs
  • crates/tokscale-cli/src/commands/graph.rs
  • crates/tokscale-cli/src/commands/shared.rs
  • crates/tokscale-cli/Cargo.toml
  • crates/tokscale-cli/src/warp.rs
  • crates/tokscale-cli/src/tui/cache.rs
  • crates/tokscale-core/src/sessionize.rs
  • crates/tokscale-core/src/clients.rs
  • crates/tokscale-cli/src/commands/render.rs
  • crates/tokscale-cli/src/commands/usage/mod.rs
  • crates/tokscale-cli/src/main.rs

Comment thread crates/tokscale-core/src/lib_tests.rs Outdated
@makoMakoGo

Copy link
Copy Markdown
Owner Author

Review follow-up pushed in bff95a7c through be52290c:

  • reduced common aggregation to a domain-neutral numerical fold and split cache schema 45 into one Common payload plus four Grouped projections
  • made Agent identity exactly (Client, Agent) and moved Client-specific Agent normalization to parser boundaries
  • removed Wrapped Agent ranking and its flags entirely; Wrapped now reports Top Clients only
  • fixed active-day counting so zero-token buckets do not count
  • retained reasoning tokens in Agent and daily exports
  • made test Client counters independent of the current catalog size
  • added strict cache-shape, duplicate-key, Client-membership, parser-boundary, projection, and round-trip coverage

Local validation:

  • core: 1402 passed, 2 ignored
  • CLI: 755 unit, 87 integration, 1 Copilot memory, and 2 TUI exit tests passed; 1 ignored
  • workspace Clippy with -D warnings, rustfmt check, and git diff --check passed

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

@makoMakoGo: Reviewing the follow-up changes, including the aggregation/cache-schema refactor, agent identity boundary, Wrapped surface changes, and the expanded validation coverage.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 20291d6c86

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@makoMakoGo makoMakoGo closed this Jul 23, 2026
@makoMakoGo makoMakoGo reopened this Jul 23, 2026
@makoMakoGo

Copy link
Copy Markdown
Owner Author

The pull ref is now synchronized at be52290c; please review the current head.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

if field == self.selected_field {
selected = Some(map.next_value()?);
} else {
map.next_value::<IgnoredAny>()?;

P2 Badge Reject malformed inactive Group By projections at cache load

Startup always loads the model projection, so this visitor merely skips the contents of the other three projections while treating the bundle as fresh. If, for example, clientModel is malformed or has Common-incompatible rows, the TUI installs the cache successfully; switching Group By later fails in ProjectionStore::project, restores the old selection, and does not rebuild the invalid generation. Validate every persisted projection when accepting the schema-45 bundle so a corrupted inactive projection becomes the intended cache miss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/tokscale-core/src/sessions/junie.rs

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/tokscale-core/src/aggregate/tui.rs`:
- Around line 229-237: Update build_common_contribution_graph and
calculate_common_streaks so they use an explicit shared today value instead of
independently calling Local::now(). In project_common_selected, capture the date
once per projection and pass it to both calculations, preserving consistent
graph and streak results across midnight and repeated projections.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5369412e-2946-4da6-9b23-3ae780699332

📥 Commits

Reviewing files that changed from the base of the PR and between 20291d6 and be52290.

📒 Files selected for processing (33)
  • crates/tokscale-cli/src/cli.rs
  • crates/tokscale-cli/src/commands/wrapped.rs
  • crates/tokscale-cli/src/main.rs
  • crates/tokscale-cli/src/main_tests.rs
  • crates/tokscale-cli/src/tui/app.rs
  • crates/tokscale-cli/src/tui/cache.rs
  • crates/tokscale-cli/src/tui/data/mod.rs
  • crates/tokscale-cli/src/tui/export.rs
  • crates/tokscale-cli/src/tui/ui/agents.rs
  • crates/tokscale-cli/tests/cli_tests.rs
  • crates/tokscale-core/src/adapters/file.rs
  • crates/tokscale-core/src/adapters/junie.rs
  • crates/tokscale-core/src/adapters/kilo.rs
  • crates/tokscale-core/src/adapters/mod.rs
  • crates/tokscale-core/src/adapters/omp.rs
  • crates/tokscale-core/src/adapters/roocode.rs
  • crates/tokscale-core/src/aggregate/keys.rs
  • crates/tokscale-core/src/aggregate/tui.rs
  • crates/tokscale-core/src/lib_tests.rs
  • crates/tokscale-core/src/sessions/junie.rs
  • crates/tokscale-core/src/sessions/kilo.rs
  • crates/tokscale-core/src/sessions/mod.rs
  • crates/tokscale-core/src/sessions/opencode.rs
  • crates/tokscale-core/src/sessions/roocode.rs
  • crates/tokscale-core/src/usage_views.rs
  • docs/adr/0006-agent-identity-for-agents-tab.md
  • docs/adr/0008-single-copy-memory-pipeline.md
  • docs/adr/0026-group-by-view-scope-contract.md
  • docs/adr/0028-tui-client-universe-and-view-selection.md
  • docs/adr/0029-keep-claude-discovery-catalog-scoped.md
  • docs/adr/0030-client-input-and-data-health-terminology.md
  • docs/adr/0033-tui-canonical-local-report-surface.md
  • docs/cli.md
💤 Files with no reviewable changes (4)
  • crates/tokscale-cli/src/main.rs
  • crates/tokscale-cli/src/cli.rs
  • crates/tokscale-core/src/aggregate/keys.rs
  • crates/tokscale-cli/tests/cli_tests.rs
🚧 Files skipped from review as they are similar to previous changes (4)
  • crates/tokscale-cli/src/tui/export.rs
  • crates/tokscale-cli/src/main_tests.rs
  • docs/cli.md
  • crates/tokscale-core/src/lib_tests.rs

Comment thread crates/tokscale-core/src/aggregate/tui.rs Outdated
@makoMakoGo

Copy link
Copy Markdown
Owner Author

Follow-up pushed in 4122860:

  • cache startup now deserializes and validates all four persisted Group By projections, including inactive ones, before accepting schema 45;
  • Common graph and streak calculations share one captured today;
  • Common full-period totals now fold from a canonical per-Client usage index instead of re-sorting the fine-grained model map;
  • the per-Client index is named usage_totals_by_client to describe its domain rather than implying a second “common aggregation”;
  • local back-to-back release benchmarks removed the previous 12–16% projection regressions (three full projections are slightly faster than the old baseline; the single-Client projection is within ~2.1% sample variance);
  • no Junie change was made for the whitespace-name comment because string_field already trims and rejects blank strings before the existing ID fallback.

Validation on the current head:

  • core library: 1404 passed, 2 ignored;
  • CLI: 756 unit tests, 87 CLI integration tests, 1 Copilot memory test, and 2 TUI exit tests passed; 1 ignored;
  • all 8 schema-45 cache regressions passed;
  • workspace Clippy with warnings denied, rustfmt check, and diff check passed.

Please review the current head 4122860.

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

@makoMakoGo: Reviewing the current head at 4122860, with particular attention to schema-45 validation, Common projection correctness, agent parser boundaries, and the reported regression fixes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 412286007d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/tokscale-cli/src/tui/cache.rs Outdated
@makoMakoGo

Copy link
Copy Markdown
Owner Author

The current head is now 4c84f4c.

This fixes the valid Client-universe review finding:

  • all four persisted Grouped projections, including inactive ones, retain only their low-cardinality top-level model Client key sets during startup validation;
  • those keys are checked against the bundle's clientUniverse, which is subsequently exact-matched to the immutable requested universe;
  • the selected assembled UsageData.models is checked again before installation;
  • the existing multi-Client display contract is centralized in UsageModelEntry::client_keys() and reused by both cache validation and tokscale models;
  • active model and inactive workspaceModel corruption regressions cover merged Client labels containing a foreign Client.

Current-head local validation:

  • core library: 1404 passed, 2 ignored;
  • CLI: 847 passed, 1 ignored across four suites;
  • workspace Clippy with warnings denied;
  • rustfmt and staged diff checks passed.

Please review the current head.

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

@makoMakoGo: Reviewing the current head at 4c84f4c, with focus on the Client-universe validation across active and inactive grouped cache projections, plus the centralized multi-Client display-key contract.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 4c84f4c378

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@makoMakoGo
makoMakoGo merged commit a0d60f8 into personal/local-clients Jul 23, 2026
10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant