Release 1.10.0: Astra accounting and clearer daily usage - #73
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
There’s at least one confirmed determinism/publishing robustness issue in newly added release/demo tooling that should be fixed before shipping.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR prepares the 1.10.0 release by improving Codex accounting (new receipt format + dedup), clarifying cost provenance across surfaces (estimated vs tool‑reported vs unavailable), and updating packaging so distributable artifacts include license/source materials.
Changes:
- Add Codex
token_usage_recordsupport with dedup against legacy counters + SQLite fallback coverage improvements. - Introduce cost provenance (“CostBasis”) across core signals and update macOS/web/CLI copy to reflect estimate vs tool‑reported semantics.
- Update release/publish pipeline to build installable npm tarballs (workspace deps resolved) and bundle license/source materials into npm + macOS artifacts, plus add walkthrough/trial documentation.
File summaries
| File | Description |
|---|---|
| scripts/release.sh | Switch npm publishing to prepacked tarballs prepared via a helper script. |
| scripts/prepare-packages.sh | New helper to pack npm artifacts (via Bun) and verify workspace:* deps are resolved. |
| scripts/prepare-license-materials.py | New helper to bundle license texts + a source snapshot into distributable artifacts. |
| scripts/generate-demo.ts | Generate synthetic demo scenes/snapshots for macOS walkthrough assets. |
| README.md | Rewrite top-level messaging; add walkthrough links and clearer cost semantics. |
| packages/web/src/pages/dashboard/DashboardOverviewSection.tsx | Add cost-semantics disclaimer text and tweak panel title. |
| packages/web/package.json | Bump version to 1.10.0. |
| packages/tui/package.json | Bump version to 1.10.0. |
| packages/tokmeter/package.json | Bump version; add prepack to stage license/source materials. |
| packages/mcp/src/daemon/server.ts | Add today=true support for sessions endpoint and pass through to core. |
| packages/mcp/package.json | Bump version; add prepack to stage license/source materials. |
| packages/macos-bar/Tests/TokmeterBarTests/TodayUsageTests.swift | Add tests for idle-day handling and cost-basis preservation cases. |
| packages/macos-bar/Tests/TokmeterBarTests/DemoRenderTests.swift | Add opt-in rendering test for demo walkthrough assets. |
| packages/macos-bar/Sources/TokmeterBar/UsageOverview.swift | New shared view composing models/projects + “Usage details” disclosure. |
| packages/macos-bar/Sources/TokmeterBar/TokmeterLoader.swift | Add today-projects fetch, fix idle-day “today” mapping, adjust model list ownership. |
| packages/macos-bar/Sources/TokmeterBar/TokmeterBarView.swift | Swap scroll content to UsageOverview; adjust sizing. |
| packages/macos-bar/Sources/TokmeterBar/TokmeterBarApp.swift | Menubar label + accessibility string now lead with today’s tokens. |
| packages/macos-bar/Sources/TokmeterBar/StatCards.swift | Rename cost card label to “COST TOTAL”. |
| packages/macos-bar/Sources/TokmeterBar/Models.swift | Add CostBasis + wire fields for statbar signals. |
| packages/macos-bar/Sources/TokmeterBar/HubOverview.swift | Update overview copy to reflect usage/cost semantics. |
| packages/macos-bar/Sources/TokmeterBar/HeroHeader.swift | Make tokens the hero headline; show cost breakdown from cost basis. |
| packages/macos-bar/Sources/TokmeterBar/FooterBar.swift | Add “Licenses & source” link into the app UI. |
| packages/macos-bar/Sources/TokmeterBar/DataSections.swift | Default to Today models; add “Show all” controls; shift sessions to today’s projects. |
| packages/macos-bar/Sources/TokmeterBar/DaemonClient.swift | Add today query support for sessions fetch. |
| packages/macos-bar/README.md | Update UI description and add clearer cost semantics. |
| packages/macos-bar/bundle.sh | Bump versions and include license/source materials in app bundle Resources. |
| packages/core/src/usage.ts | Adjust “visible output” derivation to avoid double-subtracting reasoning. |
| packages/core/src/usage.test.ts | Update test to match corrected visible-output semantics. |
| packages/core/src/types.ts | Add CostBasis and optional cost-basis fields to StatbarSignals. |
| packages/core/src/tokmeter-core.ts | Add today option to project summaries for today-only views. |
| packages/core/src/signals.ts | Add cost-basis summarization and adjust reasoning-share denominator semantics. |
| packages/core/src/signals.test.ts | Update reasoning-share expectations and add coverage for ineligible records. |
| packages/core/src/scan-lifetime.test.ts | Add assertions for today-only vs lifetime project totals. |
| packages/core/src/pricing.ts | Respect explicit zero rates and reject negative pricing rates. |
| packages/core/src/pricing.test.ts | Add tests for explicit-zero rates and negative-rate rejection. |
| packages/core/src/pricing-enrichment.ts | Preserve explicit tool-reported $0 cost records (don’t overwrite with estimates). |
| packages/core/src/pricing-enrichment.test.ts | Add test for tool-reported $0 preservation. |
| packages/core/src/parsers/utils.ts | Bump scan cache version with notes. |
| packages/core/src/parsers/fixtures/codex-response-usage.json | Add synthetic fixture for current Codex receipt format. |
| packages/core/src/parsers/codex.ts | Prefer per-response receipts, dedup mirrored legacy counters, and improve model/turn handling. |
| packages/core/src/parsers/codex.test.ts | Add extensive tests for new receipt format + dedup/replay behavior. |
| packages/core/src/parsers/codex-desktop.ts | Detect token_usage_record coverage and cache/stream coverage checks to avoid double-counting. |
| packages/core/src/parsers/codex-desktop.test.ts | Add tests for new receipt coverage detection and replay handling. |
| packages/core/src/cost-basis.ts | New cost-provenance summarization logic and per-model grouping. |
| packages/core/src/cost-basis.test.ts | Tests for separating estimated vs tool-reported vs unavailable/unclassified costs. |
| packages/core/package.json | Bump version to 1.10.0. |
| packages/cli/src/digest.ts | Add cost-semantics disclaimer and adjust tip wording. |
| packages/cli/src/cli.ts | Rename cost output to avoid implying an invoice; clarify route cost messaging. |
| packages/cli/package.json | Bump version to 1.10.0. |
| docs/trial/roster.md | Add trial coordination template (alias-only). |
| docs/trial/outreach-draft.md | Add invitation draft (explicitly not sent). |
| docs/trial/guide.md | Add one-week trial plan and reporting guidance. |
| docs/trial/feedback.md | Add feedback template emphasizing numeric-only reporting. |
| docs/release/validation.md | Add local validation record for 1.10.0 candidate. |
| docs/release/1.10.0.md | Add release preparation/handoff doc. |
| docs/licensing.md | Document included license/source materials and rebuild steps. |
| docs/how-the-numbers-work.md | Document token/cost semantics and accounting limits. |
| docs/compatibility.md | Add integration evidence/coverage table and maintenance rules. |
| docs/assets/demo/snapshots.json | Add generated synthetic demo snapshot data. |
| docs/assets/demo/README.md | Document how to regenerate demo assets. |
| CHANGELOG.md | Add 1.10.0 changelog entry. |
| .github/workflows/publish.yml | Use repo’s bun run test and publish from prepared tarballs. |
| .github/workflows/ci.yml | Use repo’s bun run test command. |
Review details
- Files reviewed: 63/68 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| import { computeStatbarSignals } from "../packages/core/src/signals.js"; | ||
| const out = resolve("docs/assets/demo"); | ||
| mkdirSync(out, { recursive: true }); | ||
| const now = new Date(2026, 8, 6, 12).getTime(); |
Comment on lines
+110
to
+114
| candidate_dir="${TMPDIR:-/tmp}/tokmeter-release-${VERSION}-$$" | ||
| run "bash scripts/prepare-packages.sh '$candidate_dir'" | ||
| # Publish the shared core/CLI distribution before the daemon that needs it. | ||
| for package in tokmeter mcp; do | ||
| run "npm publish '$candidate_dir/$package-$VERSION.tgz' --access public" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tokmeter now accounts for current Codex response receipts, including GPT-6 Astra, without double-counting mirrored counters or SQLite fallback. The macOS popup leads with today's tokens, models, and projects, and separates estimated API cost from tool-reported amounts.
This release also fixes idle-day display and explicit zero pricing, adds compatibility/accounting documentation and a synthetic walkthrough, and includes license texts, matching source archives, and Sparkle notices in distributable artifacts. npm publishing now packs workspace dependencies into installable tarballs; CI uses the repository's Vitest command.
Validation: 360 JavaScript tests passed (11 existing TODOs), native tests passed (12 tests plus an optional demo render; all 13 passed when rendering was enabled), repository lint and full workspace builds passed. Local npm install, packaged Astra fixture, license/source archive rebuild, installed app, daemon endpoints, and secret guard were checked. The existing large web bundle warning remains. Public signing, notarization, and publishing are performed as the release steps after this PR.