Engineering · AI agents · Quality المدونة

Idea to main: why every change takes 22 steps

10 min readPublished

Falak is built by a fleet of AI agents, supervised by one person.

Every change passes 22 steps, three phases and three gates.

People ask why we do not make it shorter. This is the answer, in pictures.

Written for
Engineering leaders and clients who ask why software built by AI agents needs this much process.
On this page
  1. 01The short answer
  2. 02What makes this hard
  3. 03Who does what
  4. 04Phase 1: decide on paper
  5. 05Phase 2: build, check, review, repeat
  6. 06Phase 3: land and prove
  7. 07Why not optimise the process?
  8. 08What happens when an agent stops
  9. 09Common questions
  10. 10What to ask of any AI-built system
  11. 11Next step

01The short answer

AI agents write code fast. The process exists because fast code that is slightly wrong is the most expensive kind of code.

An agent can write a feature in an hour. It can also write a feature that passes its own tests and breaks a rule in a part of the system it never opened.

So every change travels the same road, from idea to main, the branch that holds the accepted code. The road has 22 steps in three phases. Each phase ends at a gate: a point where work stops until a check passes.

Three phases and three gates for every change Every change passes three phases, and each phase ends at a gate where work stops until it passes. Phase one, decide on paper, covers steps 1 to 7 with no code; its gate is the owner's decision that the build may start. Phase two, build and review, covers steps 8 to 15 in a loop; its gate is the review verdict to merge, fix or cut. Phase three, land and prove, covers steps 16 to 22; its gate is the owner's push, where a real run proves the change. PHASE GATE Decide on papersteps 1 to 7, no code Build and reviewsteps 8 to 15, in a loop Land and provesteps 16 to 22 Owner decidesbuild may start Review verdictmerge, fix or cut Owner pushesa real run proves it A gate: work stops here until it passes A phase of work
  1. Decide on paper. Steps 1 to 7. No code is written.
  2. Gate: the owner decides. Build may start only after this.
  3. Build and review. Steps 8 to 15, in a loop.
  4. Gate: the review verdict. Merge, fix or cut.
  5. Land and prove. Steps 16 to 22.
  6. Gate: the owner pushes. Then a real run proves the design.
Figure 1. Every change passes three phases, and each phase ends at a gate.

The question we hear most is "why can't you optimise this?" The direct answer is in Why not optimise the process? The sections before it show what each part is for.

02What makes this hard

The platform is large, every part must agree with every other part, and each agent starts with no memory of the last one.

These numbers were counted in the code base on 2 December 2026.

What How many
Age of the code base six weeks
TypeScript files about 3,700
Automated tests about 13,000
Test files about 1,400
Database migrations more than 120
Design records more than 50
Written briefs for agents more than 200

A person on a team remembers last month's decision. An agent does not. It starts each task with what is written down, and nothing else.

Give the same rule to three agents and you can get three answers.

One rule, three writers, three answers An illustrative example. One business rule is written once. Three writers, A, B and C, each start with no memory and build it. Writer A checks it in the service, the right place. Writer B checks it on the screen, which is easy to bypass. Writer C checks it twice, which gives two answers. Each answer looks correct alone. Together the system disagrees with itself. One business rulewritten once Writer Astarts with no memory Writer Bstarts with no memory Writer Cstarts with no memory Checked in the servicethe right place Checked on the screeneasy to bypass Checked twicetwo answers Each answer looks correct alone. Together the system disagrees with itself. The rule as designed What each agent built Illustrative example.
  1. One business rule. It is written once, as designed.
  2. Writer A starts with no memory and checks the rule in the service. That is the right place.
  3. Writer B starts with no memory and checks the rule on the screen. That is easy to bypass.
  4. Writer C starts with no memory and checks the rule twice. The two checks give two answers.
  5. The result. Each answer looks correct alone. Together the system disagrees with itself.
Figure 2. An illustrative example. Three agents that start with no memory build one business rule in three ways.

