Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/ladder/capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ type LadderCapability interface {
// the float64 cost fields of common.Recommendation. This is a documented
// precision seam; exact-decimal plumbing through the purchase path is
// addressed in a later PR.
//
// Provider commitment precision (go#354): implementations MUST floor the
// commitment to the provider's precision before submission, never round
// it up, and MUST refuse (not submit) an amount outside the provider's
// accepted range, including one that floors to zero. Callers converting
// a *big.Rat amount to float64 must not round it up either.
// - AWS Savings Plans: the raw amount is range-checked first (outside
// [0.001, 1000000] USD/hr, NaN, Inf or <= 0 is refused before any
// API call), then truncated to 5 decimal places.
// - AWS convertible RIs: purchased as a whole instance count
// (rec.Count > 0), so there is no dollar amount to floor.
// - Azure, GCP: no LadderCapability implementation yet; each must
// document and enforce its precision here when one is added.
PurchaseLayer(ctx context.Context, layer LayerType, rec common.Recommendation, opts common.PurchaseOptions) (common.PurchaseResult, error)

// ReshapeBuffer exchanges or modifies buffer-layer commitments to improve
Expand Down
Loading