Module 2 · Lesson 4 of 4
Add it after it breaks twice
- What happenedStacks grow by adding pieces for requirements that have not arrived, and each piece taxes every later change.
- Why it changedAn abstraction added before the problem exists is shaped by a guess, so it fits the real problem only by luck.
- How it is measuredThis lesson is argument, not measurement, and says so; the measurable version is time to land a similar change before and after a piece went in.
- How to improve itWrite a decision record where every piece is either in use for a present reason or deferred with a named, observable trigger.
Use it now, or name the trigger
Try it. For each component, choose "use now" or "defer" and write the reason or the trigger. Copy the finished table into your hands-on test.
Where this data comes from
Read from the book's saved record. Nothing here is simulated.
chapters/chapter-02-picking-your-stack.md "The concept" and "The tradeoff"
What happened
Most stacks are not chosen. They accumulate. A graph library goes in because the feature might branch later. A vector store goes in because retrieval is surely coming. Each piece works on the day it is added.
The cost shows up afterwards, on every change that has to pass through a layer built for a requirement that never arrived.
Why it changed
An abstraction is a bet about the shape of a problem. Made before the problem exists, the bet is a guess. Made after the same thing has gone wrong twice, it is fitted to evidence.
Once is an incident. Twice is a pattern. The rule this module takes from the chapter is to start with the provider's SDK and the smallest shape that could work, and to add a piece only after something specific has broken two times.
The honest cost of that rule is rewriting. You will turn a single call into a chain, or a chain into an agent, and touch code that worked. That is a contained change. Carrying a layer you did not need is a tax on every change.
How it is measured
Be clear about what kind of claim this is. Lessons 2 and 3 rest on a run file. This lesson rests on the author's experience on his own projects, and the chapter flags it as unmeasured. No benchmark stands behind "a framework you did not need slows you down".
If you want to measure it on your team, the chapter suggests how: compare the time it takes to land a change of similar size before and after the piece went in. Until you have that, treat this lesson as a default to argue with, not a finding.
Knowing which of your beliefs are measured and which are argued is itself the skill.
How to improve it
Write a stack decision record. One row per piece you considered:
| Component | Decision | Reason or trigger |
|---|---|---|
| Something you use | use | The present requirement that needs it |
| Something you skip | defer | What would have to break twice before you add it |
A good trigger is observable and specific: "the second time a request needs a step whose order depends on the input". A bad one is "if it gets complex".
The rule cuts both ways. Do not defer what you need now: an agent without a step cap or a trace is not minimal, it is unfinished. The chapter's section on when not to follow this advice covers that side.
Read the full argument in Chapter 2 of the book, "The tradeoff", then take the hands-on test.
Every number in this lesson, and the file it came from (0)
| Value | File in the book's record | Conditions |
|---|
Reference: Chapter 2, "The tradeoff" and "When NOT to use this".