March 2026·AI & Engineering·10 min read

Software Entropy Is Inevitable. Rebuilding Is Now Free.

Every system you build starts dying the moment you ship it. For fifty years, the answer was careful maintenance. The new answer is: let it rot. Then rebuild it in twenty minutes.

Decaying classical architecture being rebuilt by glowing automated systems — visual metaphor for software entropy and AI-driven rebuilds

The Second Law of Software

In thermodynamics, entropy always increases. Order decays into disorder. It is a law of physics — not a suggestion, not a best practice, a law.

Software has its own version of this law, and every engineer who has ever maintained a production system knows it in their bones:

“Every line of code you write today is technical debt tomorrow.”

Dependencies go stale. APIs change underneath you. Security patches create regressions. The framework you chose eighteen months ago is now two major versions behind. The developer who understood the billing module quit in November. The test suite that “covered everything” now covers 40% of a codebase that has tripled in size.

This is not a failure of engineering discipline. It is the natural state of software. Lehman's laws of software evolution, published in 1980, formalized what every practitioner already knew: a system that is being used must be continually adapted, or it becomes progressively less satisfactory. And as it adapts, its complexity increases — unless active work is done to reduce it.

For fifty years, the industry's answer to entropy has been maintenance: refactoring sprints, dependency updates, migration projects, rewrite committees. All of it expensive. All of it slow. All of it competing for resources against the features that actually generate revenue.

What if the answer isn't fighting entropy? What if the answer is making it irrelevant?

The Economics That Changed Everything

Here is the math that breaks the old model:

The maintenance trap vs. the rebuild option
Traditional: Maintain Forever
Initial build2–4 weeks
Dependency update cycleQuarterly
Framework migration3–6 months
Legacy refactor???
Cumulative cost↑ Increases forever
New: Rebuild When Needed
Initial build (coding agent)20–90 min
v2 rebuild from spec20–90 min
v3 rebuild from spec20–90 min
v47 rebuild from spec20–90 min
Cumulative cost≈ Constant

When rebuilding a module takes less time than debugging it, the entire calculus of software maintenance inverts. You stop asking “how do we fix this?” and start asking “should we just rebuild it?”

The answer, increasingly, is yes.

The Three Strategies

Software entropy attacks on three fronts. Each one has a different response when coding agents are in the picture.

Strategy 1: Spec-Driven Regeneration

The entropy: Code drifts from its original intent. Features get bolted on. Edge cases accumulate. Six months later, a function that was supposed to calculate shipping costs also handles tax exemptions, international duties, and a special case for one customer in Manitoba.

The old fix: Refactoring sprints. Code reviews. “We should really clean this up sometime.” (You never do.)

The new fix: Maintain the spec, not the code. When the module has drifted far enough, hand the spec to a coding agent and regenerate the entire module from scratch. Fresh code, current dependencies, zero accumulated cruft.

Spec-Driven Regeneration Cycle
SPECsource of truthAGENT20–90 minv1 codev2 codev3 codeentropy →entropy →🗑️🗑️← current

The key insight: the spec is a 2-page document. The code might be 5,000 lines. Maintaining a 2-page spec is trivial. Maintaining 5,000 lines of code against a moving ecosystem is a full-time job. Guard the spec. Let the code be disposable.

Strategy 2: Versioned Parallel Builds

The entropy: You need to upgrade from React 18 to React 19. Or migrate from Pages Router to App Router. Or swap your ORM. Every migration is a minefield of regressions, breaking changes, and “should still work but doesn't” edge cases.

The old fix: In-place migration. Feature-flag the changes. Run both versions simultaneously. Spend three months in purgatory where nothing fully works.

The new fix: Build v2 from scratch alongside v1. Give the coding agent the spec, the current behavior, and the target stack. Let it generate a complete rebuild. Run both in parallel. When v2 passes all tests, cut over. If it doesn't? Throw it away. v1 is still running. Try again.

“The cheapest migration is the one where failure costs you nothing because the old system never stopped running.”

This is not theoretical. I have rebuilt dashboard pages, API routes, and entire integration modules this way. The coding agent generates v2 in under an hour. If it works, ship it. If it doesn't, the investment was sixty minutes of compute time — not three months of a senior developer's attention.

Strategy 3: Entropy-Aware Architecture

The entropy: Monoliths calcify. Everything depends on everything. Changing the user model breaks the billing system which breaks the reporting dashboard which breaks the CEO's morning email.

The old fix: Microservices. (Which creates a different kind of entropy — distributed complexity, network failures, deployment choreography, and 47 Kubernetes manifests that nobody understands.)

