Skip to content

fix(release): publish platform packages before the wrapper - #1965

Merged
ryoppippi merged 2 commits into
mainfrom
fix/release-publish-order
Oct 24, 2026
Merged

ryoppippi merged 2 commits into
mainfrom
fix/release-publish-order

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

The release workflow could publish the npm wrapper before its optional native packages. With an install-age cutoff between those publication times, npm installs the wrapper successfully but silently omits the native dependency, and ccusage cannot start.

Registry timestamps confirm that [email protected] was published at 2026-10-21T10:49:51.361Z, while @ccusage/[email protected] followed at 2026-10-21T10:54:25.259Z. Version 20.0.43 has the same ordering gap. A disposable install reproduces the missing optional dependency:

npm i [email protected] --before=2026-10-21T10:50:30Z

Publish the six platform packages first, wait for every exact version to be visible in the registry with bounded retries, then publish the wrapper. Preserve provenance and the release job dependency. The launcher now names the missing package and version, explains install-age filters and --omit=optional, and suggests reinstalling.

Reported by @moriya-fumio-thd in mryfmo/dotfiles#496.

Validation: cutoff reproduction confirmed; Node tests, registry-gate regression tests, lint/typecheck, and repository formatting checks passed. No packages were published during validation.

Summary by CodeRabbit

  • Bug Fixes
    • Improved release sequencing so native packages are available in the registry before the CLI wrapper is published.
    • Clarified CLI errors when a supported platform’s native package is missing, including the expected package version and reinstall guidance.
    • Unsupported platforms now receive a distinct message indicating that no native binary is provided.

ryoppippi and others added 2 commits October 24, 2026 21:36
Wait for every platform package's exact version to be visible in npm
before publishing the wrapper. Bound registry retries so a missing
package fails the release instead of producing an incomplete install.

Co-authored-by: moriya-fumio-thd <[email protected]>
Include the expected package and version in the launcher error and
explain release-age cutoffs and omitted optional dependencies.

Co-authored-by: moriya-fumio-thd <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae9c2e3e-f77d-4742-9708-b33f0ba8c828
Commits

Reviewing files that changed from the base of the PR and between 7af0db6 and 117be1b.

Files selected for processing: 5
  • .github/scripts/npm-registry-gate.nu
  • .github/scripts/npm-registry-gate.test.nu
  • .github/workflows/release.yaml
  • apps/ccusage/src/cli.js
  • apps/ccusage/src/cli.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Walkthrough

The release workflow now publishes native packages before the wrapper and checks that their exact versions are available in npm. The CLI also distinguishes unsupported targets from supported targets with missing native packages.

Changes: Native Package Release

Layer / File(s) Summary
Discover and verify native package versions
.github/scripts/npm-registry-gate.nu, .github/scripts/npm-registry-gate.test.nu
The Nushell gate discovers native package names and versions, then polls npm for exact-version availability. Tests cover successful checks, delayed availability, and deadline failure.
Order native and wrapper publication
.github/workflows/release.yaml
The workflow publishes native packages, runs the gate with a five-minute timeout, and then publishes the wrapper.
Distinguish unsupported targets from missing packages
apps/ccusage/src/cli.js, apps/ccusage/src/cli.test.ts
The CLI reports unsupported platform and architecture combinations separately. Missing-package errors include the expected package and wrapper version; tests check both cases.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow
  participant RegistryGate
  participant NpmRegistry
  ReleaseWorkflow->>RegistryGate: Run gate with five-minute timeout
  RegistryGate->>NpmRegistry: Query exact native package versions
  NpmRegistry-->>RegistryGate: Return version and exit status
  RegistryGate-->>ReleaseWorkflow: Confirm availability or report timeout
  ReleaseWorkflow->>NpmRegistry: Publish wrapper after gate succeeds
Loading

Possibly related PRs

  • ccusage/ccusage#1963: Both changes gate wrapper publication on native package availability and update CLI errors for missing optional packages.
Merge Risk: Minimal · up to 117be

The release ordering and CLI diagnostics have no established merge-blocking issue in the supplied evidence. Normal release checks remain appropriate.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main release change: publishing platform packages before the wrapper.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 …
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (3 skipped: 3 unsupported.)

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide 117be1b Commit Preview URL

Branch Preview URL
Oct 24 2026, 08:38 PM

@pkg-pr-new

pkg-pr-new Bot commented Oct 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

ccusage

npx https://pkg.pr.new/ccusage@1965

@ccusage/ccusage-darwin-arm64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-arm64@1965

@ccusage/ccusage-darwin-x64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-x64@1965

@ccusage/ccusage-linux-arm64

npx https://pkg.pr.new/@ccusage/ccusage-linux-arm64@1965

@ccusage/ccusage-linux-x64

