I'm working with the Lean theorem prover and I would like to build features like those of stack and start building library caches. One thing that I'm unsure about is when to delete older packages in the cache. I could think that, if I have two versions of Lean installed, say 3.3.0 and 3.3.1, I could argue for keeping all the versions of all the packages that work on those. Since the Lean syntax moves fast, it is quite restrictive.
On the other hand, I could see keeping only 10 versions of any given package. This could be the 10 most recent versions or the 10 most recently requested versions.
I'd love to know some of the ideas considered in building stack
and related tools.