Classify native individual plans#144
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the included-credits “policy” system to classify native AI Credits individual Copilot plans (Pro 1,500; Pro+ 7,000; Max 20,000) based on total_monthly_quota, and threads the resolved policy through pipeline execution, aggregation, UI presentation, license costing, and upgrade recommendations to keep native and transition-period behavior consistent.
Changes:
- Added individual-plan definitions to
IncludedCreditsPolicyand used them for native report plan-tier resolution (including scope-aware handling so org quotas like 3,900 remain Enterprise). - Plumbed
includedCreditsPolicyfrom pipeline analysis into aggregator construction, license cost display, and individual upgrade recommendation calculations. - Added/updated tests to cover native individual classification, unknown quota wording, Max handling, and end-to-end pipeline behavior.
Show a summary per file
| File | Description |
|---|---|
| src/pipeline/includedCreditsPolicy.ts | Adds individual plan tiers/plans to policies and defines post-preview native individual quotas (incl. Max). |
| src/pipeline/includedCreditsPolicy.test.ts | Verifies native policies include correct individual plan identities and included credits. |
| src/pipeline/aicIncludedCredits.ts | Switches individual plan resolution to be policy-driven; threads policy into label/tier/included-credit helpers; exports allocator-from-context. |
| src/pipeline/aicIncludedCredits.test.ts | Adds coverage for native individual tiering, scope awareness, unknown quota labeling, and end-to-end allocation/summary behavior. |
| src/pipeline/runPipeline.ts | Computes included-credits context up-front and passes resolved policy into aggregator factories. |
| src/pipeline/aggregators/userUsageAggregator.ts | Accepts an explicit included-credits policy for correct quota selection under native periods. |
| src/utils/individualPlanUpgrade.ts | Makes license costs and upgrade recommendations policy-aware and supports native Max classification. |
| src/utils/individualPlanUpgrade.test.ts | Adds regression coverage for native plan license costs and upgrade recommendation behavior (incl. Max). |
| src/App.tsx | Passes resolved policy through pipeline factory, license cost display, and upgrade recommendation calculation. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 9/9 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 AI Credits reports now classify individual Copilot plans from post-preview
total_monthly_quotavalues. This prevents individual Pro+ reports from showing a zero included value and keeps individual plan handling aligned with native summer and September-onward reports.Changes
feat: classify native individual plansTesting
npm test -- src/pipeline/aicIncludedCredits.test.ts src/pipeline/includedCreditsPolicy.test.ts src/utils/individualPlanUpgrade.test.ts src/pipeline/runPipeline.test.ts src/pipeline/aggregators/nativeUsageAggregation.test.tsnpm testnpm run lintnpm run buildChecklist
npm run lint)