fix: upgrade pace-adjustment formula to stay green when clearly under pace#372
Merged
fix: upgrade pace-adjustment formula to stay green when clearly under pace#372
Conversation
The quadratic formula (usedPercent²/expectedPercent) gave ~60.2% for Sonnet at 73% used with 88.5% of the 7-day window elapsed — one tenth of a percent above the 60% yellow threshold despite being clearly under pace. Replaced with the cubic formula (usedPercent³/expectedPercent²) which gives ~49.7% in the same scenario, keeping the bar green. Added a regression test pinned to the exact real-world values that triggered the issue. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Build Performance Report⏱️ Build Time: 12 minutes 📊 Comparison with main branch:
✅ Within acceptable range This is an automated performance check |
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.
Summary
usedPercent²/expectedPercent) gave ~60.2% for Sonnet at 73% used / 88.5% elapsed — one tenth of a percent above the 60% yellow threshold despite being clearly under paceusedPercent³/expectedPercent²): same scenario now gives ~49.7% → greenBefore / After for the Sonnet real-world case:
73² / 88.5(old)73³ / 88.5²(new)Over-pace behavior is unchanged — raw
usedPercentis still returned when usage exceeds expected pace.Test plan
CalculatePaceAdjustedColorPercent_BorderlineUnderPace_StaysGreenpasses< 60, not exact values)🤖 Generated with Claude Code