This slow separation of the code from the design is called architectural drift. Bad agents do not cause it. Many fast writers with no shared memory cause it.

The process is the shared memory.

03Who does what

Nobody checks their own work, and the one person in the process does 4 of the 22 steps.

Role Who Job
Owner A person Decides, opens the gates, pushes
Integrator An AI agent Supervises: decides, cuts, merges, verifies
Writer An AI agent Builds one brief on one branch
Reviewers AI agents of another model family Read a read-only copy of the code and try to break it
Scripts Automation Create the workspace, run the gates, run the whole chain

The fleet uses models from four vendors. One rule holds for every change: the writer and the reviewer never come from the same model family. The integrator writes no large code, so it never reviews its own work either.

Who does the 22 steps Of the 22 steps, the owner does 4, the integrator does 10, the writer does 2, the reviewers do 2 and scripts do 4. The owner is the only person; agents and scripts do the other 18 steps. The integrator is an AI agent that supervises: it decides, merges and verifies. STEPS OUT OF 22 10 8 6 4 2 0 4 10 2 2 4 Owner Integrator Writer Reviewers Scripts The owner does 4 of the 22 steps. Agents and scripts do the other 18. The integrator is an AI agent that supervises: it decides, merges and verifies. Steps that need a person Steps done by agents or scripts
  1. Owner: 4 steps. These are the steps that need a person.
  2. Integrator: 10 steps. The integrator is an AI agent that supervises: it decides, merges and verifies.
  3. Writer: 2 steps.
  4. Reviewers: 2 steps.
  5. Scripts: 4 steps.
  6. Total: 22 steps. The owner does 4. Agents and scripts do the other 18.
Figure 3. Who does each of the 22 steps. The owner does 4. Agents and scripts do the other 18.

04Phase 1: decide on paper

A wrong idea costs one page to fix on paper. In code it costs days.

Phase one: seven steps on paper Phase one has seven steps on paper before any code. An idea is noted with its reasons. An agent writes a position paper with options and reasons, then a design record with the status proposed, then briefs that name an owner, tests and an order. Another model reviews the papers. The owner decides and closes the open points. The briefs are refreshed against the real code, and then the build may start. No code is written before the owner's gate. Ideanoted with reasons Position paperoptions and reasons Design recordstatus: proposed Briefsowner, tests, order Paper reviewby another model Owner decidesopen points closed Brief refreshagainst real code Build may start No code is written before the owner's gate. A person decides A step done by an agent
  1. Idea. It is noted with its reasons.
  2. Position paper. The options and the reasons for each.
  3. Design record. Its status is "proposed".
  4. Briefs. Each brief names its owner, its tests and its place in the merge order.
  5. Paper review. Another model reads the design and the briefs.
  6. Owner decides. A person closes the open points. No code is written before this gate.
  7. Brief refresh. Each brief is checked against the real code.
  8. Build may start.
Figure 4. Phase 1. Seven steps on paper come before any code.

Two details carry most of the weight.

The design stays "proposed". A design record does not become "accepted" because someone likes it. It names a proof test. Until that test passes on a real run, at step 22, the status does not change.

A brief is a contract. It gives the goal and the reason, the order in which to read the existing code and notes, and the exact commands that must pass. "Done" means those commands pass. It does not mean the agent says so.

05Phase 2: build, check, review, repeat

The loop is the process. It is not a sign that something went wrong.

Phase 2: build, check and review until merge Phase 2 is a loop. The writer builds on one branch, the gates run on a fresh database, and a model from another family reviews the change. The verdict decides what happens next. On a merge verdict the change is ready to merge, and the loop ends. On a not yet verdict a fix round fixes the class of defect and adds a test, then the change goes back to the gates. After three fix rounds the scope is cut and recorded for the owner, and the work returns to a fix round. MERGE NOT YET BACK TO GATES 3 ROUNDS Buildone branch, one writer Gateson a fresh database Reviewanother model family Verdict Ready to merge Fix roundfix the class, add a test Cut scoperecorded for the owner A decision: merge, fix or cut A step A return path
  1. Build. One branch, one writer.
  2. Gates. Automatic checks run on a fresh database.
  3. Review. An agent of another model family reads the change.
  4. Verdict. A decision: merge, fix or cut.
  5. Merge: the change is ready to merge.
  6. Not yet: a fix round. The writer fixes the whole class of the problem and adds a test. Then the change goes back to the gates.
  7. After 3 rounds: cut scope. The part that keeps failing leaves this change and is recorded for the owner. The fix round continues with the rest.
