I keep returning to this thought: Assuming our abstraction architecture is missing something fundamental, what is it? My gut says something simple is missing that makes all of the difference. One thought I had was that our problem lives between all the things taking something in and spitting something out. Perhaps 90% of the work writing a "function" should be to formally register it as taking in data type foo 1.54.3…
You seem to be describing a type system.
Ill try an example, those always have the potential to describe things even worse.
Imagine a type that is an outdoor datetimetemperature in utcc or a first name form value or a solitaire terms of service checkbox value. Have both the chewing gum balls in dispenser and a total weight of chewing gum balls in dispenser as well as a min-max weight per chewing gum ball in dispenser.
Make it just as ridiculous as it sounds. If you can quantify it a type must be registered. If there is a pair of quantifications to be had register that too.
The vision just expanded! Make for everything an xml implementation then do a ram drive and make all variables into files.
The idea sounds so ridiculous it might actually work. Think of the employment opportunities!