feat: deliver local usage workbench 0.4.0 - #5
Conversation
… and experiment statistics
…he existing accounting projection
…dles before review
…ion to its switch
…ducible verification
…ative price provenance
…l receipt exports
…s, attribution and sharing workspace
…ow numeric integration
…ymized receipt exports
…st and browser acceptance
…vacy, experiments and RPC boundaries
…th cached pinned toolchain
…ed analysis and snapshot cache
…and mobile rendering
…d reproducible acceptance
…eric trajectory sequences
…patibility assertions
…reshed sharing consent
…tion and documentation
…checkbox mutation
…writing dependency literals
…candidate scaffolding
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e9c8cd900
ℹ️ 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".
| try { | ||
| const raw = storage.get().data | ||
| state = raw ? boundedParse(stateSchema, JSON.parse(raw)) : emptyState() | ||
| state.ledger = state.ledger.map(entry => entry.status === 'running' ? { ...entry, status: 'interrupted', endedAt: new Date().toISOString() } : entry) |
There was a problem hiding this comment.
Persist recovered interrupted ledger entries
After a Host restart, this updates running entries only in memory and never writes the recovered state back to settings. If the Host restarts again before another configuration or ledger mutation, the stored entry is still running, so endedAt is regenerated at the later startup and the audit record loses the actual first interruption time. Persist the recovery transition once parsing succeeds so restart recovery is durable.
Useful? React with 👍 / 👎.
变更
新增「设置 → 用量工作台 / Usage workbench」,保留原 Token 用量页、原会话 projection 与原静态价格表。
验证
候选验证记录:https://github.com/LeemanCheung/dsh-token-usage/actions/runs/34675499677
Host、Client、构建配置类型检查通过;26 个测试文件、184 项回归通过;10 个 Chromium 工作流用例通过;重复构建的三个产物 SHA-256 一致;源码与重新生成的 lib 已一并提交。浏览器截图、结果 JSON 与日志保存在该运行的 verification evidence artifact。
本 PR 的常规 CI 会从已提交源码重新执行全部检查,不依赖临时集成脚本,并额外验证 npm 文件白名单及提交的 lib 与重建结果完全一致。已移除全部 .candidate 文件和三个临时候选/诊断工作流,常规 CI 保留验证证据上传。
边界
浏览器测试真实挂载 React 工作台、调用真实 Host RPC 并使用文件持久化;DSH 事件与模型传输为合成 fixture,不声称已在用户生产 DSH 安装中调用真实提供方或核验真实账单。预算只提示,不阻断、不改路由。不同币种不相加,未知费用不记为零,验收质量不由执行完成状态推断。
生成文件 lib/client.js 的行尾空格检查单独豁免,避免对依赖模板字符串做盲目裁剪;源码检查、重复构建哈希及 lib 一致性门槛均保留。