docs(dashboard): audit provider savings semantics, enforce 100%-coverage contract#589
docs(dashboard): audit provider savings semantics, enforce 100%-coverage contract#589cristim wants to merge 1 commit into
Conversation
…age contract (closes #215) All three upstream APIs (AWS CE GetReservationPurchaseRecommendation, Azure Consumption NetSavings, GCP Recommender PrimaryImpact) return savings sized for 100% coverage of historical demand. The dashboard's read-side scaling by the operator-configured coverage% is therefore correct: it projects partial-buy savings against the 100%-coverage baseline. This closes the deferred-assumption comment from #196 PR #200. Changes: - Replace the "Note: assumes recs are generated at 100% coverage" TODO comment in summarizeRecommendationsWithCoverage with a CONTRACT block citing the per-provider evidence and linking to the verifying test. - Add parseCostInformation godoc (AWS) documenting EstimatedMonthlySavingsAmount semantics: sized for ~100% coverage of historical on-demand demand. - Add extractLegacy NetSavings comment (Azure) confirming the 100%-coverage contract and deprecating the stale "lookback-period" framing. - Add extractCostImpactFromRecommendation comment (GCP) confirming CUD recommendations are sized for 100% historical usage. - Add TestSummarizeRecommendationsWithCoverage_100PctContract: seeds two accounts at known savings baselines, applies per-account coverage overrides (70%/90%), and asserts the dashboard total equals the sum of the per-account scaled amounts; double-apply or factor-100 bugs would break this test.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
// Note: assumes recs are generated at 100% coveragecomment insummarizeRecommendationsWithCoveragewith a// CONTRACT:block citing per-provider evidence; the read-side coverage scaling is correct and not double-counting.// issue #215 auditcomments toparseCostInformation(AWS),extractLegacyNetSavings (Azure), andextractCostImpactFromRecommendation(GCP) documenting the 100%-coverage contract at each source site.TestSummarizeRecommendationsWithCoverage_100PctContractto pin the scaling math: two accounts with $1000/$500 savings at 70%/90% coverage must total $1150; double-apply or factor-100 bugs break this test.Test plan
go test ./internal/api/ -run TestSummarizeRecommendationsWithCoveragepasses (9 tests including the new contract test)go build ./...succeedsCloses #215