npx https://pkg.pr.new/@ccusage/ccusage-linux-x64@1965

@ccusage/ccusage-win32-x64

npx https://pkg.pr.new/@ccusage/ccusage-win32-x64@1965

commit: 117be1b

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ Publish ordering and error message look correct — one follow-up worth doing.

Reviewed changes

  • Split the release npm job into publish-natives, a registry-availability gate, then publish-wrapper, preserving provenance and the release job dependency.
  • Added .github/scripts/npm-registry-gate.nu, which discovers the six packages/ccusage-* manifests and polls npm view <name>@<version> version with bounded retries before failing.
  • Added a stub-based .test.nu covering already-visible, eventually-visible, and never-visible registry versions.
  • Updated the ccusage launcher to name the exact missing "package@version", list likely causes (--before/--min-release-age, mise minimum_release_age, --omit=optional), and use a distinct message for unsupported targets.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using muse-spark-1.3-contributor (free via Pullfrog for OSS) | 𝕏

print 'npm registry gate stub tests passed.'
}

def main []: nothing -> nothing {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This regression test has no CI caller: ci.yaml only runs contribution-gate.test.nu, so nothing executes this file on PRs. Add it next to that step so the gate stays covered.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 117be1b92188
Base SHA: 7af0db6d81ec

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 377.2ms 2.67 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 337.1ms 2.99 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 145.4ms 6.93 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 118.3ms 8.51 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 40.4ms 19.3ms 2.09x 56.00 MiB 22.96 MiB 0.41x 0.04 MiB/s 0.08 MiB/s
claude session --offline --json 0.00 MiB 37.6ms 13.2ms 2.84x 55.25 MiB 23.22 MiB 0.42x 0.04 MiB/s 0.12 MiB/s
codex daily --offline --json 0.00 MiB 34.9ms 13.3ms 2.63x 55.50 MiB 26.96 MiB 0.49x 0.02 MiB/s 0.06 MiB/s
codex session --offline --json 0.00 MiB 34.4ms 12.7ms 2.71x 55.25 MiB 26.96 MiB 0.49x 0.02 MiB/s 0.07 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 366.2ms 357.1ms 1.03x 937.34 MiB 933.34 MiB 1.00x 2.75 GiB/s 2.82 GiB/s
codex --offline --json 1.01 GiB 149.1ms 131.5ms 1.13x 519.43 MiB 523.44 MiB 1.01x 6.75 GiB/s 7.66 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 23.83 KiB 24.02 KiB +0.19 KiB 0.99x
installed native package binary 4877.53 KiB 4877.53 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 117be1b92188
Base SHA: 7af0db6d81ec

This compares the PR package against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 375.5ms 2.68 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 298.1ms 3.38 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 151.3ms 6.65 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 132.6ms 7.59 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 49.4ms 50.3ms 0.98x 55.50 MiB 55.75 MiB 1.00x 0.03 MiB/s 0.03 MiB/s
claude session --offline --json 0.00 MiB 47.0ms 49.4ms 0.95x 55.50 MiB 56.25 MiB 1.01x 0.03 MiB/s 0.03 MiB/s
codex daily --offline --json 0.00 MiB 47.2ms 42.0ms 1.12x 55.50 MiB 55.75 MiB 1.00x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 40.9ms 42.3ms 0.97x 55.75 MiB 56.00 MiB 1.00x 0.02 MiB/s 0.02 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 355.2ms 341.5ms 1.04x 919.35 MiB 913.34 MiB 0.99x 2.83 GiB/s 2.95 GiB/s
codex --offline --json 1.01 GiB 156.0ms 157.5ms 0.99x 521.43 MiB 517.43 MiB 0.99x 6.45 GiB/s 6.39 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 23.83 KiB 24.02 KiB +0.19 KiB 0.99x
installed native package binary 4877.53 KiB 4877.53 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/scripts/npm-registry-gate.test.nu">

<violation number="1" location=".github/scripts/npm-registry-gate.test.nu:147">
P2: This regression test is not wired into CI, so changes to the registry gate can break without detection. Add a CI step that runs `.github/scripts/npm-registry-gate.test.nu`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

print 'npm registry gate stub tests passed.'
}

def main []: nothing -> nothing {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: This regression test is not wired into CI, so changes to the registry gate can break without detection. Add a CI step that runs .github/scripts/npm-registry-gate.test.nu.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .github/scripts/npm-registry-gate.test.nu, line 147:

<comment>This regression test is not wired into CI, so changes to the registry gate can break without detection. Add a CI step that runs `.github/scripts/npm-registry-gate.test.nu`.</comment>

<file context>
@@ -0,0 +1,149 @@
+    print 'npm registry gate stub tests passed.'
+}
+
+def main []: nothing -> nothing {
+    test-stub
+}
</file context>

