Law & Politics
The life of a federal law, from first draft to the Code, told as a diff state machine.
I ship diffs for a living. At Meta, no diff lands without review, and no review finishes without enough stamps. A few weeks ago, while helping my friend research his ballot (the night I wrote about in The First Time I Saw Democracy Work), I started reading about how Congress lands the law. And I realized that Washington runs on diffs too, and the repo is called the U.S. Code. And I will go through how a federal law goes from first draft to enforcement, from a software engineer's perspective.
--- a/26 U.S.C. § 1 (before)+++ b/26 U.S.C. § 1 (after)@@ individual rates @@ top rate applies above $418,400- top rate: 39.6 percent+ top rate: 37 percent+ expires: December 31, 2025 (sunset)
Every diff starts as someone's draft. In Congress any member can write one, except tax bills, which the Constitution says must start in the House. Most members do not write the actual text. A nonpartisan office of drafting lawyers, the Legislative Counsel, turns ideas into statutory language, like the coding agent who formats your diff and fixes your lint. Once introduced, leadership assigns reviewers, and the diff enters the longest review queue in American life.
Referral is triage. The Speaker sends each House bill to a committee based on written jurisdiction (health goes to Energy and Commerce, taxes to Ways and Means), advised by the Parliamentarian. Cross-cutting bills can go to several at once, and where a bill lands is already life or death. Committees mirror the chamber's party ratio, with the majority holding the chair, the extra seat, the staff, and the subpoena power, so most bills die here on party-line votes. The quieter death is the chair simply never scheduling a hearing, letting the diff rot in the drawer. Since 1995, committee chairs serve six-year terms and owe their jobs to party leadership, which made them more loyal and less independent.
The survivors get a markup, a line by line edit followed by a vote to send the bill forward. A few committees matter more than all the rest combined. Rules sets the terms of every floor fight. Appropriations and its twelve Cardinals decide what gets funded. Ways and Means controls taxes and entitlements. Energy and Commerce holds the widest jurisdiction in Washington.
Above the committees sits the agenda cartel. The Speaker decides what reaches the floor at all. Of ten thousand bills introduced each Congress, three or four hundred pass, and the rest die unscheduled. A discharge petition signed by 218 members can force a vote, but it almost never succeeds, and an informal Hastert Rule keeps bills off the floor unless most of the majority party backs them. The Senate works the same way through its Majority Leader, plus the tradition that any single senator can place a hold. The calendar helps kill, too. Congress votes roughly 130 days a year, clustered Tuesday through Thursday, because Monday and Friday are travel days. During recess, they head back home meeting voters and donors, plus hours of daily fundraising call time. August empties out entirely, and after the November election the lame duck Congress returns, with defeated members voting until January 3, to clear whatever cannot wait.
You may wonder what actually happens once a bill reaches the floor. The House and the Senate answer differently. In the House, the Rules Committee writes a custom rule for each bill: how many hours of debate, whether amendments are allowed at all (a closed rule means vote it up or down untouched). In the Senate there is no such traffic cop. Debate ends only with 60 votes for cloture, and final passage takes 51, so the real fight is always about reaching the vote, not winning it. Nominations, reconciliation, and a few fast-track procedures are exempt from the 60-vote rule. Regular spending bills are not, which is why shutdowns and thousand-page omnibuses are a lifestyle.
You might be curious on what does majority mean here: more than half of those present, or more than half of all members? I asked this myself. The answer starts with quorum: 218 members must be present in the House and 51 in the Senate before any business counts. Once quorum exists, passage needs only a majority of those voting. Say 220 representatives show up and 200 cast votes: 101 yes wins, and the 20 who sat out might as well have stayed home. That is why an absence counts as roughly half a no, except against fixed thresholds like 60, where an absence is a full no.
You hear the word filibuster on TV all the time, but what is it, and why did it used to require talking? The old Senate ran on a single track: one matter at a time, so holding the floor by talking blocked everything behind it. Strom Thurmond spoke for 24 hours in 1957 because that was the only way to stall. In the 1970s the Senate switched to two tracks, letting other business move while a filibuster sat pending, and talking stopped blocking anything. The routine filibuster went silent: the minority signals it, the majority fails to find 60, and the bill freezes without a word spoken. Ted Cruz spoke for 21 hours in 2013 and Cory Booker for 25 in 2025, but that is theater now. Obstruction used to cost a marathon and now costs a memo, which is why everything needs 60.
In engineering terms, picture two engineers drafting the same diff in parallel, racing through review, and then learning both approved versions must be letter-identical before anything lands. That is bicameralism. Differences get reconciled by ping-pong amendments or a conference committee whose compromise goes back for an up-or-down vote with no further edits. Then comes presentment, and the president has three options plus a pocket trick: sign it into law, veto it back (Congress can override with two-thirds in each chamber), let it become law unsigned after ten days while Congress sits, or pocket veto it by ignoring it past adjournment. In diff terms, the options are land, request changes, auto-land on timer, or abandon on expiry. The two-thirds override is a force push that needs a supermajority of owners.
But the news said the big beautiful bill passed with 51 votes. Where was the filibuster? The answer is a lane built for money: budget reconciliation, 50 votes plus the vice president, limited to provisions that move federal dollars. Because reconciliation is the only 50-vote lane, leaders try to stuff everything into one mega-bill. However, everything unrelated gets scrubbed by the Parliamentarian in the Byrd bath, named for Robert Byrd's 1985 rule, and needs 60 votes to survive. The current referee, Elizabeth MacDonough, kicked the $15 minimum wage out of the 2021 COVID bill and immigration provisions out of Build Back Better, and both parties kept her anyway.
These monsters mix permanent rewrites of the tax and health titles with one-time appropriations that never enter the U.S. Code at all. Some permanent parts carry self-deleting timers to fit the ten-year deficit window, like the 2017 individual tax cuts set to expire in 2025. The full picture is a hotfix lane with a linter, a build cop, and an expiry date on half the lines.
After a monster like that lands, you may wonder what happens next. Does someone clean it up and sort it into Code chapters? Mostly yes. Landed laws do not go straight into the book. Each arrives first as a slip law, gets bound into the Statutes at Large each Congress, and then the Office of the Law Revision Counsel classifies the permanent, generally applicable parts into the 54 titles of the U.S. Code. Annual spending, private relief bills, and post office namings stay in the session archive forever. Only about half the titles have been formally enacted as clean positive law. The rest are editorial compilations, and in a real dispute the Statutes at Large control, so the monorepo is half-migrated with the gardeners still running codemods. Nothing lives forever: repeals and sunsets prune the tree, although dead code lingers for decades.
Watch the news in Trump's second term and federal judges seem to block the strangest things: demolishing the East Wing, building a ballroom, renaming the Kennedy Center. I wondered what gives one judge power over White House renovations. The answer is that anyone concretely hurt by a government action can sue over it, and every executive move has to survive the statutes that govern it: unappropriated spending is illegal, historic buildings need preservation review, agencies must follow their own procedures. The blocks you see on TV are almost always preliminary injunctions, not final judgments. A judge freezes the policy on paper, with no jury, because nothing has gone to trial yet, and the real case crawls forward for months or years behind the freeze. That is why you never see a jury in these fights. Juries only appear at full trials, and most of these wars end long before trial, on appeal or not at all.
Underneath the drama sits a three-level machine built for volume. District courts, 94 of them, are where trials happen: witnesses, evidence, juries, guilty pleas. Circuit courts take every appeal as of right but decide on the written record, with no new witnesses. The Supreme Court is the odd one: about 7,000 petitions arrive each year and it hears around 70. It takes four of the nine justices to accept a case, which is all four votes to grant means. Think of it as an architecture board that reviews 1 percent of diffs and lets the rest stand as decided below.
So which cases land in federal court at all? Only what Congress and the Constitution assign: federal questions under the Constitution, the Code, and treaties, plus diversity cases where citizens of different states fight over more than $75,000. In diversity cases the federal judge applies state substantive law, running another team's code in your runtime. Everything else belongs to state courts, which decide more than 95 percent of all cases in America.
You may assume from all this that federal courts only handle the Constitution and civil lawsuits. Federal criminal law says otherwise. El Chapo, the Boston bomber, and SBF were all federal cases. Congress pre-wired hooks everywhere through the Commerce Clause: the Boston indictment used the weapons-of-mass-destruction statute, the public-bombing statute, and explosives-against-commerce charges, and under the Hobbs Act robbing a store that ever sold out-of-state soda is a federal crime. The feds took Boston partly because Massachusetts has no death penalty and they wanted one available. The same conduct can be tried twice, once per sovereign, and marijuana sits in the famous split: legal in many states, a federal crime everywhere, alive on enforcement discretion. Two odd corners round out the map. Immigration courts are not courts at all but Justice Department employees deciding cases for their employer. Tribal courts run a half-sovereign system of their own, most visibly since McGirt returned most of eastern Oklahoma to reservation status in 2020.
With 94 district courts, my next question was who decides which judge gets the case. The answer is the plaintiff. People suing the government can file where they live, where events happened, or in DC, so red states sue in Texas and blue states sue in California or DC. Single judges in one-judge divisions became famous for it until a 2024 rule pushed random assignment. One judge's nationwide injunction used to freeze policy everywhere, until the Supreme Court narrowed that power in 2025, pushing challengers toward class actions and multi-state coalitions. Splits between circuits are a feature: the Court watches issues ferment below and steps in to settle them, often through emergency shadow-docket orders with little briefing.
When courts do rule, must they follow past rulings? Mostly yes, under stare decisis, and the engineering version is Hyrum's Law: everyone has built on your public behavior, so changing it breaks the world. Overruling still happens, Brown and Dobbs being the famous examples in opposite directions, but it needs a strong reason, because the whole ecosystem depends on the old output.
Laws never spell out every detail. The gray zones get filled by regulation. Regulations go through public notice and comment and carry real penalties; the 2020 rule against online-only foreign students died within days of Harvard and MIT suing. Executive orders direct the president's own branch and cannot create programs or spend unappropriated money, under a three-zone test from the Youngstown steel case. Guidance documents state enforcement priorities and bind no one, like an internal wiki.
For forty years courts deferred to reasonable agency readings under Chevron, dynamic typing with trust in the implementation. In 2024 Loper Bright ended that: courts interpret statutes themselves, strict static checking. And under the Major Questions doctrine, the biggest moves need explicit congressional authorization. A breaking change needs an RFC signed by the API owners, which is why student loan forgiveness died.
The Voting Rights Act of 1965 is the most instructive diff in the repo. Passed after Selma under Congress's power to enforce the Fifteenth Amendment, it banned discriminatory voting rules nationwide (Section 2) and forced covered states to pre-clear election changes with Washington (Section 5, with its preclearance regime). Congress re-landed it in 2006 for 25 more years with near-unanimous votes. In 2013 the runtime reverted half of it. Shelby County held the coverage formula unconstitutional, which switched off preclearance overnight without touching a word of the statute's text. Congress tried to ship a replacement, and the John Lewis Act died to a filibuster in January 2022 when two Democrats refused to carve out voting rights. Then in 2023 Allen v. Milligan upheld Section 2 and ordered Alabama to draw a second Black-majority district. That is one diff over sixty years: landed, re-landed, half-reverted by the courts, replacement blocked in review, and the surviving half enforced. Every stage of the machine appears in a single file's history.
Now when I read Congress news I see a state machine. A bill stuck in committee is a diff nobody reviewed. A 52-48 cloture failure is five missing stamps. A veto threat is a revert warning, and a reconciliation package is a hotfix train racing the linter. The vocabulary changed how I read my own ballot, too: behind every name and proposition sits a stage in this pipeline, and my part 1 checklist gained a new first question, which stage am I actually voting on.