Enable native budget simulation#146
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Enables budget simulation end-to-end for native usage-based billing (AI Credits) reports by wiring report format metadata into the simulator/parsing path and updating the Cost Management UI to display budget controls/results for native reports while preserving transition-period PRU labeling behavior.
Changes:
- Removed the native-report UI blocker and updated Cost Management copy/labels to use AI Credits semantics for native reports.
- Extended
runBudgetSimulationto accept report format metadata and switch parsing/date normalization accordingly. - Added view and simulation tests covering native vs transition report behavior.
Show a summary per file
| File | Description |
|---|---|
| src/views/CostManagementView.tsx | Enables budget simulation UI for native reports and updates labels/copy to AI Credits semantics. |
| src/views/CostManagementView.test.ts | Adds coverage to ensure native reports show budget controls and AI Credits labels while transition reports keep PRU labeling. |
| src/utils/budgetSimulation.ts | Threads report metadata through included-credits context and switches parsing for native reports. |
| src/utils/budgetSimulation.test.ts | Adds a native-report simulation test to validate native parsing + policy context usage. |
| src/App.tsx | Removes the native simulation apply-time blocker and passes report metadata into budget simulation. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 0
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
Native usage-based billing reports already contain AI Credits quantities and costs, but cost management still disabled budget simulation for those reports. This PR enables the simulator end to end for native reports while preserving transition-period PRU comparison behavior.
Changes
feat: support native budget simulation parsingfeat: enable native budget simulation UITesting
npm testnpm run lintnpm run buildChecklist
npm run lint)