there’s been some work on adding linear types to programming languages, to do things like ensure that you can’t use a resource after it has been closed/freed. similarly you could prevent the use of a resource before it has been fully opened/configured. (useful for sockets since they require multiple steps.)
wadler’s “linear types can change the world!” might be an appropriate starting point. https://homepages.inf.ed.ac.uk/wadler/topics/linear-logic.html#linear-types
apologies, i have not read it. linear types are outside my area of interest.
if you drop the gambler’s presentation of kelly, and just maximize expected log utility, you immediately get the correct answer for the “win or die” scenario. the second scenario lightly touches on kelly, and would also be aided by considering the situation as log utility maximization. (expenses going out every month like clockwork, decision is work (small guaranteed return), and/or how much to allocate to various bets.)
some of your concerns in the last post can also be modeled properly.