There are countries that require published material to be submitted to a national archive[0]. A similar system could be done for software source code and made public on expiry.
[0] https://youtu.be/ZNVuIU6UUiM