Durable Contracts, Disposable Code

Faster code generation doesn’t translate directly to faster feature delivery. Human judgement and focus time are the scarce commodities. We need to be more surgical: decide which code deserves human attention and which code agents can own — creating, regenerating, and reviewing it against clear contracts. My working premise for that is the split between durable and disposable code, and finding ways to create more disposable code on purpose.

Most of the Time Goes to Waiting and Review

When a project drags, it’s rarely because writing the code was slow. The time goes to other places.

Waiting. Teams wait on other teams and people, on decisions and on dependencies to land. Teams wait on requirements, technical and product. Much of a cross-team project’s calendar is spent in those queues, and agents don’t shorten a queue.

Review. Agents produce more code than people can carefully review. The extra output piles up waiting for review, and there’s an expectation that every change gets the same scrutiny, whether it’s a payment flow or a throwaway admin script.

We treat all code as equally important, and we let teams depend too directly on the implementation details of each other’s code. Rebalance where review and coordination effort goes and you can create visible velocity.

Disposability Is Created on Purpose

The durable versus disposable split isn’t new. Charity Majors argued last year that software is splitting into two domains. Disposable code is cheap because you don’t even try to maintain it. Durable code runs the world, and its cost is defined by maintenance.

Max Kanat-Alexander recently gave the spectrum four factors: consequences of failure, dependencies, cost of replacement and cost of maintenance. He also suggested you can make some software more disposable by putting guardrails around it, like forbidding other systems from depending on it.

That last idea is the one that connected to some of my own thoughts. Disposable doesn’t only mean test scripts, prototypes and throwaway UI. It can mean any implementation that sits behind a well-defined contract. A contract plus a conformance suite works on three of Max’s four factors at once:

  • Dependencies: consumers depend on the contract, not the implementation.
  • Cost of replacement: with a clear contract, a rewrite or port is a task an agent can build and verify.
  • Consequences: the suite and the boundary limit how far a bad implementation can reach.

I’ve seen this play out in a few recent projects. One developer ported our entire Cypress test suite, hundreds of tests, to Playwright in about a day. It worked because the old suite acted as the spec: the agent could read every test and reproduce its intent. But the Playwright suite is now the only copy of that intent, still tangled up with selectors, waits and setup helpers. It isn’t disposable until we pull the test cases out as their own artifact.

Another developer went the other way with a server-driven UI system. He started with a spec of the APIs, UI models and actions, then had an agent generate the client on different platforms. Each platform SDK was disposable from day one, because the spec came first. What it still needs is a shared conformance suite that proves every platform matches the spec.

A third project shows a different side. We’re adding private, per-user spaces to a platform built around shared workspaces. The work started as a Leap: a proof of concept built on top of the existing platform. The proof of concept was disposable. Its real value was showing where the platform’s durable surfaces assumed everything was shared. Before adding any feature code, the team is generalizing those surfaces on their own, which makes layering the private features on top faster and safer.

All three examples share the same shape: durable layers on top, disposable code below, and each layer defined by the one above it. The first two keep the bottom layer disposable. The third works from the other direction: it strengthens a durable layer so everything built on it gets safer. Product intent is the contract for the test cases. The higher you go, the smaller, more readable and slower-changing each layer gets. That’s where human attention pays off.

In each example, people review the top two layers and agents own the bottom one.

Three caveats to keep in mind:

  1. Hyrum’s Law (I had to look it up). With enough consumers, every observable behavior becomes part of the contract: ordering, timing, error messages, latency. A declared interface isn’t enough. Document what’s not promised, but use a conformance suite to enforce what consumers actually rely on. Deep modules help.
  2. Data outlives code. Schemas, stored formats, event shapes and migrations stay durable even when the code that writes them is disposable.
  3. Trust resets when you replace code. Charity’s point is that code builds trust by running in production. A new implementation restarts that clock, so it needs shadow traffic, progressive rollout and good observability at the boundary.

Making Seams on Purpose

A seam is a code boundary that lets you change behavior without changing the code around it. A seam is how teams stop waiting on each other.

Interfaces are a common type of seam and are an easy way to create the boundary between durable and disposable code. Agree on the interface first. Then one team builds against a mock while another iterates on the real implementation. The interface is the one-way door that deserves careful thought. Everything behind it becomes a two-way door that nobody has to wait on.

Three things make this hold up:

  • Start with an interface v0. Time-box the first draft, let consumers build against it right away, and mark the point where it stabilizes. Early consumers are the best interface reviewers you’ll get.
  • Treat the mock as the first disposable implementation. Run the conformance suite against it too, so the mock and the real thing can’t drift apart.
  • Make the mock honest. Include errors, latency and edge cases. A happy-path mock unblocks the team but pushes the risk to integration day.

Good architecture patterns already create these seams. We just haven’t thought of them this way.

Deep modules are the clearest example. John Ousterhout’s idea from A Philosophy of Software Design is a small, simple interface hiding a large implementation. The interface is what stays durable: specify it, test it, have people review it. Everything behind it can be disposable. Depth is leverage: a few dozen lines of contract can make thousands of lines disposable.

