When one product is built by several teams, a lot of the lost time is not inside the teams. It is in the seams between them: the places where one team hands data to another, and both are sure they are talking about the same thing. You won't see that time on any work plan. You find it when a whole team is stuck and nobody knows why.
We built a shared infrastructure through which six teams pass data to each other.
One day, one team's services stopped sending data. Every attempt ended with the same error: the system did not recognize the message format. But the format was registered, and you could see it with your own eyes. One of the engineers investigated, and the cause turned out to be a comment in the code: a line a programmer wrote for other programmers, which no computer was supposed to care about.
When several teams build one product, the agreements between them need an automatic guard, and someone has to own the seams that no team holds. Otherwise you will find the problem only when a whole team is already standing still.
The Agreement Between Teams Is a Contract
When one team sends data and another team reads it, both need to agree on its structure: which fields there are, what each field holds, and what is mandatory. That is the contract between them. If one team changes the structure without coordinating, the other team starts receiving wrong data, and sometimes you only find out at the customer.
So all the format definitions lived in one central place, with a simple rule: a change has to work in both directions. A new version has to understand old data, and an old version has to understand new data. Adding a field is fine. Changing the meaning of an existing field is not.
A rule that relies on everyone remembering it does not last long, especially under pressure. One of the engineers built a process in which every format change goes through an automatic check before it gets in. If the check fails, the update stops, and a breaking change simply never reaches production. For whoever runs the company, this means the product's stability does not depend on nobody rushing on a Friday afternoon.
A Check That Cannot Fail Is Worse Than Nothing
With a check like this, it is easy to miss one detail: what you compare against. In the first version, the check compared the change to the version in the same work branch, in other words, to itself. A check like that always passes. I asked for the comparison to be against the version already running for everyone.
Once the comparison was fixed, the check started catching real things. When we merged the format files of all the teams into one place, it turned out that two copies of "the same" format disagreed: two fields were mandatory for one team and optional for another. Two teams were working by two different contracts, and neither of them knew.
This holds far beyond format checks. A green screen means nothing if you don't know what it checks against. A check that cannot fail is worse than nothing, because everyone stops checking for themselves.
No Team Made a Mistake
The comment was a different story. The infrastructure saved the format files exactly as they were, including the comments programmers wrote inside them. The services looked up the same format, but in the version generated automatically from the code, and there are no comments there. The central system knew to ignore whitespace when comparing, but not comments. So what the services looked for was never identical to what had been saved, and the answer was "not found".
Each of these decisions was reasonable, and every team did its part correctly. The bug lived in the seam between the decisions, exactly where no team was responsible.
Before we touched the code, two engineers reproduced the failure, each in a different environment. Only then did I approve the fix. The fix itself was small: strip the comments only at the moment of saving, and leave the files as they are, for the people who read them.
This is what a technical lead has to do in an organization with several teams: own the seams. Every team knows how to guard its own code. Someone has to guard the places in between.
What Is Hidden Turns Every Failure Into Guesswork
In the first version of the fix, the output of the step that strips the comments was thrown in the trash (/dev/null, in programmer speak). I asked for it to go to the log.
The reason is simple. This whole bug was an invisible difference between what was saved and what was looked up. An automatic step that changes files and hides what it did is exactly where the next failure will hide, and then, instead of reading one line in a log, the team guesses.
For the same reason, after the fix went in, one of the engineers noticed that the automatic check did not run when only the comment-stripping step changed, and she added it. Whatever prepares the contract is part of the contract, and it has to pass the same check.
The Question After the Fix
When the explanation arrived, I asked: "Why didn't we see it up until now in our previous integrations?".
I think this is the most important question after any failure, more important than the fix. A bug that waited for the right conditions means that until that day, things worked partly because those conditions simply never showed up. The answer shows you where your confidence rests on luck.
If you are a founder, you don't need to understand formats to ask the right questions. Ask your team which agreements exist between the teams, what checks them automatically, what the check compares against, and who is responsible for the places in between.
Takeaways
- Give the agreements between teams an automatic guard. A rule that relies on people's memory will break the first time someone is in a hurry.
- Make sure your checks compare against what already works. A green screen that can never turn red gives false confidence.
- Put someone in charge of the seams. Every team guards its own code, and the most expensive bugs live between teams.
- After every failure, ask why you didn't see it earlier. The answer shows you where you were working on luck.
A comment in the code is written for people. The bug started the moment a machine began to read it.