Lisa Blog

TDD, DDD and BDD were for humans. Here's what we built for agents.

· Flakerim Ismani
agentsmethodologyharness

Every methodology is a prosthetic

TDD, DDD and BDD were never about code. Each one compensates for a specific human weakness.

TDD exists because people write the code first and then write tests that flatter it. DDD exists because developers and domain experts use the same words for different things. BDD exists because specs rot the moment nobody executes them.

Agents don’t have those weaknesses. They have different ones. So when we started building Lisa OS with agents doing most of the typing, we stopped asking “how do we get agents to do TDD” and asked “what is the agent version of the problem TDD solved”. This post is what we found, and how it shaped the harness Lisa OS is built on.

What an agent actually gets wrong

An agent is a developer with no memory, no ego and no patience limit. That combination fails in ways a human team never did.

Human weakness Agent weakness
Writes code first, tests after Writes tests that pass vacuously, then “fixes” them
Forgets the design discussion Forgets everything between sessions
Misreads the domain expert Confidently invents the domain
Learns from the last bug Learns nothing unless the repo teaches it
Gold-plates Drifts: touches files outside the task
Hates tedious tooling Doesn’t mind tedious tooling at all

The last row is the interesting one. It cuts both ways: agents will optimize whatever you measure, including gaming a test suite, but they will also happily write Gherkin, run mutation tests on every commit, or produce a formal proof. Tools that died because humans found them tedious are suddenly cheap.

So the agent-native methodology has one job: give the agent something it cannot game, cannot forget and cannot drift away from. Everything else is detail.

Three successors

Each of the human methodologies has a direct descendant once you swap the weakness it was built for.

Oracle-driven development replaces TDD. The question is no longer “write the test first” but “what is the non-gameable signal the agent iterates against”. Oracles form a ladder: types, then property tests, then example tests, then differential tests against a reference, then human review. Three rules fall out. Red must be proven: the agent shows the failing test before it implements, because vacuous tests are its favorite shortcut. Powers are separated: whoever writes the test does not write the code, or the test is frozen once approved. And tests are tested: mutation testing checks that the suite actually bites.

Context-driven design replaces DDD. A bounded context is now literally a context window. The unit of architecture becomes “what one agent can load and reason about correctly in one task”. Ubiquitous language becomes a glossary file. Naming matters more, not less, because the agent infers semantics from names, and conventional patterns beat clever ones because the model has priors on them.

Spec-driven development replaces BDD. This is the counter-intuitive one. BDD half-failed because humans hated writing Gherkin. Agents don’t mind. So the spec becomes the source and the code becomes a build artifact. Patching code without patching the spec is patching a binary. Humans move up the stack: they write specs and review diffs, they no longer type implementations.

And a few things with no human precedent at all: regenerating a module from its spec instead of refactoring it, running five implementations in a tournament and letting the oracle pick, pairing a builder agent with a breaker agent, and treating every lesson as something that must land in the repo as a check or it is lost.

The Lisa harness already does this

Lisa OS is built as one tree, and every rule about that tree is checked by a machine. We arrived at this before we had names for the methodologies above; the names just explained why it worked.

lisa-os
├─ base     Fedora 45, no Lisa logic
├─ core     daemons identical in every edition
│  inferenced · modeld · contextd · agentd · portal · ledger · mcp_bus · sdk
└─ flavor   what differs per edition
   ui · apps · desktop · server · touch · smart

Our operating principle: if a machine can’t check it, it isn’t a rule. We deleted our ADRs for exactly that reason. Prose decisions drift because nothing fails when they go stale. Agents guess where the rules are prose and comply where a command says pass or fail. So every decision either became a check or got deleted.

Methodology Lisa mechanism
Context-driven design Each node is sized to one agent session. A leaf loads only its own node.toml, the specs on its path to the root and the api/ of its declared deps. Never the whole repo.
Oracle-driven development Every node declares accept = "just test <node>". A node is done when accept passes, never when someone says so. A parent is green when all children are green plus its own integration test.
Spec-driven development node.toml is the spec: id, why, needs, accept, strict schema, unknown fields fail. Status, API clients and the tree overview are generated from it, and the checker fails if regenerating changes anything.
Separation of powers lisa tree check verifies the diff stays inside the agent’s assigned node. An agent cannot quietly edit a neighbor’s tests.
Repo as memory Dependency rules live in tree.toml (deny = ["core/** -> flutter"]), not in docs. Every leaf has the same shape: node.toml, api/, backend/, front/, tests/. Agents scaffold with lisa tree add, they never invent structure.
A defined move when rules run out If a node needs something another node’s api/ doesn’t offer, the agent stops and reports. Hallucination happens where the rules run out, so running out gets a rule too.

The root agent file is four lines: run lisa tree show <node> for your context, edit only inside that node, run lisa tree check plus accept until green, and if you need something you can’t get, stop and report.

Then we build harnesses on top of the harness

The tree harness only makes structure bulletproof: where things go, what may touch what, what done means. It says nothing about whether the logic inside a leaf is any good. That is deliberate. Structure is the one layer that has to be right first, because every other harness assumes it.

Once lisa tree check holds, each layer above it can be sloppier, faster and more experimental, because the layer below catches what it misses.

4Lisa OSagentd runs the user's agents under the portal's permissions; every action goes to the ledger
3Task harnessa breaker agent against a builder · five implementations racing · a module regenerated from its spec
2Node harnessaccept grows property tests, a proven-red step and mutation testing
1Tree harnesslisa tree check: where things go, what may touch what, what done means
Harness stack · four layers, the tree at the base

The tree is the only layer that must be right first; each layer above it borrows its guarantees from the one below.

The node harness is where oracle-driven development lives: each accept grows property tests, a proven-red step and mutation testing, and none of that needs the tree to change. The task harness is where the no-precedent ideas go: a breaker agent attacking a builder’s branch, five implementations racing for the same node.toml, a module regenerated from its spec when the patch history gets ugly. All of it runs inside a node, so the blast radius is one leaf.

And the top layer is Lisa OS itself. agentd runs the user’s agents under the portal’s permissions, with every action written to the ledger. That is the same shape: a machine-checked boundary, a defined move when the rules run out, no guessing. We built the OS with a harness, and the OS is a harness.

What this doesn’t solve

The harness decides where code goes and what done means. It does not decide whether the code is good. A leaf is only as correct as its accept tests, and an agent can write a weak accept as easily as weak code. That is where human review time goes now: not reading implementations, but reading the tests and the node.toml that define them.

Two other things stay honest problems. Real dependencies form a graph, not a tree, so the tree decides ownership and the cross-links get declared in needs, which is a compromise. And a harness this strict is only worth it when agents do most of the typing. For a two-person team writing by hand, lisa tree check would feel like bureaucracy.

The short version

Humans needed methods that fought their habits. Agents need methods that leave them nowhere to guess. For Lisa OS that meant one tree, one manifest per node, one judge, and a rule for what to do when the rules run out. Everything we build after that, including the OS, sits on top of it.

← All posts