Shallow modules are the opposite. When the interface is as complex as the implementation, there’s nothing to make disposable, because the interface is the code. Watch for this with agents as they tend to produce lots of small wrappers and helpers unless you ask for depth.

Other patterns create the same kind of seam:

  • Ports and adapters: the ports are durable contracts. Each adapter for a database, payment provider or queue is disposable. Swapping a vendor becomes a regeneration task.
  • Strangler fig (yes, a real pattern): put an interface in front of legacy code, route traffic through it, and replace what’s behind it piece by piece.
  • Anti-corruption layer: keep an external system’s model from leaking into yours, so the integration stays disposable even when the other system is messy.
  • Plugins and extension points: the host defines the contract, and nothing depends on a specific plugin.
  • Functional core, imperative shell: a pure core is easy to specify and property-test, which makes it a strong candidate for regeneration.

Drawing the Line in Your Own Codebase

Here’s how we’re approaching it. None of this needs a big reorganization to start.

Start With Three Buckets

It’s tempting to say “everything that isn’t disposable must be durable” but that’s not true today. Most codebases have a third category:

  • Durable: contracts, specs, schemas and the core systems you deliberately choose to protect.
  • Disposable: implementations behind an enforced boundary, with a conformance suite that proves they work.
  • Entangled: code that wasn’t designed to be durable but can’t safely be thrown away, because nothing defines it except itself. This is most legacy code. Right after the port, our Playwright suite was here too.

To sort a component, ask what defines it and who depends on it. If a contract, spec or set of test cases defines it, and consumers only use its interface, it can be disposable. If nothing defines it but the code, or consumers reach into its internals, it’s entangled. If it writes data, the data format stays durable even when the code doesn’t.

Treat entangled code as durable by default for review and change control. Put it in the backlog. Each piece either gets a boundary and a contract, which makes it disposable, or gets a deliberate decision that it’s core, which makes it durable.

Concrete Examples

Component Durable part Disposable part What makes it safe
End-to-end test suite Test-case catalog: intent, preconditions, expected behavior Cypress or Playwright code Regenerating from the catalog alone gives the same coverage
Payment, email or search provider Your app’s own payments, email or search interface (the “port”) The adapter that calls the vendor’s API Contract tests, plus a mock that can fail and be slow
Internal service Its API contract and data schema The service implementation Consumer-driven contract tests, shadow traffic on replacement
Admin and internal tools The backend API The front end Front end can only use the public API

Enforce the Boundary

  • Label code by tier using directory conventions, CODEOWNERS or annotations.
  • Enforce the boundary mechanically. Use import or dependency linting so nothing reaches past an interface into internals. Without this, the boundary erodes and nobody is aware.
  • Track the share of changes that touch durable code. That number is roughly your human review load. Shrinking it is the lever.

What It Changes: Leap, Lift, Review and Ownership

In my Lift and Leap post, I described two modes of agentic engineering. Lift is the steady 1.5–2x gain across every team. Leap is the occasional 10x-plus jump on a bounded project. Seams help both, because both stall when teams are blocked.

Leap as a jump start. We use Leap to jump-start large projects, so we can start sooner and learn as we go. That only works with seams. The Leap produces a disposable first implementation behind a v0 interface, so whatever it gets wrong is cheap to throw away. The interface is the part that learns and stabilizes, and Lift then hardens what’s behind it. Leap discovers the contract. Lift makes it durable. Adding private spaces to our shared platform is a good example: the Leap showed which platform surfaces needed to become more general, and that refactoring comes before any feature work.

Rubber-stamp review for disposable code. Yes, we call it that on purpose. It’s an honest name for the experiment. Changes to contracts, specs and schemas get full human review. Changes that stay inside a disposable implementation can get a agent code review and a human rubber stamp, but only when two conditions hold: the conformance suite passes, and boundary checks confirm the change doesn’t reach past the interface. The guardrails allow the light review. Without them, it really is just a rubber stamp.

Ownership becomes stewardship of contracts. In my post on ownership, I argued for guardrails over gatekeepers. This is what that looks like in practice. Stewards own the durable interface and its conformance suite. Anyone, with their agents, can change the disposable implementation behind it.

None of this works on process alone. It depends on culture just as much: teams have to be comfortable building against a contract instead of waiting for certainty, and throwing code away can’t be treated as waste. That’s the slower part of the change, and we’re still working on it.

The seams where people deliberate end up being the seams where teams coordinate. Everything between them can move at agent speed. So “where are our interfaces?” becomes a planning question, not just an architecture question.

Invest in Contracts, Rent Implementations

This is an experiment, like everything else we’re trying right now. We’re using Leap to jump-start projects, running rubber-stamp review on disposable code, extracting a test-case catalog from our new Playwright suite, and generalizing a shared platform before layering private spaces on top.

The shift I’m after is simple to say and hard to do. Put human attention on the contracts, specs and data that define the system. Let agents own what’s behind them. Then keep turning entangled code into durable or disposable code.

If you’re trying something similar, I’d love to hear where you drew your lines.