I've often imagined a system that tries to build consensus around which (content-addressed) code snippets can be treated as pure functions with (content-addressed) memorized outputs and which ones need to be rerun.
If you're on a well-worn-path you could operate mostly by lookup and only run the code if something doesn't smell right.