Repository navigation
fix(quota): converge weekly estimates to actual spend for 0.9.7 - #34
Merged
Merged
Conversation
The weekly estimate extrapolated a full-week value from the median cost per percent, so it never approached the amount already spent. It now adds the remaining share of that extrapolation to actual spend, which makes it converge as usage grows and equal spend when the window is exhausted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
问题
七天预估按每 1% 花费的中位数直接外推整周价值,与本周期已花金额无关,用得越多也不会向已花收敛。上周期用到 90%、已花 $1,281.65 时预估仍是 $1,481,即使用满也会停在约 $1,480。
改动
docs/reporting.md。tests/quota-projection.ts反推外推值,继续检查历史选择与加权逻辑。新增一个测试用具体数值固定收敛行为和用满时等于已花。验证
bun test tests438 通过,bun run typecheck、bun run build、Prettier 与git diff --check通过。新增测试在旧实现上失败。🤖 Generated with Claude Code