Figure 5. Phase 2. The loop ends only when the review verdict is "merge".

The gates are the automatic checks: types, code style, the rules for which package may use which, the tests of each changed package, and the platform's own guard tests.

Three rules keep the loop honest.

  • Fix the class, not the example. The reviewer shows one bad input. The writer fixes every input of that kind and adds a test for it.
  • Cut after three rounds. When the same part fails review three times, more fixes are patches. The integrator removes that part from the change and records it for the owner.
  • Stop at security. A fix that needs a security file changed stops and waits for the owner.

06Phase 3: land and prove

An agent's report is a claim. The diff and the tests are the evidence.

Phase 3: from merge to a proven design Phase 3 checks a merge three more times before the design counts as proven. The integrator checks the work and reads the diff. The change is merged locally and is not pushed yet. The full test suite of about 13,000 tests runs, and the notes are updated for the next agent. Then the owner pushes, and only the owner does this. CI runs the tests and the security scans. A proof run does real work and keeps the evidence, and after it the design is accepted. An agent's report is a claim until the diff and the tests are checked. Integrator checksreads the diff Local mergenot pushed yet Full test suiteabout 13,000 tests Notes updatedfor the next agent Owner pushesonly the owner CI checkstests, security scans Proof runreal run, evidence kept Design accepted An agent's report is a claim until the diff and the tests are checked. Only a person does this A step done by an agent or a script
  1. Integrator checks. It reads the diff. An agent's report is a claim until the diff and the tests are checked.
  2. Local merge. The change is merged, and not pushed yet.
  3. Full test suite. About 13,000 tests run.
  4. Notes updated. The next agent starts from them.
  5. Owner pushes. Only the owner does this.
  6. CI checks. Tests and security scans run on the shared copy of the code.
  7. Proof run. A real run, with the evidence kept.
  8. Design accepted.
Figure 6. Phase 3. A merged change is checked three more times before its design counts as proven.

When a test of the full suite fails, the failure is compared against main. That shows if the change caused it. When the checks on the shared copy fail, the agent reports the log and waits. It does not push a fix and it does not run the checks again.

07Why not optimise the process?

We did. The machine part already runs without anyone watching. What is left are the checks, and each one catches something the others cannot.

One script runs the build, the commit, the gates, the review and the fix rounds, up to a set number of rounds. It sends one message at the end. Nobody sits and waits between those steps.

So the time that remains is the time the checks take. Here is what each one is for.

Six checks, each catching what the others miss Six checks run in order, and each one catches what the checks before it cannot. One, the gates catch type errors, style and broken layer rules. Two, the review by another model family catches logic and security holes that the writer cannot see. Three, the integrator catches a report that says done when the diff says otherwise. Four, the full test suite catches a change that breaks something far away. Five, CI catches a result that holds on one machine only. Six, the proof run catches a design that fails under a real crash. EACH CHECK 1 2 3 4 5 6 Gates Review Integrator Full suite CI Proof run WHAT IT CATCHES Type errors,style, brokenlayer rules Logic and securityholes the writercannot see A report that saysdone when the diffsays otherwise A change thatbreaks somethingfar away A result thatholds on onemachine only A design thatfails under areal crash Another model family reads the code A check by a script, the integrator or the owner
  1. Gates catch type errors, style and broken layer rules.
  2. Review catches logic and security holes the writer cannot see. Another model family reads the code.
  3. Integrator catches a report that says done when the diff says otherwise.
  4. Full suite catches a change that breaks something far away.
  5. CI catches a result that holds on one machine only.
  6. Proof run catches a design that fails under a real crash.
