Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ these are upstream fixes a sync will *gain*.)
| Patch | Files | Status upstream |
|---|---|---|
| Grok usage-row accessor naming: `ParsedUsage::token_breakdown(&self)` avoids Rust 1.96.1's `clippy::wrong_self_convention` rejection of the former borrowed `into_*` name. This is a private-method rename only; parsed output, cache schema, and runtime behavior are unchanged. | `src/sessions/grok.rs` | TokenBar-local maintenance for the local `turn_completed.usage` path |
| Cross-platform test cfg hygiene: the Copilot Desktop mtime helper import now follows its existing Unix-only test, while four Kiro globalStorage fixture helpers follow their existing macOS-only tests. This removes Windows Rust 1.96.1 strict-Clippy unused/dead-code failures without changing tests or runtime behavior. | `src/lib.rs` (tests) | Candidate for upstream test-only cleanup |
| PR #2 (perf, partially retired by M26-A): `LocalParseOptions.modified_after` mtime pruning and `latest_source_mtime_ms()` change probing remain active. M26-A removes `HASH_MEMO` because path/size/mtime memoization can bypass bounded sample validation, and removes monolith-only `STORE_MEMO` because shard dirty tracking owns persistence | `src/message_cache.rs`, `src/lib.rs` | Remaining mtime/pruning seam not yet forwarded; retired memos must not be re-applied |
| PR #3 (perf): streaming per-file aggregation replaces materialize-then-aggregate for the graph/model/monthly/hourly reports — `StreamingAggregator` + `SessionizeAccumulator` folded by `scan_messages_streaming` in one cache-aware pass (no full-history `Vec`). Each client lane owns its dedup set (follow-up `0752e35`: prevents cross-client `dedup_key` collisions). | `src/aggregator.rs`, `src/lib.rs`, `src/sessionize.rs`, `tests/streaming_snapshot.rs` | not yet forwarded to junhoyeo/tokscale |
| #6 (fix): the **agents report** now folds over `scan_messages_streaming` too — new `get_agents_report` (mirrors `get_model_report`, `resolve_report_clients` + a single streaming pass into `AgentAccumulator`), so it shares the one deduped/per-client-gated/priced stream as every other report (resolves the issue #6 divergence: agents no longer over-counts copilot/codebuff/kimi/cursor/warp/… duplicate `dedup_key`s, and scans the same client set). `parse_local_unified_messages` survives as public API only (footgun-documented, no in-repo callers). `crates/tb_core_ffi/src/agents_report.rs` is now a thin mapper like `model_report.rs` (no longer byte-identical to the archived Tauri original — accepted). | `src/lib.rs`, `crates/tb_core_ffi/src/agents_report.rs` | not yet forwarded to junhoyeo/tokscale |
Expand Down
22 changes: 12 additions & 10 deletions vendor/tokscale-core/SYNC.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
| Field | Value |
|---|---|
| Source repo | [Nanako0129/TokenBar](https://github.com/Nanako0129/TokenBar) |
| Copied commit | [`1d874cdf1c6db97225d4703a25214be75bc33e7b`](https://github.com/Nanako0129/TokenBar/commit/1d874cdf1c6db97225d4703a25214be75bc33e7b) |
| Copied commit | [`729dc3adf21cc31e16ef0b8b742f0244197d7058`](https://github.com/Nanako0129/TokenBar/commit/729dc3adf21cc31e16ef0b8b742f0244197d7058) |
| Copied on | 2026-07-28 |

`1d874cdf1c6db97225d4703a25214be75bc33e7b` is the final rebase-merged Native
PR #112 commit on `main`. It preserves the issue-107 filter-parity diagnostic
and renames the private Grok `ParsedUsage` accessor to `token_breakdown(&self)`
so Rust 1.96.1 strict Clippy accepts its borrowed receiver. Parsing, cache
schema, C ABI, and runtime output are unchanged.
`729dc3adf21cc31e16ef0b8b742f0244197d7058` is the final rebase-merged Native
PR #113 commit on `main`. It keeps the Copilot Desktop mtime helper import on
its existing Unix-only test and keeps four Kiro globalStorage fixture helpers
on their existing macOS-only tests. Windows Rust 1.96.1 strict Clippy therefore
does not compile unused test declarations. Test bodies, parsing, cache schema,
C ABI, and runtime output are unchanged.

The active cache is format 2 at `source-message-cache-v2`; format-1 shards are
stale and rebuild cold under format 2. The legacy schema-32 monolith
Expand All @@ -28,14 +29,15 @@ cross-check copy are byte-identical to the same Native fixture.

The macOS-side downstream gate passed against this exact sync:

- `crates/` is byte-identical to Native `1d874cdf`; `vendor/` is
- `crates/` is byte-identical to Native `729dc3ad`; `vendor/` is
byte-identical after excluding Native-only `vendor/AGENTS.md` and this
Windows-only `SYNC.md`; the C header and both provider-v3 fixture copies also
match byte-for-byte.
- `Cargo.lock` is unchanged, `git diff --check` passes, and the exact shared
tree was not reformatted.
- Rust 1.96.1 strict Clippy passes for `tokscale-core`; focused Grok tests pass
49/49.
- Rust 1.96.1 strict Clippy passes for `tokscale-core`. Before this exact sync,
the same cfg repair also passed native Windows x64 strict Clippy with the
standalone candidate lock unchanged.
- `scripts/check.sh` passes with locked dependencies: workspace check, all Rust
tests (including 319 FFI and 1,290 vendor unit tests), release build, locked
.NET restore, solution build with zero warnings/errors, all 287 Core tests,
Expand All @@ -56,7 +58,7 @@ then update its commit, date, and verification fields before committing:

```bash
: "${TOKENBAR_NATIVE:?set TOKENBAR_NATIVE to a clean Native checkout}"
source_commit=1d874cdf1c6db97225d4703a25214be75bc33e7b
source_commit=729dc3adf21cc31e16ef0b8b742f0244197d7058
stage="$(mktemp -d)"
sync_record="$(mktemp)"
trap 'rm -rf "$stage"; rm -f "$sync_record"' EXIT
Expand Down
14 changes: 10 additions & 4 deletions vendor/tokscale-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5163,12 +5163,14 @@ pub fn parsed_to_unified(msg: &ParsedMessage, cost: f64) -> UnifiedMessage {

#[cfg(test)]
mod tests {
#[cfg(unix)]
use super::copilot_desktop_source_mtime_ms;
use super::{
agent_bucket_key, aggregate_model_usage_entries, apply_pricing_if_available,
canonical_model_id, clear_model_aliases, copilot_desktop_source_mtime_ms,
dedupe_latest_trae_messages, fold_messages_streaming, get_agents_report, get_hourly_report,
get_model_report, get_monthly_report, latest_source_mtime_ms, local_source_change_token,
message_cache, model_alias_generation, normalize_model_for_grouping, normalize_syntactic,
canonical_model_id, clear_model_aliases, dedupe_latest_trae_messages,
fold_messages_streaming, get_agents_report, get_hourly_report, get_model_report,
get_monthly_report, latest_source_mtime_ms, local_source_change_token, message_cache,
model_alias_generation, normalize_model_for_grouping, normalize_syntactic,
opencode_authoritative_sources, opencode_identity_group,
parse_all_messages_with_pricing_with_env_strategy, parse_local_clients,
parse_local_unified_messages, parsed_to_unified, pricing, prune_scan_result_by_mtime,
Expand Down Expand Up @@ -15404,17 +15406,20 @@ mod tests {
assert_eq!(total_cache_read, i64::MAX);
}

#[cfg(target_os = "macos")]
fn m15a_global_root(home: &Path) -> PathBuf {
home.join("Library/Application Support/Kiro/User/globalStorage/kiro.kiroagent")
}

#[cfg(target_os = "macos")]
fn write_m15a_snapshot(home: &Path, body: &str) -> PathBuf {
let path = m15a_global_root(home).join("workspace-a/conversation.chat");
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
std::fs::write(path, body).unwrap();
m15a_global_root(home).join("workspace-a/conversation.chat")
}

#[cfg(target_os = "macos")]
fn write_m15a_execution(home: &Path, status: &str, start_time: &str) -> PathBuf {
let path = m15a_global_root(home).join("workspace-a/execution-store/execution");
std::fs::create_dir_all(path.parent().unwrap()).unwrap();
Expand All @@ -15437,6 +15442,7 @@ mod tests {
path
}

#[cfg(target_os = "macos")]
fn m15a_snapshot_body(execution_id: &str, prompt: &str, response: &str) -> String {
format!(
r#"{{
Expand Down
Loading