The Applied Category Theory folks have some very interesting stuff, like Categorical Query Language.
https://www.appliedcategorytheory.org/
https://www.categoricaldata.net/
But it sounds to me what you mean is more like if "Pattern Language" was symbolic and rigorous, eh?
(PDF available here: http://pespmc1.vub.ac.be/ASHBBOOK.html )
Cybernetics might be the "missing link" for what you're talking about.
I'm looking more for a theory of modules and relationships. Something that can formalize the ways we organize code.
It sounds like CT is what you're after (to the extent that we have it at all yet...)