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
{{ message }}
Repository navigation
feat(ladder): reconcile simultaneous buffer purchase + reshape recommendations in one run #30
From the LeanerCloud/cloud-commitments-cli#1340 allocation-algorithm design review: in a single run the engine can emit a buffer-layer PURCHASE (gap allocation includes the buffer share) and a RESHAPE recommendation for that same buffer (utilization below threshold) simultaneously. Buying more of an under-utilized layer is economically questionable.
The phase-3 pipeline must reconcile: either suppress/reduce the buffer allocation when a reshape is pending for that layer, or at minimum surface the tension prominently in the approval email so the human sees both actions side by side with the utilization number. Decide and implement in the ladder_run task wiring (issue LeanerCloud/cloud-commitments-cli#1336 scope).
Checked against main: still valid. splitGap (pkg/ladder/allocate.go:680-710) always allocates the buffer gap while detectReshapes (:159) runs independently, so the engine can buy a buffer and reshape the same layer. Fix (about 60 lines plus tests, fails closed and buys less): in buildResult, turn that layer's buffer Allocation into an ActionHold when a reshape exists for it. Open PR #441 edits allocate.go, so this is blocked on #441.
Activity
cristim commentedon Oct 17, 2026
Checked against main: still valid. splitGap (
pkg/ladder/allocate.go:680-710) always allocates the buffer gap while detectReshapes (:159) runs independently, so the engine can buy a buffer and reshape the same layer. Fix (about 60 lines plus tests, fails closed and buys less): in buildResult, turn that layer's buffer Allocation into an ActionHold when a reshape exists for it. Open PR #441 edits allocate.go, so this is blocked on #441.