We're talking about two very different things: a single legal agreement vs a database of laws.
Something like this already exists in multiple forms because it is very useful. It's so useful that the owners of those sites can charge lawyers a lot of money for access... Hundreds of $ per month.
They wouldn’t be able to charge so much if the laws were published using a machine-readable version control system. Citizens should expect this from their legislature; lawyers shouldn’t be allowed to paywall historical information about public laws. This Git repo is a good illustration of how easily the legislature could solve an important legal problem with free software engineering tools that facilitate reuse and permissionless innovation, rather than leaving companies to solve it with crappy paywalled web apps that contractually prohibit reuse of their content.
Something like this already exists in multiple forms because it is very useful. It's so useful that the owners of those sites can charge lawyers a lot of money for access... Hundreds of $ per month.