Figure 7. Six checks in order. Each catches what the checks before it cannot.

We did not design these checks in advance. We found the need for each one by running without it, or with a weak version of it.

What we did What happened The step that guards against it now
Ran a narrow list of gates, twice Three defects reached main Gates cover every package, guard test and script
Called a failing test a flake It was a real regression Every failure is compared against main
Called a test "proof" before review The proof was claimed too early A design stays "proposed" until the proof run
Built a branch on unmerged work It drifted when the base was cut Each brief is checked against merged code first
Took green gates as enough Many more review rounds followed Review runs on every change, gates green or not

A shorter process is not an optimised one. It is the same process with one of these rows waiting to happen again.

08What happens when an agent stops

Nothing important lives in an agent's memory.

Agents stop. A usage limit runs out, a tool crashes, a run takes too long.

When an agent stops, the next one reads the files Writer A stops because of a quota limit or a crash. What it leaves behind is the state on disk: the branch with its commits, the status file of the brief, the last review and the last gate log. Writer B picks up that state, reads it, then continues the work. The next agent continues from files, not from memory. A stopped agent is replaced, not waited for. LEFT BEHIND PICKED UP Writer Astopped: quota, crash State on disk the branch with its commits the status file of the brief the last review the last gate log Writer Breads, then continues A stopped agent is replaced, not waited for. An agent that stopped What survives: files, not memory The next live agent
  1. Writer A stops: a usage limit or a crash.
  2. State on disk is what it leaves behind: the branch with its commits, the status file of the brief, the last review and the last gate log. Files survive. Memory does not.
  3. Writer B, the next live agent, picks this up, reads it and continues.
  4. The rule: a stopped agent is replaced, not waited for.
Figure 8. When an agent stops, the next agent continues from the files it left behind.

The same holds for a reviewer that stops: another reviewer model takes the review. And it holds for the person. Decisions, notes and results are files in the repository, so a new session starts from them and not from a conversation that is gone.

09Common questions

Short answers to what people ask most.

Why not let one strong model do everything? Because no writer finds its own blind spots. A model reads its own code the way it wrote it.

Why must the reviewer be another model family? A model of the same family tends to make the same kind of mistake and to accept it. A different family reads the code cold.

The tests pass. Why review as well? Tests check what the writer thought of. A reviewer looks for what the writer did not think of. Green gates and a long list of review findings on the same change are normal.

Why does only the owner push? A push is the moment the work leaves one machine and becomes the shared truth. It is the hardest step to take back, so a person takes it.

Why a fresh database for every gate run? Data left from an earlier run can make a broken change pass. A fresh database removes that excuse.

Why cut scope and not try a fourth time? Three failed rounds on the same part mean the design of that part is the problem. A fourth fix adds a patch. A cut sends the question back to the owner.

Does all this slow delivery down? One change takes longer. The platform does not. Several briefs run side by side, each on its own branch with its own database, and main stays in working order while they do. The code base in this post is six weeks old.

Is the process finished? No. The table above holds five failures. We expect a sixth, and it will become a step too.

10What to ask of any AI-built system

The question is not whether agents wrote the code. The question is who checked it, and what the evidence is.

Four questions work for any supplier that builds with AI agents.

  • Who reviews the agent's work? Is it another model, a person, or the same agent?
  • What must pass before a change is accepted? Does it run on a clean setup?
  • Where are the decisions written down, so that the next agent or person starts from them?
  • Which steps may only a person take?

What to do next: ask these four questions about any software built with AI agents. Ask us first.

11Next step

See it run on one of your own processes.

Book a demo and bring the process that costs you most today. Or open the live platform, where the demo runs.

Related posts

All posts

Book a call

Times show in your time zone. You get a calendar invite with a video link.

Meeting length

Loading calendar

The calendar did not load. Open Cal.com in a new tab

Booking runs on Cal.com.