You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Effective Savings % shown for AWS recommendations is incorrect — it does not match the savings the customer would actually realize given the recommended commitment.
Observed
AWS recommendations show an Effective Savings % that diverges from the savings reconstructable from monthly_cost, recommended_monthly_cost, and on_demand_cost. This was previously fixed for Azure 1y RIs in #277 by plumbing on_demand_cost from the provider through to the frontend, but the AWS side still reports values that are wrong relative to the actual savings.
Expected
Effective Savings % = (on_demand_cost − recommended_monthly_cost) / on_demand_cost, using the canonical on_demand_cost returned by the provider — not a value reconstructed from current spend (which already includes existing commitments).
Acceptance criteria
AWS recommendations carry a non-null on_demand_cost from the provider all the way to RecommendationRecord and the API payload.
effectiveSavingsPct() in frontend/src/recommendations.ts resolves to the same value as the underlying provider report for AWS RIs and Savings Plans.
Unit test in frontend/src/__tests__/recommendations.test.ts pinning the expected effective % for at least one AWS RI fixture and one SP fixture.
Regression test in the AWS provider mapping that asserts OnDemandCost is populated.
Out of scope
Azure / GCP — Azure was fixed in #277; GCP needs a separate audit if the same bug shape applies.
SP on_demand_cost plumbed — parseSavingsPlanDetail in providers/aws/recommendations/parser_sp.go now computes onDemandCost = parseOptionalFloat("CurrentAverageHourlyOnDemandSpend", ...) × 730 and assigns it to rec.OnDemandCost. This is the same CurrentAverageHourlyOnDemandSpend × hoursPerMonth formula AWS Cost Explorer uses internally for EstimatedSavingsPercentage, so the frontend now receives the provider-supplied denominator rather than reconstructing it from monthly_cost + savings + amortized.
AC Fix AWS RI purchase: details assertion + reservation ID rules #4 — backend regression test — TestParseSavingsPlanDetail_OnDemandCost in providers/aws/recommendations/parser_sp_additional_test.go pins that OnDemandCost == CurrentAverageHourlyOnDemandSpend × 730 for a Compute SP detail, and that a missing field yields 0 (which nonZeroPtr converts to nil so the frontend falls back gracefully).
AC AWS + Azure: add read-only sanity checks + AWS RI exchange #3 — frontend unit tests — three new fixtures in frontend/src/__tests__/recommendations.test.ts inside the existing effectiveSavingsPct describe block: EC2 RI (expected 23.33%), Compute SP (20%), and SP with null monthly_cost (20%). Each fixture includes a comment explaining what the wrong reconstructed value would have been without on_demand_cost.
Activity
fix(recommendations/aws): plumb on_demand_cost for Effective Savings % (
cristim commentedon May 13, 2026
Verified resolved by PR #312 (merged 2026-05-05).
Evidence from the diff:
parseSavingsPlanDetailinproviders/aws/recommendations/parser_sp.gonow computesonDemandCost = parseOptionalFloat("CurrentAverageHourlyOnDemandSpend", ...) × 730and assigns it torec.OnDemandCost. This is the sameCurrentAverageHourlyOnDemandSpend × hoursPerMonthformula AWS Cost Explorer uses internally forEstimatedSavingsPercentage, so the frontend now receives the provider-supplied denominator rather than reconstructing it frommonthly_cost + savings + amortized.parseAWSCostDetails → EstimatedMonthlyOnDemandCostwas in place before this PR (landed in fix(recommendations): plumb provider on_demand_cost through to frontend (closes #274) #277); fix(recommendations/aws): plumb on_demand_cost for canonical Effective Savings % (closes #303) #312 closes only the SP gap, which was the remaining open surface.TestParseSavingsPlanDetail_OnDemandCostinproviders/aws/recommendations/parser_sp_additional_test.gopins thatOnDemandCost == CurrentAverageHourlyOnDemandSpend × 730for a Compute SP detail, and that a missing field yields 0 (whichnonZeroPtrconverts to nil so the frontend falls back gracefully).frontend/src/__tests__/recommendations.test.tsinside the existingeffectiveSavingsPctdescribe block: EC2 RI (expected 23.33%), Compute SP (20%), and SP with null monthly_cost (20%). Each fixture includes a comment explaining what the wrong reconstructed value would have been withouton_demand_cost.All four acceptance criteria from the issue body are satisfied. Recommending closure.