Skip to content

Add compounding-lock score + fix rate borrowing#21

Merged
dominikzalewski merged 2 commits into
masterfrom
f2
Jul 13, 2026
Merged

Add compounding-lock score + fix rate borrowing#21
dominikzalewski merged 2 commits into
masterfrom
f2

Conversation

@dominikzalewski

Copy link
Copy Markdown
Member

No description provided.

Candidate alternatives were priced through a customer_rates view, so one
box could be scored against a *different* box's old locked rate — a rate
a new order or rescale can't actually obtain. This inflated the reported
saving on multi-machine fleets.

Price every same-spec candidate at its prevailing list rate instead
(floored at paid). Adds a two-box guard test.
A second scoring number: what an admin who locks each cheapest same-spec
rate before it rises and holds it would pay, versus Scenario 1's
re-optimise-every-month. The gap between them is the permanent penalty.

optimal_locked is a per-box running minimum of the cheapest same-spec
rate - computed separately per billing unit (monthly vs hourly), reset at
every price change except 15-Jun-2026 (the only one that grandfathers
existing boxes), and partitioned by spec so a resize can't carry a
smaller box's rate. Floored at paid.

Adds hermetic tests for the lock, the scale-up bound, hourly/monthly
separation, the grandfathering reset, and the spec-resize reset.
@dominikzalewski dominikzalewski changed the title F2 Add compounding-lock score + fix rate borrowing Jul 13, 2026
@dominikzalewski
dominikzalewski merged commit 7cd305a into master Jul 13, 2026
4 checks passed
@dominikzalewski
dominikzalewski deleted the f2 branch July 13, 2026 10:21
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.

1 participant