Skip to content

Classify native individual plans#144

Merged
asizikov merged 1 commit into
mainfrom
asizikov/individual-plans-classification
Jun 7, 2026
Merged

Classify native individual plans#144
asizikov merged 1 commit into
mainfrom
asizikov/individual-plans-classification

Conversation

@asizikov
Copy link
Copy Markdown
Member

@asizikov asizikov commented Jun 7, 2026

Summary

Native AI Credits reports now classify individual Copilot plans from post-preview total_monthly_quota values. 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

  • Added policy-aware individual plan definitions for post-preview native reports: Pro 1,500, Pro+ 7,000, and Max 20,000 AI Credits.
  • Plumbed the resolved included-credits policy through pipeline aggregation, App presentation, license summaries, license cost calculation, and individual upgrade recommendations.
  • Kept organization classification scope-aware, so native 3,900 remains Copilot Enterprise for organization reports and is not treated as individual Pro+.
  • Preserved transition-period behavior for legacy PRU reports.
  • Added regression coverage for native individual classification, included value allocation, Max handling, unknown quota wording, and transition compatibility.
Commit Change
feat: classify native individual plans Adds policy-aware native individual plan classification and end-to-end wiring for included value, summaries, costs, and recommendations.

Testing

  • 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.ts
  • npm test
  • npm run lint
  • npm run build

Checklist

  • Specs lint passes (npm run lint)
  • Tests updated if applicable
  • Documentation updated if applicable (N/A - no docs change required)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 7, 2026 09:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IncludedCreditsPolicy and used them for native report plan-tier resolution (including scope-aware handling so org quotas like 3,900 remain Enterprise).
  • Plumbed includedCreditsPolicy from 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

@asizikov asizikov merged commit db9a67c into main Jun 7, 2026
10 checks passed
@asizikov asizikov deleted the asizikov/individual-plans-classification branch June 7, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants