Chapter 1 of 5
1
Keep main releasable
Software stays in use when a team can still change it. Continuous integration keeps that change cheap: people merge to main at least daily, a build tests the merge, and a broken main is the team's work.
Operating rule
My operating rule: keep main releasable, make the failure visible immediately, and do not let a red main become normal.
Checked 18 Oct 2026SDLC field card
Why the code stops lasting
Code does not become difficult to change all at once. Changes accumulate, branches drift apart, and a small improvement becomes a risky integration. The team responds by changing less. The structure that needed the improvement stays.
Fowler describes that decay as a cost, not a mood. A structure that was reasonable at the start is in the way six months later. Improving it means a deep edit. On a long-lived branch that edit collides with everyone else's work. The reversal he names is refactoring: small, behaviour-preserving changes to the structure, done often, on a build that can tell you the behaviour held.
A refactor that sits on a branch for two weeks can improve the code and still be too expensive to merge, because everyone else spent those two weeks building on the old structure. Integrate often enough and the same change is a few hours of adjustment. A clash shows up while the two people can still talk.
That is how I use the phrase software that stays in use. The code lasts because the team can still restructure it. Rare integration is what makes the restructuring too expensive to start.1
The practice, and my rule
The principle is Fowler's. Each person merges their work into the shared codebase, together with their colleagues' changes, at least daily. Each merge is verified by an automated build that includes tests, so a fault shows up while the change is small. A build server that only compiles feature branches does not meet that definition. He calls it semi-integration. You have pulled main into your branch. You have not combined your work with the other branches still open. The collisions wait until someone finally merges.
My operating rule on that practice: main stays releasable, and a failed integration build takes priority over the next feature. The invariant is frequent integration and a result you can trust.
The implementation choice is narrower than the principle. Hammant describes trunk-based development as one trunk, resistance to long-lived branches, and a main you can release. On that page he also describes a full build on the workstation before anyone else depends on the change. I use that workstation build as a safeguard. I do not treat it as the definition of every trunk-based team. Fowler argues the two names are one practice, and that a build server on feature branches is not it. A team can keep one trunk and still miss the daily merge, or miss a build that tests it. The tool sequence can vary. The work still has to land on main today, and the build still has to check that landing.12
The day
This is the order I use on a full-time team. The pull, the local build, and the push follow Fowler's walk. The second pull, the one before the push, is my sequence. It is not a step every continuous-integration setup requires. The local build is a safeguard on the machine that made the change. The integration build is the result that counts.
A pull request can carry the review when the branch is short-lived and lands the same day. Fowler's warning is the other case: a review that waits for hours or days adds enough friction to break the daily merge.12
- 1
Pull
Take main. If it is red, repair before a feature.
- 2
Change
A slice a person can read and merge today.
- 3
Test
Local build. Not the gate.
- 4
Integrate
Pull again, combine, push.
- 5
Verify
The integration machine.
- 6
Repair
Repair first, then return to pull.
- 1
Pull
Take main. If it is red, repair before a feature.
- 2
Change
A slice a person can read and merge today.
- 3
Test
Local build. Not the gate.
- 4
Integrate
Pull again, combine, push.
- 5
Verify
The integration machine.
- 6
Repair
Repair first, then return to pull.
- Pull. Take main and run the build before you change anything. If main is red, repair it before a feature. A new edit on a red build hides which change failed. Done when that build is green, or the red build is the work in front of you.
- Change. Keep the slice small enough that a person can read the diff and merge it the same day. If it will not fit, split it. An agent may draft the slice. The read is a person's. When the behaviour has to stay off while the code lands, Hammant uses a feature flag or a branch by abstraction. Those keep unfinished behaviour off the path a person uses. They do not make an untested change safe to release. Done when a person can read the diff and the slice can land today.
- Test. Run the build on your machine before anyone else can depend on the result. That result is not the gate. Done when the local build is green.
- Integrate. Pull again, combine with what landed while you were working, run the build again, and push. Done when the change is on main.
- Verify. Wait for the build on the integration machine. A green result on the laptop is not that result. Done when the shared pipeline has finished the required checks on the integrated change.
A broken main
A red main is the team's work, not a badge someone notices tomorrow. Fowler's rule, which he takes from Kent Beck, is that nobody has a higher priority than fixing the build. I stop further feature integration. The change that repairs the break, or reverts it, still lands. The team does not leave the failure in place. Normal integration resumes when main is green.
My rule when the cause is not obvious: if it cannot be isolated quickly, revert the suspected change and restore a main you already trusted. Investigate after that main is green. Bring the change back only with a passing integration build.16
- 1
Red build
The integration build goes red.
- 2
Stop
No further feature work lands on main.
- 3
Identify or revert
Name the change. If you cannot, revert the suspected one.
- 4
Green main
The fix or the revert has landed.
- 5
Resume
Feature integration starts again.
- 1
Red build
The integration build goes red.
- 2
Stop
No further feature work lands on main.
- 3
Identify or revert
Name the change. If you cannot, revert the suspected one.
- 4
Green main
The fix or the revert has landed.
- 5
Resume
Feature integration starts again.
An illustrative break
This is an illustrative scenario. It is not a record of a team I worked with, and it states no measured result.
A shared field is renamed. A downstream consumer still reads the old name. The integration build on main fails on that consumer's test. The red build names the change. Feature integration stops. The revert lands, the old name is back, and the same test passes. Integration resumes.
- 1
Field
A shared field is renamed.
- 2
Test
A downstream test fails on main.
- 3
Named
The red build names the change.
- 4
Revert
The revert lands. The known-good name is back.
- 5
Resume
Main is green. Integration resumes.
- 1
Field
A shared field is renamed.
- 2
Test
A downstream test fails on main.
- 3
Named
The red build names the change.
- 4
Revert
The revert lands. The known-good name is back.
- 5
Resume
Main is green. Integration resumes.
The tests that make the day possible
Daily merging dies if the build is too slow to run, or if red has stopped meaning anything. Fowler's ten minutes is a guideline for the commit build, the one that runs on every push to main. It is not a limit on every later stage. He splits what will not fit. The first stage compiles and runs the localized tests, with slow collaborators replaced by a double. A later stage may hit a real database and take a couple of hours. The first stage is the stop. The second stage is still fixed quickly. It is not the build you wait on before every push.
Vocke, using Mike Cohn's pyramid, is the shape inside those ten minutes. Many small fast tests. Some coarser tests. Very few that drive the whole application. He warns against a test ice-cream cone: a nightmare to maintain, and too slow to run. Test observable behaviour. A test tied to the internal structure breaks when you refactor, the safety net becomes noise, and people stop refactoring.
If the behaviour held and the test went red because a name or a collaborator moved, delete the test or rewrite it against the behaviour. A generated test stays unverified until a person has checked the assertion, the failure it is meant to catch, and the behaviour it claims to protect.
A control I rely on to stop a bad merge has to be able to fail the build. A review, a policy call, or a check on another cadence is a different control, and I do not describe it as that gate. NIST SP 800-218 says to integrate secure-development practices into the life cycle you already run. Practice PW.1 says you identify the security requirements and the risks the software will face, threat modeling being one form of risk modeling it names, and you track the requirements, the risks, and the design decisions. I use that record to decide which checks are gates. Some of those checks fail the commit build. Others run later, or sit in a separate control. I do not put every later check inside the commit build's time.1345
Fast
Many tests of observable behaviour, close to the change.
Coarser
Fewer tests across a boundary, still in the commit build when they stay fast.
End to end
Very few. They can run in a later stage.
Commit build
The stop before the next push. Fast tests, and coarser tests that still finish inside Fowler's guideline.
Later checks
End-to-end tests and other slow checks. Fixed quickly. Not the build you wait on before every push.
What I inspect
These are the questions I ask of a team. They are my check, not a claim that Fowler or Hammant published this list.
- Can a developer get a meaningful result from the commit build while the change is still small? Look at how long that build takes, and whether people are waiting on it.
- How long does a change typically sit before it is on main, and can a person read the diff? Look at the merge history.
- When main is red, who stops, and who restores it? Look at the build log for that red main.
- Do the tests fail because the behaviour changed, or because the structure moved? Look at a red test and the diff that turned it.
- Can the team say what would make this change safe to release, separately from the fact that it merged? Look at the release criteria, not the green badge.
How I would know
I track four signals. I have no target times, and these definitions are not results I have collected. A faster loop only counts if the main you restore is still one you can release. A green badge with rare merges, or a fast loop that leaves main broken, is not the practice.
- 1
Integration frequency
Merges to main per working day, or per week.
- 2
Feedback latency
From the push or the merge until the required build result is back.
- 3
Recovery time
From a failed main build until main is green again.
- 4
Release readiness
Whether the release criteria are met. A passing commit build is not that answer.
Where I do not use it
Fowler's limit, which I use: a project with one or two part-time maintainers and contributors they do not work beside. Daily integration is not plausible there. The pull-request workflow came from that setting. Raise the frequency you can. A build badge is not the practice.
The practice fails without the skill under it. No self-testing build, and main goes red for reasons nobody can see. No automation, and the integration itself takes too long to do daily. A team that pushes red and walks away trains everyone else to work on a broken trunk. I do not install the daily merge until the commit build exists and someone will stop for it.
I keep three decisions apart. Integration: the change has passed the required checks on main. Delivery: the software is in a state you could deploy. Release: whether people should run this version now. Fowler separates that last decision from the build. Once main is releasable, putting that build in production is a business decision. Continuous delivery, as I use the term, is the second decision. It is not an automatic production deploy, and it is not a reason to squeeze every later check into the commit build. Calendars, blast-radius proof, and the cutover sequence stay on the technology delivery field card. Keeping main releasable does not pick the window.17
Integration
Has the change passed the required checks on main?
- Daily merge
- A build that tests it
- A red main stops feature work
Delivery
Is the software in a state you could deploy?
- Main stays releasable
- Able to deploy
- A green build need not ship
Release
Should people run this version now?
- A business decision
- The delivery card's window
- Separate from the build
A faster first draft
An agent can draft more change than a team can merge in a day. The cost on this page is the collision between people, and a red main is the team's work. I keep the slice small enough that a person can read the diff and land it today, because that is what keeps the collision cheap. A later drafting tool leaves that cost where it is.