> I don't think you're crazy, it's a good area to explore, but it's not practical to implement this in the business landscape we currently exist in.
It's relatively straightforward. You put the code or whatever else your customers need into escrow with a third party. The code gets released if you discontinue the product or it otherwise leaves the market.
You then market that you're doing this, so that everyone A) knows they can pursue getting access to the escrowed stuff, B) it's a selling point to remove some of the vendor risk, and C) it's not just a capricious action to undermine creditor rights.
Of course, it may be harder to borrow money if you do this. And customers are generally not savvy enough to require this (though if you do a large enterprise deal, requiring code escrow is not an unknown term).
As an option between developers and customers, of course you can do this now, and it happens.
That's very different though to a law that requires source to be released.
The former is something you do because you believe it gives you the edge in a sale.
The latter is a regulatory framework that imposes problems on everyone unilaterally.
Putting code in escrow is usually done as part of the contract between the business and the customer, and the code is in escrow for that customer not for everyone.