6 ms·
I'm really tempted to collect the XML files and put them on github, with periodic checkpoints to update it with the latest. Watching the evolution of law over
by pnathan 13y ago
I'm really tempted to collect the XML files and put them on github, with periodic checkpoints to update it with the latest.
Watching the evolution of law over time is a fascinating thing and using SW engineering tools to help would be really fun.
- tlrobinson 13y agoI was under the impression law is essentially "append only". New laws override existing laws, but the text of the existing law never changes.
- liscovich 13y agoAccording to Wikipedia: "When sections are repealed, their text is deleted and replaced by a note summarizing what used to be there." https://en.wikipedia.org/wiki/United_States_Code#Treatment_of_repealed_laws https://en.wikipedia.org/wiki/United_States_Code#Treatment_o...
- at-fates-hands 13y agoImagine trying to keep track of this in paper form instead of digitally.
- officemonkey 13y agoImagine? I used to do it. When I first started out, I would get stacks of the Chicago Municipal Code revisions on onionskin and it was my job to follow the instructions to update the five-inch binder. "Remove pages 123.4 - 123.6 and replace with pages 123.4a-123.7." Later, when I learned about diffs, I understood the concept immediately.
- michaelolenick 13y agoThey've been doing exactly that for about 237 years.
- deleted 13y ago[deleted]
- rayiner 13y agoLaws are essentially diffs against the US code. The diff (slip law) is canonical. They are continually compiled into the US code, which can involve deleting or changing text just like a diff, and periodically an edited, annotated code is published. After a certain amount of time, Congress enacts a portion of the published code, making it canonical and overriding any prior slip law. See: http://en.wikipedia.org/wiki/United_States_Code#Legal_status http://en.wikipedia.org/wiki/United_States_Code#Legal_status
- shawkinaw 13y agoInteresting: http://uscode.house.gov/codification/legislation.shtml http://uscode.house.gov/codification/legislation.shtml
- DennisP 13y agoWhat we need now is software that reads bills ("in section 123.abc the text 'blah blah' is replaced by 'bleh bleh') and compiles it into before/after views of what the resulting code would be.
- saraid216 13y agoI just suggested this, and then scrolled down to find this. Someone needs to take the plunge and start writing the program; throw it on Github and tell us all about it. I know people who are looking for such a tool.
- lmkg 13y agoThe US Code is not the same as the laws of the US. It is a "current snapshot" of existing laws in force, and does not itself have legal weight unless explicitly granted by Congress.
- gamblor956 13y agoSee, e.g., U.S. National Bank of Oregon v. Independent Insurance Agents of America, Inc., 508 U.S. 439, 440 (1993) for the Supreme Court's ruling and underlying logic.
- redblacktree 13y agoPlease do! This is the kind of thing that hatches in my mind as a great idea, but withers due to a total lack of follow-up.
- liscovich 13y agoIt would also be fascinating to see the visualizations of this evolution. And perhaps by matching it with the voting data from congress, one could track the footprint of each congressman.
- TsiCClawOfLight 13y agosee my comment above, you might be interested :)
- wavefunction 13y ago"Diffing the law" between different date points would be amazing. I hope you follow your temptation in this regard. I'd do it myself but I'm already neck deep in work and volunteer projects outside of work.
- TsiCClawOfLight 13y agoWe actually have something similar in germany, called the "Bundesgit" (https://github.com/bundestag/gesetze https://github.com/bundestag/gesetze)
- eblume 13y agoI'm not a native German speaker but that's a pretty clever pun, right?
- ygra 13y agoNot that much of a pun, really. Just a funny-sounding portmanteau. That being said, official names of things by the government usually sound very ridiculous, so this is definitely much saner.
- TsiCClawOfLight 13y ago'Bundes-' means federal. It's not much of a pun, but I like it :)
- sc68cal 13y agoThis is currently done via scraping: https://github.com/divegeek/uscode https://github.com/divegeek/uscode The diffs are huge.
- shawkinaw 13y agoCheck out the Obamacare blip: https://github.com/divegeek/uscode/graphs/code-frequency https://github.com/divegeek/uscode/graphs/code-frequency
- DannyBee 13y agoRemember that diff is an algorithm to generate the smallest set of operations to produce version B from version A, not an accurate reconstruction of what happened. Diff algorithms are also often tuned not try as hard to find the smallest set of changes for larger documents, due to speed concerns.
- mjn 13y agoGit's built-in diff algorithm is particularly bad for text. Since it's aimed at line-oriented code, it does line-based diffs, which is horrible for ASCII text that is reflowed, because every line in a paragraph will show up as changed for a small change. Example: https://github.com/divegeek/uscode/commit/1fb2d83137dad1c6ca5f7db6b681dc120fbc88ba#L1L80 https://github.com/divegeek/uscode/commit/1fb2d83137dad1c6ca... What's happened is that "Section 2" was moved later in the sentence, abbreviated as "Sec. 2", "of" was deleted, and "act" was capitalized: Section 2 of act July 30, 1947, ch. 392, 61 Stat. 674, provided... Act July 30, 1947, ch. 392, Sec. 2, 61 Stat. 674, provided... The rest of the paragraph is unchanged, but git shows a 6-line diff with the entire paragraph replaced. GitHub attempts to do some word-based highlighting (see the timestamp lines), but it falls down on most of these paragraphs. Wikipedia's diffing tends to work better for this kind of thing; I'm not sure what they use. The upshot is that the number of lines changed may be a 5-10x overestimate.
- gmartres 13y ago> Since it's aimed at line-oriented code, it does line-based diffs You can do word diffs with git: git diff --word-diff=color
- smackfu 13y agoThe funny thing is that a lot of law is structured like definitions, the actual law, then consequences. Any of those three can change independently, and change the meaning of the law. So diffs are often not as useful as you wish.
- lifeformed 13y agoWe need to parse the law into some simulation code, and then have unit tests (does scenario B cause citizen A's rights to be violated), and then check if changes break the tests.
- NoodleIncident 13y agoDo it. Unit test the code. You might even be able to get law students to do it for free as a study aid.
- Symmetry 13y agoI'd really like to see a graph of the number of bytes over time, and what sort of curve it fits.
- varikin 13y agoI just created a repo with all the codes[1]. There was a convenient link to all codes in one zip file. I will note that this is a massive amount of text. There is a link to the schema used and a stylesheet (I assume for the xhmtl maybe?) that I would like to add in. But one step at a time. [1] https://github.com/varikin/UnitedStatesCode/ https://github.com/varikin/UnitedStatesCode/
- anigbrowl 13y agoAh... http://uscodebeta.house.gov/download/priorreleasepoints.htm http://uscodebeta.house.gov/download/priorreleasepoints.htm
- maaku 13y agoIt would be even awesome-er (and more useful) if you could parse individual bills and amendments into diffs, which get merged into 'master' as they become law. I'd love to `git blame` the U.S. code.
- rmc 13y agoBut that only works at the shallow level. A crook can get around that by asking/bribing/convincing someone else to be the one who's responsible for the amenment.
- liscovich 13y agoThere is very little outright corruption in Congress. Special interests exert most of the influence through campaign contributions that are publicly disclosed. Larry Lessig has a great book on this: http://www.amazon.com/Republic-Lost-Corrupts-Congress---ebook/dp/B004QZ9PI8/ http://www.amazon.com/Republic-Lost-Corrupts-Congress---eboo.... And here is the link to his TED talk on the same topic: http://www.youtube.com/watch?v=mw2z9lV3W1g http://www.youtube.com/watch?v=mw2z9lV3W1g
- minor_nitwit 13y agoI wonder if Congress uses any sort of version control. The text of these bills are written by - staffers and sometimes lobbyists, so I'm not sure how it would work.
- markdown 13y agoNZ laws on github: https://github.com/Br3nda/legislation/tree/master/act/public https://github.com/Br3nda/legislation/tree/master/act/public
- mkehrt 13y agoDo they accept pull requests?
- saraid216 13y agoProbably more important than just diffs is actually a dependency graph and a topical index. While they've tried to do this via titles/chapters and references, linear breaks are never going to be as successful as many-to-many linkages as every Bible concordance out there demonstrates.