

Github: United States Code - wh-uws
https://github.com/divegeek/uscode

======
damncabbage
There was a great discussion on HN previously about this topic which also
explains why a straight git implementation isn't viable:

<http://news.ycombinator.com/item?id=3968653>

~~~
newhouseb
Note the author is talking about SVN and not git. I haven't used SVN nearly as
much as I have git but from what I understand git is likely better suited for
combining many different change-sets into many combinations efficiently
(according to Git's Wikipedia page it was designed with "non-linearity" in
mind), which would seem to mitigate the some of the issues around merge
conflicts the OP brings up with respect to SVN.

~~~
gioele
I was referring to SVN because when I started working in this field SVN was
the up-and-coming SCM. You can s/SVN/git/g and still get the same result.

Versioning the text of the law is not a problem. It is a solved problem. Every
decent legal office has access to a versioned text of the law. The new
challenge is the versioning of the legal content (or _meaning_ if you want)
and the (semi-) automatic creation of consolidated texts at a certain point in
time. The last point is difficult because the consolidated version is not a
single document but a set of possible documents.

See also the other answer I gave on the difference between text and content:
<http://news.ycombinator.com/item?id=4023109>

~~~
newhouseb
I see, your post of 'meaning' vs 'text' makes the issue(s) a lot clearer -
thanks. What other meaning conflicts might arise other than time-related ones?
I think with some clever tagging combined with a script on top of git one
could have something tell you "show me what law as it is applicable today -
not everything that's been passed for the future"

Cherry picking commits and branching on every possible merge conflict (and
picking one winner for each branch) should be relatively straightforward, I
guess the question is how big of a set of possible documents might this be -
10? 100? 1000? Would this be a process done by lawyers for the purposes of
understanding laws on the books or by someone in the legislature at the end of
each session?

Apologies if I'm ignorant on this stuff - I'm just really interested.

~~~
gioele
> Cherry picking commits and branching on every possible merge conflict (and
> picking one winner for each branch) should be relatively straightforward

The problem is that, in general, (1) it is not straightforward and (2) you can
be liable for damages if you state publicly "this is the correct version"
unless you are a judge or the appointed authority.