@ryoppippi
ryoppippi merged commit bd1a21a into main Oct 24, 2026
49 checks passed
@ryoppippi
ryoppippi deleted the fix/release-publish-order branch October 24, 2026 20:48
Buster210 added a commit to Buster210/ccusage that referenced this pull request Nov 6, 2026
Upstream tip: 30b653f (2026-11-06,
chore(pricing): update models.dev snapshot)
Previous fork base: c76874e (the upstream commit this fork was synced to)

Synced 128 upstream commits on top of c76874e: 70 automated pricing
snapshot refreshes and the following meaningful ones:

  b24e7a7 docs: remove LINE MAN sponsor logo (ccusage#1910)
  a93d2fe chore: release v20.0.38 (ccusage#1938)
  d91f296 docs: add ccx to community projects (ccusage#1943)
  aa7c675 chore: release v20.0.39 (ccusage#1944)
  39fefa2 fix(cli): accept --start-of-week on top-level weekly (ccusage#1945)
  600b3c9 chore: release v20.0.40 (ccusage#1946)
  baeb991 fix(antigravity): map model ID 1402 to claude-opus-5-5 (ccusage#1948)
  06347d3 chore: release v20.0.41 (ccusage#1949)
  5649632 test(hermes): derive DeepSeek provider pricing from embedded snapshot (ccusage#1951)
  d0847af chore(deps): update node.js to >=24.22.1 (ccusage#1950)
  91dfe85 chore(deps): update pullfrog/pullfrog action to v0.1.100 (ccusage#1953)
  f335280 chore: release v20.0.42 (ccusage#1952)
  b86527d chore(deps): update rust crate rustls-webpki to 0.103.16 (ccusage#1954)
  5c85ca2 chore(deps): update pullfrog/pullfrog action to v0.1.101 (ccusage#1958)
  f268798 fix(cli): apply source-specific config in unified reports (ccusage#1959)
  37a51da chore: release v20.0.43 (ccusage#1955)
  e302366 chore(deps): update github/codeql-action action to v4.39.1 (ccusage#1960)
  7af0db6 chore(deps): update pnpm to v12.15.0 (ccusage#1961)
  730c336 chore(deps): update rust crate ureq to 3.5.0 (ccusage#1964)
  bd1a21a fix(release): publish platform packages before the wrapper (ccusage#1965)
  ca33842 chore: release v20.0.44 (ccusage#1962)
  b2c8f8b chore: remove unused npm registry gate test (ccusage#1966)
  19e71d0 chore(deps): update songmu/tagpr action to v1.21.4 (ccusage#1969)
  2a84385 fix(codex): count repeated first-response snapshots once (ccusage#1971)
  60227f2 chore(deps): update rust crate smallvec to 1.16.4 (ccusage#1973)
  3e31edd chore(deps): update hustcer/setup-nu action to v3.29 (ccusage#1974)
  d93c260 feat(pricing): add gpt-6.1-terra fast/flex multipliers (ccusage#1975)
  154e13b chore: release v20.0.45 (ccusage#1967)
  f1b50e6 chore(deps): update pullfrog/pullfrog action to v0.1.102 (ccusage#1980)
  4f1f470 perf: speed up CI and local builds (ccusage#1984)
  0bd3d19 refactor(rust): move binary-only report helpers out of ccusage-core (ccusage#1985)
  65c5837 fix(antigravity): skip unreadable conversation databases (ccusage#1992)
  6372cac chore(deps): update dependency vitepress to v2.0.0-alpha.21 (ccusage#1994)
  9a42066 chore(deps): update node.js to >=24.22.2 (ccusage#1995)
  87fa788 chore(deps): update pnpm to v12.16.0 (ccusage#1996)
  8cb2532 fix(codex): price recorded Ultrafast requests at Ultrafast rates (ccusage#1989)
  128d6a0 chore(deps): update pnpm to v12.16.1 (ccusage#1997)
  5aa9d3f chore: release v20.0.46 (ccusage#1982)
  4712880 chore(deps): update rust crate unicode-width to 0.2.3 (ccusage#1998)
  3d59863 chore(deps): update node.js to v26 (ccusage#1999)
  96e98c6 chore(deps): update dependency @types/node to v26.6.6 (ccusage#2002)
  60fac54 chore(deps): update pullfrog/pullfrog action to v0.1.103 (ccusage#2003)
  de83d19 fix(config): let space-form command sections override generic report sections (ccusage#2006)
  72b8ad4 fix(all): count OpenCode Claude Agent turns once in unified reports (ccusage#2007)
  7db7a30 test(pricing): stop the alias-precedence test depending on the LiteLLM snapshot (ccusage#2009)
  e7a7ee4 fix(all): keep sessions last active on the --until day (ccusage#2008)
  4a3da73 chore: release v20.0.47 (ccusage#2001)
  8e56c11 chore(deps): update pullfrog/pullfrog action to v0.1.104 (ccusage#2010)
  e2eddf7 chore(deps): update pullfrog/pullfrog action to v0.1.107 (ccusage#2012)
  e3d2dcb chore(deps): update pullfrog/pullfrog action to v0.1.108 (ccusage#2014)
  8995f3b chore: release v20.0.48 (ccusage#2011)
  3977fd0 chore(deps): update pullfrog/pullfrog action to v0.1.110 (ccusage#2017)
  546ae51 fix(nix): make `nix flake show` work again on nixpkgs 26.11 (ccusage#2019)
  1b5e8cc chore(deps): update kesin11/actions-timeline action to v3.2.1 (ccusage#1983)
  23c5d62 chore(deps): update rust crate jiff to 0.2.39 (ccusage#2024)
  7b7cec0 chore(deps): update rust crate ureq to 3.5.1 (ccusage#2025)
  a1e4a03 chore(deps): update pullfrog/pullfrog action to v0.1.111 (ccusage#2028)
  e84d142 chore(deps): update pnpm to v12.17.0 (ccusage#2029)

Fork wins kept: the SQLite on-disk cache with its per-namespace ledger,
--live-only and clear-cache, the pi adapter with replay suppression and
per-path namespaces, the OpenCode V2 loader (now wrapped as LinkedEntry),
the FxHash/Cow hot paths, parallel per-file loads with their single_thread
seam, the table renderer, the fork CI and tag-only release workflow, and the
pricing freshness, refresh and offline precompute paths.

Hand-resolved conflicts:

  rust/adapters/claude/src/lib.rs: upstream's DedupedEntries/pruned dedupe
    lands beside the fork's collapse_replays and requestless replay rules;
    load_daily_summaries routes through load_daily_summaries_with_detection.
  rust/adapters/opencode/{parser,loader}.rs: upstream's V2 session_message
    parsing is wrapped as the fork's LinkedEntry, and the native Claude
    session link is read from the payload so it survives a cache hit.
  rust/adapters/antigravity/src/loader.rs: upstream's rewrite is taken,
    keeping the fork's per-database outcome reporting and file order.
  rust/crates/ccusage-core/src/pricing.rs: the fork's OnceLock embedded
    loader sits beside upstream's models.dev fallback and alias resolution.
  rust/crates/ccusage/src/main.rs: upstream dispatch plus the fork's
    ClearCache command.
  rust/crates/ccusage-core/src/cache.rs: the ledger is now generic over a
    LedgerPayload trait, so it covers plain entries and OpenCode's
    entry-plus-link pairs alike.
  rust/Cargo.toml: the fork's exact `=` pins stay; jiff 0.2.39,
    smallvec 1.16.4, ureq 3.5.1, unicode-width 0.2.3, rustls-webpki
    0.103.16.
  .github/workflows/{ci,release}.yaml: the fork's design is kept.
  packages/ccusage-*/package.json (6 files) and
  rust/adapters/claude/src/daily.rs: stay deleted.
  rust/crates/ccusage-core/src/{home,last_window}.rs: upstream's crate
    split moved them to ccusage-cli and ccusage-report, with their snapshots.
  apps/ccusage/config-schema.json: regenerated from the merged Rust source
    (32 numeric minimums `0.0` -> `0`, new pi description), plus three
    snapshots regenerated in the fork layout for the codex and qwen tests.

Fixes made while landing this sync, folded in so the merge stands green:

  fix(rust): decode cache blobs written before `data_session_id`. postcard
    encodes struct fields positionally, so a field added mid-struct made
    every blob the released 20.0.36 binary wrote undecodable. A failed
    decode is not merely slow: it drops the ledger rows of deleted source
    files, which no later run can rebuild. In an isolated fixture the
    released binary still reported 101,570,002 pi tokens after the source
    files were deleted; a warm build without the decoders reported 0.
    LegacyCachedEntry and LegacyLedgerEntry decode the old layout and
    reconstruct `data_session_id` as None; decode_exact requires the whole
    buffer, so a newer blob can no longer "decode" into an older struct as
    garbage. Four regression tests cover both layouts and the tail rule.
  fix(rust): warn once per table when a cached blob decodes as no known
    layout. The files table is rebuildable; the ledger table is not, so the
    warning says to save a copy before clear-cache.
  test(opencode): isolate the Claude-agent pairing test from the developer's
    real cache; it had been writing 'agent'/'plain' ledger rows into the
    opencode-db namespace.

Version: take upstream's 20.0.48 in package.json, apps/ccusage/package.json
and docs/package.json; the Rust workspace keeps version 0.0.0.

DO NOT push a v20.0.48 tag from this fork: release.yaml would publish fork
bytes under upstream identity.
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.

1 participant