feat: add full economics modeling for IntelIP scenarios#40
Merged
Conversation
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
Testing
Greptile Summary
This PR adds a full-economics cost-layer model (
delivery/productization/adoption) to ProfitCtl, extending the config schema, cost engine, simulation, and all output surfaces (CLI, JSON, Markdown). It also ships a complete IntelIP scenario pack — six YAML files covering conservative, target, stress, paid-pilot, tight-free, and workspace-minimum rollout shapes — together with calibration notes and a tooling cost inventory.intelip_ops_conservative.yml,intelip_ops_target.yml,intelip_ops_stress.yml, andintelip_rollout_tight_free.ymlall includelimits.userson their plans.validateMixPricingexplicitly rejects any plan with a non-nilLimitsin mix mode, soParseConfigreturns a validation error for each of these files. The two workspace-hybrid scenarios are unaffected.FullEconomicsSummary:buildFullEconomicsSummaryaddspaymentFees.Totalto bothDeliveryCostandTotalCost. If a future config combines apayment_fees:YAML block with auser_scope: paid_usersvariable cost for the same fee, the amount is counted twice. The current scenario files avoid this by using only the variable-cost approach, but the risk is undocumented.Confidence Score: 4/5
Safe to merge after fixing the mix-mode limits validation conflict that blocks four of the six new scenario files.
The Go engine changes are clean and well-tested. One P1 defect blocks the primary user-facing deliverable of this PR (running the IntelIP scenario pack): four mix-mode YAML files include
limitsthat the validator rejects. This needs to be resolved before the scenario files are usable.The four mix-mode scenario files (
intelip_ops_conservative.yml,intelip_ops_target.yml,intelip_ops_stress.yml,intelip_rollout_tight_free.yml) andinternal/config/validator.go(thevalidateMixPricingfunction).Important Files Changed
limitson mix-mode plans which the validator rejects — the file cannot be parsed/run as-is.limits-in-mix-mode validation failure as conservative.limits-in-mix-mode validation failure.limits-in-mix-mode validation failure.validateMixPricing,validateWorkspaceHybridPricing, andvalidatePricingPlanCohort; the mix validator explicitly rejectslimitson plans, which conflicts with the new scenario files.buildFullEconomicsSummaryhelper and wirescfg.Pricinginto scale/stress simulation calls; potential double-counting of payment fees when both variable-cost andpayment_feessection are used together.full_economicsblock to JSON output; populated only whenTotalCost > 0.EconomicsLayer,EconomicsAllocationMode,VariableCostUserScopetypes with backward-compatible normalization helpers; well-structured.FixedCostandVariableCostwithEconomicsLayerandAllocation; addsEconomicsLayerBreakdownwithAddandRoundhelpers.calculateMixRevenueandcalculateWorkspaceHybridRevenue; share allocation with deterministic rounding is correct.Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "chore: address PR cleanup feedback" | Re-trigger Greptile