The new fix: Design for disposability. Build modules with clean boundaries, not because your team has the discipline to maintain boundaries (they don't — nobody does over time), but because when a module starts rotting, you can rip it out and regenerate it without touching anything else.

Architecture for disposability
🏔️
Monolith
Everything coupled. Change one thing, break three. Migration = rewrite the world.
🕸️
Microservices
Distributed complexity. 47 services. Network entropy replaces code entropy.
🧱
Disposable Modules
Clean boundaries. Rip and replace. Regenerate any module in 60 minutes.

The key architectural principles for entropy-aware design:

  • Data contracts over implementation. Define inputs and outputs. The code inside the module is disposable. The contract is not.
  • Database as the integration point. Modules read from and write to well-defined tables. They don't import each other's code. When you rebuild the marketing module, the finance module doesn't notice.
  • Specs live outside the code. A markdown file describing what the module does, what it consumes, and what it produces. This is the input to the coding agent when you regenerate.
  • Tests are the only sacred artifact. The code can be thrown away. The tests cannot. Tests define behavior. Code implements it. When the implementation rots, regenerate the code. If the tests still pass, you're done.

The Versioning Flywheel

Here is where it gets genuinely exciting. When rebuilding is cheap, you can version aggressively:

The Rapid Versioning Flywheel
1
Ship v1 fast
Coding agent builds from spec. Ship it. Imperfect is fine. It's running.
2
Learn from production
Real users hit real edge cases. Capture them. Update the spec.
3
Rebuild — don't patch
Hand the updated spec to the agent. Generate v2 from scratch. Zero accumulated debt.
4
Cut over when ready
v1 keeps running. v2 passes tests? Swap. Doesn't pass? Try again. Cost: minutes, not months.
Repeat forever
Entropy never stops. Neither do you. But now the cost of fighting it is negligible.

This is fundamentally different from continuous integration or agile sprints. Those methodologies try to manage entropy through process discipline — small commits, frequent deploys, code review. They slow the decay. They don't eliminate it.

The versioning flywheel eliminates it by making the cost of a clean start approach zero. You don't manage rot. You outrun it.

What Changes in Practice

When you internalize this model, several things shift:

  • You stop hoarding code. That elegant abstraction you spent two days crafting? It's not precious. It's a solution to today's problem on today's stack. Tomorrow's agent can write a better one in the context of tomorrow's requirements.
  • Technical debt becomes a choice, not a crisis. You know the billing module has accumulated six months of cruft. You don't need a “tech debt sprint.” You need thirty minutes with a coding agent and a clean spec.
  • Framework migrations stop being terrifying. Next.js 15 to 16? Don't migrate. Rebuild. The spec doesn't change when the framework does.
  • Your competitive advantage shifts from code to specs. Anyone can generate code now. The moat is in your understanding of what needs to be built — your specs, your data contracts, your domain knowledge. The code is the commodity. The spec is the asset.

“Guard your specs like source code. Treat your source code like a build artifact.”

The Entropy Budget

Not everything should be rebuilt constantly. Some systems are stable, well-tested, and rarely touched. The flywheel applies where entropy actually hurts:

Where to apply the rebuild strategy
High entropy — UI components, API integrations, report generators. Rebuild frequently.
Medium entropy — Business logic, cron jobs, email templates. Rebuild when spec changes.
Low entropy — Database schemas, auth flows, core data models. Maintain traditionally.
The rebuild strategy is not “rebuild everything always.” It's “rebuild the things that rot fastest, and let the stable foundations stay.”

The Connection to Governance

This directly connects to the hub-and-spoke governance model. When agents build software that “graduates” from the AI layer into traditional infrastructure, that graduated software will eventually accumulate entropy. The old answer was to assign a developer to maintain it. The new answer:

  1. The orchestrator detects the graduated system has drifted (tests failing, errors increasing, dependencies stale).
  2. It spawns a coding agent with the original spec + updated requirements.
  3. The agent rebuilds the module from scratch on the current stack.
  4. Tests pass → deploy. Tests fail → discard, try again.
  5. The new version re-graduates into Layer 4. Cycle continues.

The system doesn't just build itself out of a job. It maintains itself out of a job. Software graduation is not a one-time event — it's a cycle. Build. Graduate. Decay. Rebuild. Re-graduate. The humans maintain the specs and the standards. The agents maintain the code.

What this changes
0
“tech debt sprints” needed
60 min
worst-case module rebuild
Specs
are the new moat

Bottom Line

Software entropy is not a bug in how we build software. It is a fundamental property of complex systems. For fifty years, we fought it with discipline, process, and prayer. We lost — slowly, expensively, inevitably.

Coding agents don't eliminate entropy. Nothing can. But they make the cost of starting fresh so low that entropy stops mattering. You are no longer maintaining a codebase. You are maintaining a set of specifications and letting disposable code be regenerated as needed.

The second law of thermodynamics still applies. But when rebuilding the universe is free, who cares?