Live data from Hacker News

Spanish legislation as a Git repo

github.com

201–210 of 246 posts

Re: Spanish legislation as a Git repo

#201
post #43

I built a pipeline that converts all Spanish state legislation into version-controlled Markdown. Each law is a file, each reform is a real git commit with the historical date. 8,642 laws, 27,866 commits. The idea: legislation is just patches on patches on patches. Git already solves this. Instead of reading "strike paragraph 3 and replace with...", you get an actual diff. The repo is the product. Browse any law, git…

Oooh Can you elaborate a bit how the gazette is publishing them? Like what format did you have to parse. And how many documents were there in total? I tried doing the same for German laws 1-2 years ago but LLMs weren't smart enough yet. And the costs would've been at least a couple of thousand €. Ed: Nevermind, I missed the "BOE (Spain's official gazette) consolidated legislation API" part. Sending jealous greetings…

Do you mean DIN?

Re: Spanish legislation as a Git repo

#202
post #151

Earlier quoted context omitted.

> so many inefficiencies that are trivially solved with existing tech frameworks. Out of curiosity, like what specifically? Didn’t DOGE’s failure highlight that it actually wasn’t trivial? I’m skeptical at first glance but open to being proven wrong.

> Out of curiosity, like what specifically? For example, there are thousands of divisions of government out there provisioning largely the same systems in duplicate. E.g. the very local government here has a web portal for the sports venue bookings like pools and tennis courts. They have a waste collection portal. Local tax portal. Only recently has this been slightly standardized but even those efforts are purely re…

Wouldn’t consolidation lead to monopoly? If 50 local governments use the same SaaS/vendor, the 51st local government would likely go for the same vendor just because 50 others used that vendor before them, no? What prevents the vendor from jacking up prices or general enshittification at the stage?

Re: Spanish legislation as a Git repo

#203

I built a pipeline that converts all Spanish state legislation into version-controlled Markdown. Each law is a file, each reform is a real git commit with the historical date. 8,642 laws, 27,866 commits. The idea: legislation is just patches on patches on patches. Git already solves this. Instead of reading "strike paragraph 3 and replace with...", you get an actual diff. The repo is the product. Browse any law, git…

> Exploring whether there's a business here — structured legislation API for legaltech/compliance, or just a useful open dataset. Curious what HN would build with this data.

Compiling legal data for specific domains and then selling processes that rely on your private compilation is a battle-tested business plan, but there's a lot of manual work involved and the cost of that work becomes a barrier to entry.

Generally speaking, the people who'd like to cross that barrier are both open to ideas and funded well enough to run little experiments.

Re: Spanish legislation as a Git repo

#204
post #202
post #151

Earlier quoted context omitted.

> Out of curiosity, like what specifically? For example, there are thousands of divisions of government out there provisioning largely the same systems in duplicate. E.g. the very local government here has a web portal for the sports venue bookings like pools and tennis courts. They have a waste collection portal. Local tax portal. Only recently has this been slightly standardized but even those efforts are purely re…

Wouldn’t consolidation lead to monopoly? If 50 local governments use the same SaaS/vendor, the 51st local government would likely go for the same vendor just because 50 others used that vendor before them, no? What prevents the vendor from jacking up prices or general enshittification at the stage?

> What prevents the vendor from jacking up prices or general enshittification at the stage?

Well what I'm proposing building would be source-available and licensed such that the gov can run it themselves if it ever gets too expensive. The sub-gov entities should really band together for the negotiation though, then they can ask for whatever they want: non-profit vendors, liberal licensing, price agreements. A collective of government buyers form basically a monopsony larger than any individual vendor could ever be.

Re: Spanish legislation as a Git repo

#206

I'm surprised the world is not running a system where laws are formally encoded using some DSL that would allow making decision (guilty/not guilty) using formal logic. Perhaps there is not much interest from law making/enforcing parties for this either.

Law is not 100% exact. For instance, the age of consent in Spain it's 16, and you are adult by 19. You and a group of people had sex with a 15 yo. Your friends are well over 20 (24, 25...), and OFC trialed and jailed. But you, being almost close in maturity to that girl, (and noticed by psychologysts testing both the girl's mindset and yours ) can have the charges perfectly dropped.

Ditto with alcohol laws -18 there-. Selling a cyder to a 17 + 11 months guy would have a much smaller fine than a hard liquor to a 14yo.

The reverse it's true, too. 14yo are the minimum age to be legally punished. If you are 13 and barely stole some $20 Steam card -if any- you just got sentenced to spend your formative years in a juvenile center.

But, if you are 13yo gang member and you have a longass list of both petty and hard crimes and the last one has been a bloody crime with serious injuries or homicide... you can be sent as an exception to an adult prison because your mentality and mindset are not the ones from the early teens.

Especially if your body it's really developed for your age and you basically commanded mini-clans as the ones you can see in Ireland, Italy and the like. When you can smack down adults at age 13 and even ilegally drive a car, the Spanish constitution wont save you. Ultimately you must -and can- be trialed as an adult but also be able to finish the mandatory education years until you hit 16. Not easy, of course, but sending these kind of people to juvenile centers just generates more thugs than anything else.

If this is difficult for humans, imagine that for software with exact constraints.

Re: Spanish legislation as a Git repo

#207
post #120

Nice, I am going to this for Swedish law! Any suggestions on how one can model parliament voting when a law passes using GitHub? Or all the work that preceded a law, that’s like a feature request or a bug report.

I’ve done this for Swedish laws: https://github.com/se-lex/sfs (Markdown with git history)

https://github.com/se-lex/sfs-processor (processor with Git, md, md with temporal tags, or html as output formats)

Re: Spanish legislation as a Git repo

#208
post #69

Earlier quoted context omitted.

I wonder how true this is, we have the same system in Sweden, that court judgement are not legally binding precedent for lower courts. But in practice lower courts will follow the rulings made by the high court. Is it not the same in Spain at all?

It's the same in Spain, which makes OPs proposal kind of useless. The big distinction between a civil and a common law system is the fundamentals. A country's civil code is properly defined, while a common law's system is based on previous cases you have to dig through to find the basics.

> while a common law's system is based on previous cases you have to dig through to find the basics

In other words, you have to hire a lawyer. They really built a great system for themselves, didn't they?

Re: Spanish legislation as a Git repo

#209

I built a pipeline that converts all Spanish state legislation into version-controlled Markdown. Each law is a file, each reform is a real git commit with the historical date. 8,642 laws, 27,866 commits. The idea: legislation is just patches on patches on patches. Git already solves this. Instead of reading "strike paragraph 3 and replace with...", you get an actual diff. The repo is the product. Browse any law, git…

I've long wanted to do this, but don't have the api. This is much harder to do with pdfs

Re: Spanish legislation as a Git repo

#210
post #182

One idea behind the PoC Right to Privacy Act is having tests. A recurring theme with conservative Justices is clarity of legal text. Testing may not exhaust all scenarios but it is useful to see where loopholes may exist or whether a bill that sneaks in while you aren't paying attention is unfavorable to your values. https://github.com/righttoprivacyact/bill/blob/main/tests/te...

This is incredibly software engineer-brained. The law doesn't work like software. The only thing that matters is how the judiciary interprets the text, and if you try to use LLM "test" output to argue for a specific interpretation, you'll be laughed out of court.

I believe you hastily misinterpreted the point. It's merely a tool that wasn't possible before.
Post reply on HN