Software Lawmakers: A Future Without Dependencies
- Updated
- Created
- Reading time
- 23 min read
Software engineering is obviously in a strange place right now. AI writes more code, faster, than ever before - yet nobody really knows the best way to get good output from LLMs. It's kind of a Sisyphean trial and error cycle (for now). All of that combined in one result is making old problems worse rather than solving them. Many of these trace back to how our programming languages and their ecosystems were designed: supply-chain attacks, too many third party dependencies, and a verification layer that is hard to set up properly to gain actual confidence shipping things.
But our imagination is a beautiful thing - so let's teleport to the future and let's think how Post-AI era ecosystems could look like.
Theoretical future ecosystem specification
So, we've teleported. Here's the ecosystem as it could look from there, piece by piece. Some of it comes from tools that already exist, and most of it isn't built yet.
The running example
Two made-up names appear throughout this article.
- Tillstone is an open set of specs for online stores. Think of it as Medusa.js[1] for the distant future. Medusa.js publishes its cart, promotion, tax, inventory and payment modules as code. Tillstone publishes the same parts as specs and contains no code.
- Acme is a company that builds its store on Tillstone. Acme's own software factory writes all of the code. Acme's team owns the solution and never touches the code.
The section A week at Acme follows them through a full week.
The figures below draw code as a block pattern.
Language abstract
The language is extremely minimal and pure functional, with verification built in as a core principle rather than sold as a feature. Think of it as the best parts of a few ecosystems combined into one:
- Wuffs[2] and Bend 2[3], where the compiler proves numbers never overflow and AI-written code must come with proofs the compiler checks.
- Rust, whose compiler catches so many mistakes that an agent can keep fixing errors until the code is right.
- Haskell, for how it builds programs. Code is pure by default, side effects show up in the types, and small pieces such as monads and type classes combine cleanly.
- Koka[4], for effects. Instead of one catch-all
IO, a function's type lists exactly which effects it may use, like the network or a database. - Erlang, where one part can crash without taking the whole system down.
Spec
A spec isn't a loose prose document for an agent to interpret. It works like rustdoc but on steroids. Markdown explains the intent, and the code inside the spec compiles, so the spec has real types. The factory uses those types directly instead of guessing them from the text.
Every spec has four parts:
- Prose says why. It's documentation only, and the factory never takes instructions from it.
- Types say what shape, covering the data, the function signatures, the effects each function may use, and limits such as
u64 where self <= 10^15. - Laws say what must always hold, and the compiler proves them for every implementation.
- Examples say what result to expect for a given input. They run like doctests, and they're the only check for guidelines that no law can capture.
The spec ships all of that and no function bodies. Writing the bodies is the factory's job.
VM
The VM is a runtime in the spirit of Erlang's BEAM, built so that the types, laws and permissions the compiler checked still hold while the program runs.
- Everything is an isolated process. Each installed library runs in its own tiny process with its own memory. Processes never share memory. They only talk by sending messages.
- Messages follow the spec. Every message has to match the spec's types and laws, so the VM rejects bad data when it arrives instead of deep inside the code.
- Permissions, not trust. A process can only use the effects it was given when it started, e.g. network, disk or clock, and those must match the effects in its types. A pure library gets none, so even buggy generated code can't open a network connection.
- Let it crash. When a process fails, a supervisor restarts it in a known good state. One broken library can't take down the app or damage its neighbours.
- Updates without downtime. When a spec changes, the VM runs the old and new implementations side by side, moves new work to the new one, and rolls back if it crashes. BEAM already swaps code in running systems this way.
- Small blast radius. A bug stays inside one process of one app, instead of spreading to every app that shares a package.
No dependencies, no package manager
In the post-AI ecosystem, nothing is shared as code. There's no registry to download from, no lockfile and no dependency tree. What gets shared is specs, like the Tillstone specs in A week at Acme, and all the code in a project is first-party, written by that project's own software factory.
That removes whole classes of problems instead of managing them:
- No dependency hell. Two libraries can't need clashing versions of a third, because there is no third library, only laws that both implementations satisfy.
- No supply-chain attacks through packages. There's no package to hijack or fake. A malicious spec change shows up as a change in laws, not hidden code, so it has to get past your factory's proofs and your review. The prose in a spec is documentation only, so instructions hidden in the markdown can't change what the factory builds.
- No surprise code. You never inherit code you didn't choose. Your factory generated everything in your repository from specs you picked.
- Updates are a rebuild, not a version puzzle. When a spec changes, your factory rebuilds against the new laws, as Acme's factory does on Thursday in the example.
Software factory
The software factory turns a spec into working code, and the pattern already exists. eve[5], Vercel's framework for durable agents, ships Foreman as one of its default templates, a ready-made software factory. Foreman takes an issue through triage, planning, implementation and an independent review, then hands a draft pull request to a person. Its reviewer sees only the result, never the implementer's reasoning, which keeps the review truly independent. That's very close to the loop I have in mind.
In the post-AI ecosystem, people review laws, never code. The factory runs like this:
- Humans approve the spec, including its types, laws and examples.
- The factory writes an implementation, plus proofs that it follows every law.
- The compiler checks the proofs. Code without a proof doesn't ship.
- Scanners and people watch the running system. Anything they catch becomes a new law, and the loop starts again.
Updates and patches
Updates are plain pings
For updates, the old is new again. The right move is to choose boring technology. An update is a plain notification that a spec changed, and nothing more. It carries no code, no diff and no payload.
It's a read-only ping such as "Tillstone.Tax has a new version", sent to wherever your team already works, like Slack, email or a chat app.
Keeping it empty is the point:
- Nothing to attack. A message with no payload can't carry malicious code. Your software factory fetches the new spec itself, checks its hash and the publisher's post-quantum signature, and re-proves everything before any code changes.
- Nothing to integrate. Any channel that can show a line of text works. It needs no new protocol, webhook format or update server.
- Made for people. I believe humans will increasingly work through voice and text, talking to their tools instead of clicking through dashboards. A one-line notification fits that. Your assistant reads it out, and you answer "go ahead" or "not yet".
Everything after the ping is the factory's job. It pulls the spec, re-proves its laws together with your own amendments, and then either swaps in the new code or tells you which law broke.
Patches are local laws
Patches fit into the same loop. Your code is first-party, so you can change anything. But instead of editing generated code by hand, you write a patch as one more law, a local amendment to the spec such as Acme's VAT rule in the example.
That's what lets a patch survive updates. When the spec changes, the factory re-proves the new upstream laws together with your amendments and rebuilds the code. Nobody re-applies a diff by hand.
If an amendment clashes with the new spec, the compiler names the exact law that breaks and shows an example of it breaking.
Your architects still decide whether to keep, change or drop the amendment, but they start from a precise answer instead of a messy merge conflict.
Security
No global CVEs
Today one bug in a popular package becomes a global CVE, because everyone runs the same code and everyone is exposed at once. In the post-AI ecosystem, every company runs its own implementation, so a bug in one is usually a local exploit in one system, not a global one.
Attacks have to become targeted
Most attacks today aren't personal. Verizon's 2012 breach report found that 79% of attacks were opportunistic[7]. Attackers picked victims because they had an easy, known weakness, not because anyone targeted them specifically. That model depends on shared code. An attacker finds one bug, scans the internet and hits everyone running it. When every company builds its own system, that shortcut disappears. An attacker has to study each target on its own, which is far more expensive.
Where risk still hides
- The spec. Every implementation shares it, so a flaw in its laws, like a missing rule or a wrong assumption, reaches everyone.
- The factories. If most companies use the same few models, their code may share the same blind spots, and the same weakness spreads across many companies again. Attackers have AI too.
- The toolchain. The factory, the model, the compiler and the VM are the one thing every company still shares. A compromised model or factory could slip the same flaw into every implementation it writes, which brings the global CVE back one level down. That's why the proof checker has to stay small, open and simple enough for people to audit by hand.
24 companies. A flaw in a shared package exposes all 24, because they run the same bytes. When each company runs code its own factory wrote, a flaw in one codebase exposes 1 of 24. A blind spot in one of three factory models exposes the 8 systems that model wrote. A missing law in the shared spec exposes all 24 again, and one law upstream fixes all of them. A flaw in the shared compiler, VM or proof checker also reaches all 24.
Proofs plus scanners
Proofs cover everything the laws describe. For the rest, companies run security agents against their own implementations all the time. Vercel's open-source deepsec[8] already works this way. It sends coding agents through a codebase to find vulnerabilities, then re-checks every finding before it reaches the team. With many scanners from many vendors checking many different implementations, defenders get the same variety that attackers lose.
Open specs, fixed by the crowd
Specs can be open source, and they inherit open source's best habit, which is that anyone can look and anyone can help. A finding in one company's code is usually a local bug. A finding that comes from the spec itself, like a missing law, affects every implementation, so it goes back upstream. Sensitive findings go through private, coordinated disclosure first. Everything else goes to a public issue tracker. Once a fix lands, every factory picks it up through the same plain update ping.
This should leave fewer holes than today's code, because a spec is small and readable, so far more people can actually review it.
Frameworks
Like the Tillstone specs in the example below, frameworks stop being packages and become specs. A React spec would define what a component, a hook, props and state are, with real types that the factory uses directly. On top of the types come laws for the parts that must never break, e.g. a component never renders user input as raw HTML. The fuzzy parts, like how an interface should feel, stay guidelines, shown through the spec's runnable examples. Humans maintain the spec, and each team's software factory builds its own implementation from it. Nobody downloads React anymore. Everyone implements it.
In practice
A week at Acme
Here's Acme's week in full. Tillstone describes every part of a store, from the cart to the stock, and ships no code at all. Acme's factory implements all of it, backend included. The team owns the whole solution, but nobody on the team touches a line of code. Take a while to look at the snippets, especially the comments.
Monday: adopting the specs
Acme's architects pick five Tillstone specs. Here's a piece of one of them, inventory. Tillstone's lawmakers maintain it in the open, and every store built on Tillstone shares it:
spec Tillstone.Inventory -- one of Tillstone's specs: Cart, Promotions, Tax, Inventory, Payments
id sha256:9f3c…e1 -- a spec is named by the hash of its laws, not a version
refines sha256:41ab…07 -- upgrading is a theorem, not a promise
/// # Tillstone.Inventory
/// Stock across warehouses. Units are never created or lost, only moved.
type Quantity = u32 where self <= 10^6
type Stock = Map (Sku, Location) Quantity
/// Moves units of one product between locations, e.g. from "available" to "reserved".
fn move(s: Stock, sku: Sku, from: Location, to: Location, qty: Quantity) -> Result Stock NotEnough
/// Reserves every item in a cart.
fn reserve(s: Stock, c: Cart) -> Result Stock NotEnough
law conservation(s, sku, from, to, qty):
move(s, sku, from, to, qty) == Ok(after) implies units(after, sku) == units(s, sku)
law no_overselling(s, sku, from, to, qty):
move(s, sku, from, to, qty) == Ok(_) implies s[(sku, from)] >= qty
law reserve_conserves(s, c):
reserve(s, c) == Ok(after) implies units(after) == units(s)
-- speed is part of the contract, and proven
cost move(s, sku, from, to, qty):
O(log(size(s)))
-- every old law still holds here
proof refines(41ab…07):
by check_each_law(laws(41ab…07), laws(self))Acme doesn't import code. It imports laws, and its software factory does the rest:
use Tillstone.Cart sha256:2b7e…c4
use Tillstone.Promotions sha256:5e04…8a
use Tillstone.Tax sha256:77d0…19
use Tillstone.Payments sha256:c1a9…5e
use Tillstone.Inventory sha256:9f3c…e1
shaped_by trace("acme-prod-traffic.log")
-- your factory picks a better-fitting implementation for YOUR workload,
-- not the perfect one, just a better one.
-- e.g. Acme mostly reads stock levels, so it gets code that makes lookups fast.
-- a marketplace syncing stock from hundreds of sellers all day gets code that makes writes fast.
-- different code inside, same spec, same proven laws.The factory writes five implementations, proves every law, and commits first-party code to Acme's repository. A single order now flows through Cart, Promotions, Tax, Inventory and Payments. Everything in the middle is pure, and only the edges touch the outside world:
fn checkout(req: Request) -> Response <Store, Send, Net, Mail> = do
cart <- Cart.load(req.session) -- Store: reads the session store
let discounted = Promotions.apply(cart, req.codes) -- pure: no effects
let total = Tax.apply(discounted, req.region, req.date) -- pure: rates per item, no effects
reservation <- Inventory.send(Reserve(discounted)) -- Send: one message to the Inventory process,
-- which reserves one order at a time
match reservation
Err(NotEnough) => pure(Response.out_of_stock())
Ok(_) => do
receipt <- Payments.charge(req.card, total) -- Net: the payment provider moves the money
send_email(req.customer, format(receipt)) -- Mail: sends the confirmation
pure(Response.ok(receipt))The effects in angle brackets are part of the type. checkout may read the session store, message the Inventory process, call the payment provider and send email, and nothing else. Pure code, which is everything the spec defines, has no effects at all and can never touch the outside world. Haskell's IO only says that something happens. An effect type says exactly what, so the compiler always knows which parts of a generated library could talk to the network or disk, and which can't.
Tuesday: one process per spec
The VM runs every spec as its own isolated process and gives each one only the effects its types ask for:
run Acme.Cart as Tillstone.Cart with { store: "sessions" } -- Store only
run Acme.Promotions as Tillstone.Promotions with { } -- pure: no effects granted
run Acme.Tax as Tillstone.Tax with { } -- pure: no effects granted
run Acme.Inventory as Tillstone.Inventory with { store: "stock" } -- Store only
run Acme.Payments as Tillstone.Payments with { net: "api.payments.example" } -- Net: the payment provider only
supervise Acme.* with restart_on_crash -- let it crash, start cleanIf Payments crashes, the supervisor restarts it, and Cart and Inventory never notice. If someone slips a bug into Tax that tries to send data out, there's no network to send it to. The compiler would reject it first anyway, because Tax has no Net effect in its type.
What a bug can reach, out of the session store, the stock store, the payment provider and the rest of the internet. A package today runs inside the app and reaches all 4. In the VM each spec runs as its own process with only the effects in its type: Cart reaches the session store, Inventory the stock store, Payments one payment host, and the pure Promotions and Tax reach 0 of 4.
Wednesday: a patch
Acme sells books in Poland, where printed books get a reduced 5% VAT rate. The shared Tax spec doesn't cover that. Acme's architects don't fork anything. They amend the spec with one more law:
-- Acme's patch isn't a fork, it's one more law
amend Tillstone.Tax
law reduced_vat_books(item, region, date):
region == Region("PL") and item.category == Books
implies rate(item, region, date) == 5%The factory regenerates the Tax implementation and proves the new law together with every upstream one. Nobody merges anything by hand.
Thursday: the ping
A one-line message lands in Acme's Slack: "Tillstone.Tax has a new version". Acme's factory picks it up:
-- upstream publishes a new hash: re-prove, regenerate, done
fn on_spec_changed(s: Spec) -> () <Factory, Notify> = do
result <- Factory.reprove(laws(s) ++ local_amendments)
match result
Ok(impl) => Factory.swap(impl) -- Factory: replaces Acme's code
Err(law) => notify(team, show(law)) -- Notify: names the one law that brokeThis time the proof fails:
-- compiler: reduced_vat_books conflicts with upstream law `single_rate_per_region`
-- counterexample: a printed book shipped to PL gets 5% from Acme's law
-- and 23% from Tillstone's new law at the same time.
-- fix: scope your law to a new tax category, or ask Tillstone to support reduced rates.The VM keeps the current implementation running. Acme's architects, the software lawmakers from earlier, now have a precise question instead of a merge conflict. They open an issue on Tillstone's public spec and propose support for reduced rates.
single_rate_per_regionnew in Thursday's versionreduced_vat_booksAcme's patch, from Wednesdayrate(item, PL, date) ==Acme.TaxWednesday's build keeps runningFriday: a security scan
Besides the store itself, Acme's factory built a few custom extensions for Acme's admin panel, from Tillstone's extension specs. Every Friday night, Acme runs security agents locally against all of that code, the way deepsec does today.
This week the scan reports two findings:
-- Friday night, local scan of Acme's own code
scan Acme.* with security_agents
finding Acme.Payments
-- on a timeout, the retry loop writes the card token to the logs
=> ours: add a law, regenerate, remember it
finding Acme.Promotions
-- two stacked coupons give a discount larger than the cart total
=> the spec allows it: add the missing law locally, report it to TillstoneThe first finding is an implementation detail in Acme's own code, so Acme fixes it locally with one more law:
amend Tillstone.Payments
law no_secrets_in_logs(event):
logged(event) implies not contains(event, CardToken)The factory regenerates Payments, proves the new law, and stores the lesson in its memory, so it won't write the same mistake into any future implementation. It's a local bug with a local fix. Nobody else had it, because nobody else runs Acme's code.
The second finding is different. Acme's Promotions code does exactly what the spec allows, and the spec allows too much, because no law says a discount can't exceed the cart total. Acme adds that law locally right away:
amend Tillstone.Promotions
law discount_within_total(cart, codes):
discount(cart, codes) <= Cart.total(cart)Then it reports the missing law to Tillstone through private disclosure, because every other store built on the same spec has the same gap. Once Tillstone publishes the law, every store gets it through the same plain ping.
Black Friday
Acme's traffic flips. There are now far more reservations than stock lookups. The factory runs shaped_by again on the new trace and swaps in an Inventory that makes writes fast. The code inside is different, the laws are the same, and nobody on the team touched a line.
A toy cost model for Acme's Inventory. Read-fast code costs 1 unit per request with no writes and 6 with only writes; write-fast code costs 4 and 1. They cross at 37.5% writes. With Monday's trace, about 15% writes, the factory ships the read-fast code. On Black Friday, about 80% writes, it swaps in the write-fast code. The laws conservation, no_overselling, reserve_conserves and the cost bound stay the same and stay proven for both.
What the week turns upside down
Each of those few lines replaces a habit we take for granted when we install and update libraries today:
- Versions become proofs. The
refinesline replaces "trust me, it's semver" with a theorem that every old law still holds. - Forks become laws.
amendadds one more rule instead of forking or hot patching the code. If the rule clashes with upstream, the compiler names the law and shows a counterexample. - One implementation becomes one per consumer.
shaped_bygives every consumer code shaped by its own workload, all proven to behave the same. - Benchmarks become contracts. The
costline states the speed, and the compiler proves it instead of someone measuring it afterwards. - Tests become examples. Once the compiler proves every
law, tests stop being the main check and become documentation.
The closest thing today
None of the pieces is new. Several approaches already get part of the way, and each shows what works and what breaks without the rest of the system.
Header-only C++ libraries
The whole library ships as source in header files, and your compiler builds it as part of your project. Nothing is installed or linked separately, which is why people like them. They avoid the packaging problem[9]. It's the closest C++ gets to "the code is yours". But:
- Every file that includes the library compiles it again, so build times grow.
- The code is pasted into your project, so two parts of one program built with different settings can quietly disagree about the same code. C++ calls this breaking the one definition rule, and the result is undefined behaviour.
- It's still someone else's implementation, just in a different form. Changing it means forking it.
shadcn/ui
It describes itself as "not a component library. It is how you build your component library."[10] Instead of installing a package, you get the component's source in your own project and edit it directly. That's the ownership half of this vision, already working, and a big reason the project is so popular. What's missing:
- Updates are manual. Once you've changed a component, pulling in upstream improvements means comparing and merging by hand.
- There's no contract. Nothing says what a component must keep doing after you edit it, so nothing can check your changes against upstream.
whenwords
Drew Breunig's whenwords[11] is a library shipped as specs and tests only. You hand it to a coding agent and it writes the implementation in your language. It shows that a spec can replace a package, at least for small, well-defined utilities.
Bend 2
On the language side, Bend 2[3] comes closest. It's pure, and a LAWS.bend file lists rules the code must never break. An AI that changes the code has to write proofs, and the compiler checks them before it accepts the change. Its authors call it "AGENTS.md backed by proof".
What's still missing
Put together, header-only libraries and shadcn/ui show that teams want to own their solution. whenwords shows a spec can stand in for a package. Bend 2 shows that a compiler can check laws for AI-written code. None of them has the whole loop yet, with shared specs that carry laws, a factory per consumer, and updates that re-prove your own changes.
From software architects to software lawmakers
Everyone who builds software will need to think more like a software architect than before. When agents write the code, the valuable work moves up a level, to deciding what the software must do and what it must never do.
That matters because proofs only prove what the laws say. If a law is missing, AI-written code can pass every proof and still be wrong, like the card token leaking into Acme's logs in the example.
It may sound a bit esoteric, but I think software architects will slowly turn into something closer to software lawmakers. They write and review laws that must be proven by the system, amend them for their own company, and settle conflicts when an upstream change clashes with a local amendment.
The factories and the compiler will do the rest. Teams own the solution, but no human touches the code.
One last question
Look at how far we've come. We started by writing every line ourselves. Then we handed the boring parts to formatters and linters. Today AI writes the code and another AI grades it.
So here's my question for you. What if the next step is to stop owning the code at all, and to stop even trying?
Notes & references
Medusa.js, an open-source commerce platform. Its commerce modules include cart, promotion, tax, inventory and payment: https://github.com/medusajs/medusa
↩Wuffs, Google's memory-safe language for parsing untrusted file formats. Its compiler rejects any code it can't prove free of buffer overflows, integer overflows and null pointer dereferences: https://github.com/google/wuffs
↩Bend 2, a language by Victor Taelin and team built for AI-written code. You declare rules in a
↩LAWS.bendfile, and the compiler only accepts changes that come with proofs that those rules still hold: https://github.com/bendlang/bendKoka, a language by Daan Leijen. It tracks the side effects of every function in its type, so the compiler can tell pure code from code with effects: https://github.com/koka-lang/koka
↩eve, Vercel's framework for durable agents: https://eve.dev/
↩Sparkle, the open-source update framework used by many macOS apps outside the App Store: https://sparkle-project.org
↩The Register on Verizon's 2012 Data Breach Investigations Report: https://www.theregister.com/2012/10/24/opportunistic_hackers/
↩deepsec, Vercel's open-source security harness: https://vercel.com/oss/deepsec
↩Header-only libraries: https://en.wikipedia.org/wiki/Header-only
↩shadcn/ui docs: https://ui.shadcn.com/docs
↩Drew Breunig, A Software Library with No Code: https://www.dbreunig.com/2026/01/08/a-software-library-with-no-code.html
↩