fix: prevent absurd budget usage % on split transition - #323
Open
TtvNekix wants to merge 1 commit into
Open
Conversation
refresh_hiring_cycle_budgets recalculated wage_budget as 6 % of current cash, which could drop below the existing annual wage bill when the team had spent money during the split. This caused the dashboard to show nonsensical percentages (e.g. 492 % budget usage) when no signings were made. Fix: the new wage_budget is never set lower than the current annual wage bill. Pre-calculate wage bills before the mutable team loop to satisfy Rust borrow checker.
TtvNekix
force-pushed
the
fix/budget-recalc
branch
from
June 13, 2026 01:46
bf2ae10 to
d4293b3
Compare
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
Fixes the bug where after transitioning splits (e.g. winter -> spring) the dashboard shows absurd budget usage percentages (e.g. 492%) even when no signings were made.
Root Cause
refresh_hiring_cycle_budgets()recalculatedwage_budgetas 6% of current cash:If the team had spent money during the split, their cash was lower, so the new budget became much smaller than the existing wage bill.
Fix
The new wage budget is never set lower than the current annual wage bill:
This ensures that a team making no signings will always see budget usage <= 100%.