Talking more practically, here is something that would be interesting to have:
a tool that (1) analyses an act (or a bill), (2) identifies which parts of it
state a modification to existing acts and codes, (3) have a look at these
target documents and (4) tell you which of the "hunks" of the "patch" can be
"merged" in a straightforward manner, almost straightforward or require an
expert review. Steps 1, 2 and partially 3 are already done in many systems
through NLP techniques (have a look at
<http://wyner.info/LanguageLogicLawSoftware/> for example). Step 4 is a brand
new thing. Do anybody want to work on that?

A tool like the last one would simplify things a lot. You go from "sorry, I
cannot tell you anything because a lawyer is required for everything" to "here
is what I am reasonably sure about; for the last 5% you have to ask your
lawyer if the correct merge is A or B".

> I guess the question is how big of a set of possible documents might this be
> - 10? 100? 1000?

The set of possible versions grows exponentially :(.

> Would this be a process done by lawyers for the purposes of understanding
> laws on the books or by someone in the legislature at the end of each
> session?

Lawyers are required. Many institutions publish "end of the year" consolidated
versions of their acts. In some countries these consolidated versions have
legal power, in others they are just handy references (the judges cannot use
them).

Fun fact: it happens quite often that one branch of a parliament thinks that
the current version of an act says X while the other branch thinks that it
says Y.

------
there
While it might be useful to have these in revision control, their format won't
work as-is. Take this change for instance:

[https://github.com/divegeek/uscode/commit/4b58ecaa6a6ea4b158...](https://github.com/divegeek/uscode/commit/4b58ecaa6a6ea4b15820208878c702d6e26e5b9f)

Lots and lots of lines that don't change anything useful, and then the one
change is hard to understand because it's wrapping a bunch of words causing
extra changes.

I would recommend un-wrapping lines before commits and then have the
presentation app smart enough to not show all of the lines where just a date
in a header changed, doing word wrapping on the client side.

Also, without commit information, the changes are hard to wade through. Are
there summaries or titles of the bills that can be used in the commit message?
Who are the authors that drafted the bill and who are the "committers" that
voted for it?

------
daeken
Interesting project. My first thought was: Great, changelogs! But then I
started thinking a bit deeper and realized that what I'd love to see happen
(on a related note) is a site/repository where you can see not only the
legislation but the relevant case law over time.

~~~
NatW
The perfect match might be my friend Mike's awesome and free open source
project: He's improving it all the time and would welcome contribution:
<http://courtlistener.com>

It originated as a graduate school project of his at the UC Berkeley School of
Information.

It would be great if they inter-operated.

------
blibble
the UK parliament basically does this already:

here's an example of an act that's been modified:
<http://www.legislation.gov.uk/ukpga/Geo3/41/79?timeline=true>

and an example of a bill going through parliament:
[http://services.parliament.uk/bills/2012-13/financeno4/docum...](http://services.parliament.uk/bills/2012-13/financeno4/documents.html)

~~~
gioele
Please note that there is clear distinction between the timeline of the text
of an act, its enacting process and its legal content (the legal "meaning").

The text and process timelines (the easiest to create and visualize) are
interesting from a journalistic point of view but useless from a legal point
of view. You rarely care about the text of an act at a certain point. What you
really care about is the state of the law, the sum of all the _effects_ of all
_acts_ in a precise moment.

For example it may be interesting to know that on 31st December 2011 an act as
been enacted that says that on the 1st of July the new tax code will be
amended to read "The taxation level is 10%" instead of the previous "The
taxation level is 30%", but what I really want to know is "what is the
taxation level today, 25th of May?". Taking only the text into account will
not give you the correct answer. What you need is a more complex system that
"merges" all the intended actions written in the acts into a (mostly) coherent
state of the law.

Versioning the text of the law is not difficult, neither has been difficult
since the days of CVS. The hard task is to extract the legal meaning from the
text and create time-and-context-bound actions from that.

~~~
jedberg
You're missing the point. The versioning isn't to help me determine the
meaning.

The point of the versioning is so that I can see which representative made
which change, and from there derive which ones actually have my best interest
in mind.

~~~
gioele
> The point of the versioning is so that I can see which representative made
> which change

In many legal systems you cannot link representatives' votes with acts. For
example consider <http://en.wikipedia.org/wiki/Recorded_vote> ,
<http://en.wikipedia.org/wiki/Voice_vote> or the fact that many parliaments
vote on single articles (or single modification proposals) and the complete
act is never voted.

If you want a `git blame`, well, that is almost impossible in current legal
systems. Parliamentary records are much more interesting for that purpose.

~~~
crusso
Yeah, but you seem to be poo poo-ing this effort because it won't directly get
us from point A to point Z.

If it gets us to point B, C, or D, though, at least more people will
understand the difficulties and challenges of getting to Z. Maybe some people
will start to ask "Why is this so difficult?" "Does it need to be so
difficult?" "What are the forces that make this so difficult and how can we
circumvent them or remove them?"

As a software developer, our laws look like the worst form of spaghetti code.
They're such a mess that if this were a software product, I would be a strong
advocate of doing a complete rewrite. While we're in there doing that rewrite,
I want there to be an update to our change control management.

> many parliaments vote on single articles (or single modification proposals)
> and the complete act is never voted.

Sounds like a flaw in change control management. That would be like a software
developer who checked in code without being responsible for having the
automated tests succeed. Any such process that didn't hold the software
developer who checked in the code accountable for fixing how it breaks the
rest of the application is fundamentally flawed.

Rather than being apologists for the current system(s) of law making and
governing, why don't we think big and figure out a way to really re-invent
them?

Step one is shining more light on the current system by getting more people in
lots of disciplines looking at it. Software design is fundamentally based upon
the careful application of specific sets of rules. We've made huge steps in
solving problems that lawmakers just accept as the "way things are". We can do
better.

~~~
gioele
> Yeah, but you seem to be poo poo-ing this effort because it won't directly
> get us from point A to point Z.

No way. I am all excited about this kind of things and I have already stated
that anybody who wants to work on this topic is more than welcome to mail me
to discuss things together.

I am just telling you that these efforts, although necessary and interesting,
are not novel ("new" yes, "novel" no) neither a solution to the real current
problem. But let's all work together to overcome this.

> Rather than being apologists for the current system(s) of law making and
> governing, why don't we think big and figure out a way to really re-invent
> them?

We need to be both: realists and optimists. The reality is that any future
system will have to deal with the current system without regarding them as
"legacy systems": in UK there are still valid acts and cases from the late
medieval times. Another harsh reality is that you can only change a
legislative system from the inside. You can pressure it from the outside but,
in the end, only people making the law can change how the law is made.

The optimism comes from the fact that there has been a huge movement in the
legal offices all around the world in the last 15 years towards better
legislative drafting rules (what we would call "coding standards"). If you
want an example of a new guideline made in collaboration with computer
scientists, have a look at <http://www.apkn.org/lrp/guidelines/guidelines>
(there are being adopted by the youngest democracies in Africa, but also in
some EU countries).

These guidelines contains things like "you should always state which acts you
repel, never use 'all the acts contrary to this are repelled'". Do you see how
much more _machineable_ is the former versus the latter?

Many legislative offices are pushing pressure towards MP in order to make
these the use of such guidelines mandatory. It would be a huge step forward.
Another way to do this is via a "the code is the law" approach: there is a
tool made by the EU parliament that the MP can use to propose changes to
debated bills. Such tool has all these guidelines hardcoded and there is no
way to get around them (you can submit a written request but takes much longer
to be debated). This tool is really increasing the quality of generated acts.

------
azernik
Funny tidbit - in the first statute in Title I, Chapter 1 (basically top-level
definitions - "Words denoting number, gender, and so forth") it was considered
important to include among the 10 definitions the following:

'the words "insane" and "insane person" and "lunatic" shall include every
idiot, lunatic, insane person, and person non compos mentis;'

Interesting that that was considered to be up there with the legal definitions
of "person", "officer", "oath", and "writing".

~~~
crusso
Fascinating. I love it. Just looking through the comments here and at some of
documents, I've learned a few tidbits that I never realized before.

Right below the part you referenced:

> the words "person" and "whoever" include corporations, > companies,
> associations, firms, partnerships, societies, and > joint stock companies,
> as well as individuals;

So, there's a justification for the Citizens United decision right there.
Congress said it was so in the definitions of Title 1, Chapter 1. Yes, I know
it's more complicated than that. Still interesting, though. If Congress wants
to change the CU implications, they can start by changing that definition
right there.

------
afthonos
This idea keeps cropping up, and it terrifies me beyond all reason. It's
roughly as palatable as a direct democracy, because in effect, that's what it
advocates.

People who deeply care about the law are already able, and willing, to find
the information they need; I'm all for making it easier to manage, and there
are worthy projects in that respect, but by no means do I want _ordinary
citizens_ to start dabbling in legislation. The Founding Fathers' romantic
notions notwithstanding, running a government that provides important services
to 350 million people isn't a side-job—it's a full-time job, and arguably a
career. Heaping disdain on career politicians is absurd: if they're good at
their job, of course they should make a career out of it.

Which brings me to the idea underlying all these posts: that by keeping close
tabs on the intricate details of lawmaking, we can ensure that they will do a
good job. I have heard this argument before. It came from this guy who wasn't
really a coder, but wanted to keep close tabs on what the coders that worked
for him did. So he started asking them to log in all their hours, with
messages explaining what they were doing. And he started looking at the
commits in the VCS so that he would see the actual code. Of course, when he
didn't like something he would criticize. He would threaten people with
getting fired if they didn't code according to his standards. The coders tried
to explain that sometimes things have to be done in a way that's different
from the "common sense" way, and sometimes he was even reasonable about it,
but he still was not a coder, so _he had no way of knowing what was involved._

That's who we're trying to become with projects like these. The most pointy-
haired of pointy haired bosses. Our pointy hair wants points of its own, and
all because we try to hold people accountable. That's a canard.

We want to hold politians accountable because we feel they are irresponsible.
But what about our responsibility? Who hired these irresponsible politicians
to steward us? We did. Instead of looking for ways to make politicians
accountable, let's look for ways to make ourselves responsible. I would start,
on an individual basis, by taking ownership of our part of the equation: our
vote. Remember:

"Accountability is something that is left when responsibility is subtracted"
-- Pasi Sahlberg

Let's find projects that restore our responsibility. From that, the rest will
follow.

~~~
maratd
> This idea keeps cropping up, and it terrifies me beyond all reason.

I can only hope you remain in a constant state of fear. This has nothing to do
with direct democracy or democracy in general.

Please keep your pants on. The government already makes this data available. I
mean, where do you think he got it?

These are laws. Laws that we, as citizens, are obligated to comply with.
Failure to comply with some of these laws lead to jail or financial ruin. And
we are utterly ignorant over 99.9% of them. Especially the minute changes that
happen year to year.

The idea that one must hire a lawyer just to be made aware of what the law is
or is going to be ... is so warped and disgusting, I just don't know what to
say.

I applaud _any_ effort that allows a citizen easy access to the laws that
govern us and _especially_ their constant flux.

> I would start, on an individual basis, by taking ownership of our part of
> the equation: our vote.

Who am I supposed to vote for? The guy with the nice hair?

This is exactly the kind of tool that will allow me to quickly determine where
to place my vote.

~~~
superuser2
>The idea that one must hire a lawyer just to be made aware of what the law is
or is going to be ... is so warped and disgusting, I just don't know what to
say.

Try this: The idea that one must hire an engineer to build a bridge, or even
design one, is so warped and disgusting, I just don't know what to say.

The idea that one must hire a doctor to prescribe life-critical and
potentially deadly medication, or even give a diagnosis, is so warped and
disgusting, I just don't know what to say.

I'm not advocating keeping citizens in the dark. But there is a reason we
don't leave this to amateurs. We have already seen the way small, out-of-
context passages of law read by people who lack legal understanding can get
blown out of proportion in the media and threaten the country's progress, if
not well-being. Remember death panels? The anti-vaccine movement?

People participating too actively in processes they don't understand is a very
real danger. It doesn't necessarily outweigh the benefits, but I wouldn't
downvote someone just for bringing it up.

~~~
maratd
Poor analogies. Try this:

The idea that one must hire an engineer to walk across the bridge is warped
and disgusting.

That's one demented bridge.

Hiring lawyers just to grasp the law is absurd and reveals a fundamental flaw
within our body of law and government process.

------
m0skit0
Very nice idea if there was a REAL democracy, but I doubt this will be
suitable to the law-makers, because most of them don't want people to know how
this process is, let alone know what laws are being discussed, and even worse,
who and what did he/she patch...

~~~
crusso
What you say is very true. Dunno why people downvote a little truth when it's
stated clearly.

If what you said didn't have a strong grain of truth in it, then there would
be no need for this project. Our laws would naturally be more straightforward,
clearly written, and better organized because they're so important to society.

There are some really strong forces that oppose simple and clear laws. Some of
them are more natural results of maintaining a complex system. My feeling is
that a lot of the code ugliness is due to the selfish needs of those in power.

In HN terms, the current system is Proprietary. This GitHub project is looking
to add some Open Source goodness to the mix. I think it's a really wonderful
idea, since the very act of shining light into the enormously daunting
spaghetti code that we have to live by every day may help to wake people up to
the unneeded obscurities, contradictions, redundancies, anachronisms, wastes,
and outright abuses of power.

------
generateui
I placed the 2010 Dutch Pirate Party (Piratenpartij) election program on
Github. I try to elad by example: Set the example by the "internet party",
then hopefully others copy & paste it.

[https://github.com/generateui/VerkiezingsProgrammaPiratenPar...](https://github.com/generateui/VerkiezingsProgrammaPiratenPartij2010)

------
neilkelty
Love the "idea". This has been written about extensively on Quora with some
very interesting discussion. * [http://www.quora.com/What-can-lawmakers-learn-
from-computer-...](http://www.quora.com/What-can-lawmakers-learn-from-
computer-science) * [http://www.quora.com/What-are-the-nontechnical-barriers-
to-a...](http://www.quora.com/What-are-the-nontechnical-barriers-to-adopting-
a-version-control-system-for-use-in-writing-bills-new-laws)

I fear we'll find out that we really didn't want to know how the sausage is
made.

------
ahorak
It would be interesting to fork this and apply a simple and democratic
amendment system that allows all followers (or some other defined and growing
population like Hacker News) to vote on changes.

I say we use a strict majority to determine the acceptance of these amendments
and forge a document that reflects the multitude of views in the hacker news
community.

What would be the results, both realistically and idealistically, I wonder?

------
sailfast
Would putting each legislator's changes in the open help their ability to
compromise on difficult issues or hinder it? Sometimes it's easier to do the
hard thing if nobody can be pegged as directly responsible.

That said, I suppose each committee could use pay for a subscription to do
their markup "behind closed doors" before the final pull request hehe.

------
felipe_csl
I'd like to see people forking and making suggestions to that, opening pull
requests etc.

~~~
malkia
In the near future:

\- <http://github.com/senate> \- <http://github.com/president>

~~~
irfan
Interestingly <http://github.com/president> is guy from Russia

~~~
malkia
LOL! I did not bother checking them myself. Amuzing that github has for
president a russian tzar :) (okay, the dude seems fine)

------
ryancarson
This is a great idea, but won't work because legal text is so obtuse. We need
plain-english wording on all this in order for everyone to interact with it.

~~~
miniatureape
I've always wondered if it were preferable to have some more formal legal
language to remove ambiguities. Would writing laws or parts of laws as
'programs' help cut out loop holes in say, tax law?

~~~
Lukeas14
Problem is there isn't an efficient enough 'compiler'. To see if a law works
it has to be tested in court, a long, expensive process.

~~~
crusso
But isn't that true of almost every physical system?

In weather forecasting, for example, you can't have a deterministic algorithm
that accounts for the impact of every air molecule and calorie of energy in
the atmosphere. Instead, Scientists come up with statistical models that give
us a "good enough" picture of weather for our purposes of predicting whether
or not a hurricane may be heading our way or if we should plan on a picnic
over the weekend.

The beauty of it is that Scientists aren't really political about short-term
weather forecasting. (I won't get into long-range climatology politics :) The
models are either shown to work better than other available ones or they're
tweaked or replaced.

Maybe we need a similar approach to law making. If you create a tax or
spending law, it needs to be an input into our economic models. Economic
models need to be open sourced and running constantly with complete
transparency on the inputs and outputs. Over time, we should improve those
models like we have on the weather ones so that they give us the best picture
we can have on how financial laws will change the Economy.

Likewise, we should model the impact of other laws on prison populations,
crime rates, inflation, test scores, etc. Let's decrease the demagoguing and
the politicking all these issues and start getting to the science of them.

Sure, we'll still have debates on what we want the outputs to look like, but
at least we could focus the debates more on the outcomes that we want to see
rather than on what it would take to get us there.

------
zashapiro
Can you imagine how helpful diffs would be in the legislative process? Instead
of combing through hundreds of pages to find new changes, losses, amendments,
etc., it would all be right there.

Let's open source the law.

