Top
Best
New

Posted by enriquelop 9 hours ago

Spanish legislation as a Git repo(github.com)
616 points | 187 commentspage 2
vitorbaptistaa 7 hours ago|
Congratulations! This is a very cool project. A few years ago there were similar ones -- browse gitlaw.

In Brazil we have lexml, a standard to describe the law and their changes over time. It's surprisingly complex.

phlakaton 7 hours ago|
Hah! XML strikes again. :-)

I understand that Spain was a participant in LexML as well... I gather they've since converted to something else?

matthewgard1 3 hours ago||
I did something very similar for some US state level laws. "Legit" legislative git.

Useful for alerts in our concern area, and monitoring proposed legislation iteration and flow through committees to keep ahead.

I can imagine quite a few other more civic interest uses as well!

Hoping to open source some later myself, seems an area ripe for some open civic citizen/hacker projects. Bet some fun startups could be made on top too, gl.

pilingual 4 hours ago||
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...

rafram 3 hours ago||
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.
psychoslave 4 hours ago||
Laws are there to inform the land how the dominant class expect to be served. At least in theory the dominant class could be the working class or the majority, mind you. In practice you generally get a better idea looking at what small network core founded the country, generally through bloody wars or genocides.
PhilipV 4 hours ago||
Well done. I believe that Governments should have a Open Licence for copyright purposes like exists in the UK that allows Govt docs to be used for commercial purposes without issue. I would want to propose a step forward there so that the next generation of this open licence actually has a data set approach to making data sets available - possibly at cost. Governments are losing the ability to charge for nominal items in paper as digital is so openly available - they can make a revenue on providing data at large to public so that others can build or simply if not for free.

Well done and great to see items like this and great to see the comments.

postepowanieadm 3 hours ago||
Legislation is out of copyright. Unofficial consolidated versions may be a different matter.
0x3f 4 hours ago||
The UK is IMO quite terrible in this regard. Yes, a lot is OGL, but very key items are sequestered away and very costly to obtain. OGL is a total bodge; just get rid of Crown Copyright.

When it comes to the law specifically, there's a whole silly setup with transcription companies as well.

zaep 8 hours ago||
Nobody seems to have (yet) mentioned the most recent (rn) commit [1] dated 2099. I can't really figure out where the date came from, at the source noted in the commit I find no '2099', I can't see it being a joke, if it's a bug it's not obvious to me..

I'm sure I won't be the only one curious, please enlighten me.

[1]: <https://github.com/EnriqueLop/legalize-es/commit/424cbc96507...>

gloosx 7 hours ago|
Classic. He forgot to add "make no mistakes" to the prompt. Based on the commits alone Im not sure anyone really reviewed the correctness of the git history.

When someone specifically mentions "built in ~4h with Claude Code" they probably didn't care that much about the outcome quality

forgotpwd16 5 hours ago||
It's a cool PoC even if implementation/result isn't perfect.
comboy 7 hours ago||
Add CI to check if new laws don't contradict with any existing ones.
bertil 7 hours ago||
You might need to turn laws into formal proofs, and the existence of judges makes me think that’s not as likely as you would like. A commenting system would though—trained on countries’s precedents, jurisprudence and traditions might.
whattheheckheck 7 hours ago||
Can you imagine rebases with merge conflicts?
bentcorner 4 hours ago||
This could in theory already happen without any tech, but I suspect since the government is pretty monolithic, any changes in a specific law are all being done by the same set of people.

You might not have merge conflicts but I imagine you could end up with conflicting guidance from two separate pieces of law (e.g., law A says you must wear green on St. Patrick's day, law B outlaws green pajamas).

maCDzP 5 hours ago||
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.
juahan 3 hours ago||
I started doing it for Finland!
setopt 5 hours ago||
Parliament voting, maybe upvotes and downvotes on a pull request?
boredatoms 5 hours ago||
Is there something like this for the US?
wavemode 4 hours ago||
Even if there were, it wouldn't be very useful. In a "common law" system like the US, legal questions are rarely answered purely by the plain text of a law. You also need case law - that is, how the law is typically applied in practice by the courts.
boredatoms 3 hours ago|||
Sure, then that with case law too?
smitty1e 3 hours ago|||
The legislation seems more high-level requirements, that then implemented over in the Code of Federal Regs[1].

Using AI to plow through and make sense of all this would put us at risk of people knowing what the USG is getting up to.

[1] https://en.wikipedia.org/wiki/Code_of_Federal_Regulations

the-rc 3 hours ago||
There was a project at Google Chicago to do something like that, around 15 years ago. For some reason, it was never launched.
MinimalAction 6 hours ago||
The general sentiment here is that it's a great project. Could someone please explain why? All I'm seeing is that laws are updated with commits within markdown files.
saadn92 6 hours ago||
The value is in the semantics git gives you for free once the data is in this shape. Right now if you want to understand how a law changed, you go to the official gazette website and read a document that says "strike paragraph 3 of article 12 and replace with the following text." You're doing the diff in your head.

With this repo, git log --oneline -- spain/BOE-A-1978-31229.md gives you every reform to the Spanish Constitution in one command. git diff between any two reforms shows you exactly what changed in context. git blame tells you which reform touched which article. These are operations that would take a lawyer hours of cross-referencing, and they're free once the data is structured this way.

The other great thing: you can build tooling on top of it and use it with the CLI.

MinimalAction 6 hours ago||
Thanks for a beautiful explanation. Makes sense now that this repo enables git diff, git base to reveal changes easier.
saadn92 4 hours ago||
of course, thanks for asking a great question!
xeromal 6 hours ago||
The why is that it's cool. Why it's not cool for you cannot be explained by us, only you.
MinimalAction 6 hours ago||
I didn't say it's not cool. I was trying to understand the utility of it being great.
xeromal 6 hours ago||
Coolness and greatness can be the same thing.

For instance, the big Lebowski is great and cool.

ks2048 6 hours ago|
A couple things I noticed opening one random page (https://github.com/EnriqueLop/legalize-es/blob/master/spain/...)

It left out the tables (e.g. under 2.1 Materiales.) and the images (e.g see the very bottom).

More comments...