Skip to content

Good Enough as an Engineering Idea

Summary

Introduces satisficing, trade-offs, one-way and two-way doors and risk, so the reader can decide which parts of an app must be right and which only need to be good enough for now.

Concepts Covered

This chapter covers the following 24 concepts from the learning graph:

Concept Concept Impact Score
Software Engineering 2008
Good Enough Engineering 34
Satisficing 18
Aspiration Level 16
Cost of Perfection 1
Engineering Heuristic 352
Engineering Judgment 334
Trade-Off 256
One-Way Door Decision 30
Two-Way Door Decision 26
Reversibility 18
Good-Enough-for-Now Parts 5
Risk 160
Likelihood 5
Impact 16
Blast Radius 11
Must-Be-Right Parts 10
Stable Subassembly 13
Delay Commitment 17
Freeze the Design 2
Set-Based Design 14
Theory of Constraints 2
Fast Feedback Loop 12
Expertise from Feedback 11

Prerequisites

This chapter assumes only the prerequisites listed in the course description.


A Fence and a Wall

A homeowner walks out to her back yard on a Saturday morning. The gate has been sagging for a month, and today it finally drags in the dirt. She finds a scrap of two-by-four in the garage, screws a brace across the corner, and rehangs the gate. It takes twenty minutes. The brace doesn't match the paint, and one screw went in crooked. The gate swings and latches, and she goes inside to make lunch.

That afternoon she starts on a bigger plan. She wants to open up the kitchen by taking out the wall between it and the dining room. Before she picks up a hammer, she calls a contractor. He taps the wall, goes down to the basement, and looks at the joists. "This one's load-bearing," he says. Now the job changes. There will be a permit, a beam sized by someone who does that for a living, and temporary posts to hold up the floor above while the wall comes out. It will take weeks and a good deal of money.

Meet Sawyer

Sawyer waving welcome Hi, I'm Sawyer, a practical beaver. I build dams, so I know that some parts of a dam can be rough, while others hold back the whole river. This chapter shows you how to tell those parts apart in your own app, and I'll keep asking one question: gate or wall? You'll see me in six roles:

  1. Welcome: I open a chapter by telling you why it matters to your app.
  2. Thinking: I point out an idea worth stopping on.
  3. Tip: I hand you a shortcut you can use today.
  4. Warning: I name a common mistake and how to fix it.
  5. Encouraging: I tell you when a part is hard and worth pushing through.
  6. Celebration: I close a chapter by naming what you can now do.

If I'm not doing one of those six things, I'm not in the chapter.

Nobody would call the gate job sloppy, and nobody would call the wall job fussy. The same person, on the same day, set two very different bars for care. She set them by asking two questions without saying them out loud. What happens if I get this wrong? And can I fix it easily if I do? A crooked gate brace costs her nothing but a second trip to the garage. A wall taken out the wrong way can bring the ceiling down.

This book is about asking those two questions of the app you built with an AI agent. Some parts of your app are gates. Some are load-bearing walls. Your job is to tell them apart and spend your care where it counts.

Building Got Cheap, and the Hard Part Moved

Software engineering is the practice of building software that keeps working, stays safe, and can still be changed after it ships. Writing code is one part of it. The rest is everything around the code: deciding what to build, checking that it does what you meant, keeping secrets out of reach, watching it run, and changing it next month without breaking last month's work.

For most of the history of software, writing the code was the slow and expensive part. A small app took a team weeks or months, and the engineering habits grew up alongside that slow work. AI coding agents changed it. A builder who knows a field well can describe an app in plain words, and an agent such as Claude Code, Cursor or Replit writes it in an afternoon. Producing code now costs close to nothing. Knowing whether that code is safe costs as much as it ever did.

Eli Goldratt, a physicist who turned to factory management, explained why this matters. His theory of constraints says that any system that produces something has one step that limits how much it can produce, called the constraint. Speeding up any other step doesn't help. If a bakery can mix dough for a thousand loaves an hour but its oven bakes only two hundred, a faster mixer just makes a pile of dough. Goldratt laid this out in The Goal (1984), a novel about a struggling factory.

Writing code used to be the constraint in software. AI removed it, and the constraint moved to the next step: judging whether what got built is safe, correct and ready for people to use. Asking the agent to write code faster is now like buying a faster mixer.

Here is the work of shipping an app, sorted by how much AI changed its cost.

Task Before AI agents With AI agents
Writing a new screen or route Days Minutes
Wiring up an outside service Days An hour
Writing tests, once you ask for them Days Minutes
Deciding which parts must not fail Hours of thought Still hours of thought
Noticing a secret pushed to GitHub Needs a habit or a tool Still needs a habit or a tool
Knowing that a check quietly stopped running Needs monitoring Still needs monitoring
Deciding when the app is ready for real users Judgment Still judgment

AI made the top three rows cheap. The bottom four didn't move, and they are the subject of this book. Professional engineers learned those lessons over decades, mostly from outages and breaches. Builders who code with AI meet the same problems in weeks, because they reach the bottom of the table much sooner.

Tell your agent

"Before you write any more features, list every part of this app that a user depends on to stay safe: sign-in, payments, stored personal data, anything that sends messages. For each one, tell me in one sentence what happens to a user if it breaks. Don't change any code yet."

The Running Example: A Dating-Safety App

This book follows one app from start to finish. It is a dating-safety app, built by a person who knows the world of online dating scams well and who built the app with AI agents and no engineering training.

Here is what it does. A member is talking to someone they met online and wants to know whether that person is who they say they are. The member uploads photos, voice clips and text from the conversation. The app runs about eight checks in parallel. One checks whether the photos appear elsewhere on the web under another name. Another asks an AI model to look for the patterns scammers use in messages. Others search public records and phone data through outside services. When the checks finish, the app returns a trust score from 0 to 100 and a results page that explains what each check found.

Under the hood it is an ordinary modern web app. It has a React front end built with Vite, an Express server, and a Postgres database reached through a library called Drizzle. Photos go in private storage, and Stripe handles payments. Small pieces of code called adapters talk to the AI models, image search, people search and text-message vendors. Chapters 2 and 3 explain each of these names. For now you only need to know that the app has users, those users trust it with private and painful material, and paid outside services sit behind every check.

The agent got a lot right. Photos sit in private storage, reached only through links that expire. Members can reach only their own scans. Text pulled from web pages is fenced off and handed to the AI as untrusted data, so instructions a scammer hides in a profile are treated as text to examine, not orders to follow. Later chapters also cover gaps that were found after launch, and the cheap habits that would have caught them. Those gaps say nothing about the builder. Any app built this fast will have gaps like them, and they are the reason this book exists.

Must-Be-Right Parts

Some parts of the dating-safety app are load-bearing walls. Must-be-right parts are the parts of an app where a mistake hurts a user, exposes private data, loses money, or can't be undone. They have to be done carefully the first time, and they need a test or a rule that keeps them that way. Three examples from the dating-safety app show what they look like.

  • Sign-in. If a person can skip sign-in, or reach another member's scans by changing a number in a link, the app has handed one member's private photos to a stranger. Nothing on the results page makes up for that.
  • No false all-clear. Every check has three possible results: passed, failed, and not checked. When a vendor is down or times out, the check is "not checked," and the app must never count it as passed. If all eight checks fail to run, the score is a neutral 50, never a reassuring 100. A member who reads "all clear" when nothing was checked might meet a scammer in person. The app's own failure analysis ranked this the worst thing it could do.
  • Never reveal a location. The app never returns a person's home address, workplace or location, even when an outside service has that data. Without this rule a safety app becomes a stalking tool. The rule lives in the data model and the output, and it needs a test to keep it there.

Each of these has the two marks of the load-bearing wall. Getting it wrong hurts someone, and once it has happened, you can't take it back.

Good-Enough-for-Now Parts

Most of the app is gates. Good-enough-for-now parts are the parts where a mistake is cheap to notice and cheap to fix, so they only need to work today and be easy to change tomorrow.

The look of the results page is the clearest example. Maybe the score sits in a plain circle when a gauge would be nicer, or the page looks cramped on a small phone. None of that hurts a member, exposes data or costs money, and each fix takes a few minutes and ships the same day. Spending a week polishing the results page before launch would be spending care on a gate while a wall waits.

There is one catch. The results page is good enough for now only as long as it shows the "not checked" state truthfully. How the page looks is a gate. Whether it tells the truth about which checks ran is a wall. One screen can hold both kinds of part, and part of the skill is seeing the line between them.

Gate or wall?

Sawyer thinking Try it on the main screen of your own app. Most of it is probably a gate. Look for the small piece that has to tell the truth, the way the "not checked" label does here.

Satisficing: Stop When It Meets the Bar

In 1956 the economist and computer scientist Herbert Simon gave a name to what the homeowner did with the gate. He called it satisficing, a word he made from "satisfy" and "suffice." To satisfice is to search for a solution until you find one that meets your bar, then stop. The other approach, which Simon called optimizing, keeps searching for the best possible answer.

Simon's point was that people and organizations almost never optimize. Finding the best answer means knowing every option and every outcome, and nobody has that much time or information. So people set a bar and take the first option that clears it. Simon saw this as the only workable way to decide in a world too large to search, and it was part of the work that won him the Nobel Prize in economics in 1978.

Simon gave the bar its own name too. An aspiration level is the standard a solution has to meet before you accept it. Aspiration levels move. When good options are easy to find, people raise the bar, and when they are hard to find, people lower it. A homeowner who finds a matching board in the garage will use it. If she doesn't, the scrap of two-by-four clears the bar.

For an app, the useful move is to set a different aspiration level for each part. Here is how that looks for three parts of the dating-safety app.

Part Aspiration level Done when
Sign-in and access to scans No member can ever reach another member's data A test tries to reach another member's scan and gets nothing back
Scoring when checks fail A check that didn't run is never counted as passed A test with every vendor down gets a score of 50 and eight "not checked" labels
Look of the results page A member can read the score and each check's result on a phone The page loads on a phone and nothing overlaps

The bar for the results page is low and the bars for the first two rows are high, and every bar comes with a way to tell whether it has been met. If you can't check a bar, you won't know when you've cleared it.

The Cost of Perfection

Why not set every bar high? Because care costs time. The cost of perfection is the price you pay for raising a part above the bar it needs: the hours spent, the launch delayed, and the more important work left undone while you polished. A builder with a week before launch who spends three days perfecting the results page has three fewer days for the scoring rule. The cost is easy to miss, because the page really does get better. The loss shows up in the part that didn't get the time.

Good Enough Engineering

Put satisficing together with the fence and the wall, and you have the idea this book is named for. Good enough engineering is the practice of setting a different bar for each part of an app, according to what a mistake there would cost, and stopping when each part meets its bar. Must-be-right parts get a high bar and a test that holds it there. Good-enough-for-now parts get a low bar and the freedom to change.

Good enough engineering is not the same as cutting corners. Cutting corners lowers every bar to save time. Good enough engineering lowers some bars on purpose so it can raise others. The homeowner who braced the gate in twenty minutes had the whole afternoon free to deal with the wall properly.

Tell your agent

"List the must-be-right parts of this app: anything where a bug could hurt a user, leak private data, lose money or can't be undone. For each one, write a one-line bar it has to meet and the test that would prove it meets the bar. Then show me which of those tests exist today and which are missing. Don't write or change any code yet."

Trade-Offs

Every choice about care is a trade. A trade-off is a choice where getting more of one thing means accepting less of another. Three kinds come up again and again in an app built with AI.

  1. Time against care. Every hour spent on one part is an hour not spent on another. This is the trade the cost of perfection describes.
  2. Cost against coverage. Each outside check costs money per call. More checks catch more scams and raise the bill. Chapter 13 covers this.
  3. Speed against certainty. Waiting for every check gives the member a complete answer. Returning early gives a faster one.

A trade-off is easier to make well when you write both sides down. If nobody writes them down, the trade still gets made, but nobody chose it.

A Worked Trade-Off: The Slow Vendor

Here is a trade an app like this has to make. These timings are illustrative. One of the eight checks calls a people-search vendor. Most of the time it answers in two seconds. Sometimes it takes forty. While it waits, the member stares at a spinner.

There are three ways to handle it, and each one buys something and gives something up.

Option What you get What you give up
Wait as long as the vendor takes Every check finishes when the vendor is healthy Members sometimes wait 40 seconds, and some leave
Stop waiting after 10 seconds and score the check as passed Fast results every time A slow vendor reads as a clean result. This breaks the no-false-all-clear rule
Stop waiting after 10 seconds and mark the check "not checked" Fast results, and the score stays truthful The member sometimes sees a score with a gap in it, and the score is less complete

The second option is the trap. It is the fastest and it looks fine on screen, and it quietly turns a vendor problem into a false reassurance. There the trade is between speed and a must-be-right rule, and the rule wins. Between the first and third options, the trade is speed against completeness, a judgment call the builder can make either way and change later. The third option is the usual pick: a time limit, a "not checked" label, and a note that invites the member to run the scan again.

An empty list is not a clean result

Sawyer warning Watch out for an agent that handles a failed call by returning an empty list. The code looks tidy and the page looks fine, but an empty list reads as "no matches found." When you ask for error handling, also ask what the member sees when the call fails.

This decision had two parts. One part touched a wall, and the answer there was fixed. The other part touched a gate, and the answer could be whatever suited members this month. Most trade-offs in an app split this way once you look closely. Try a few yourself in the diagram below.

Diagram: The Trade-Off Card Game

Run the Trade-Off Card Game MicroSim Fullscreen

The Trade-Off Card Game

Type: microsim sim-id: trade-off-card-game
Library: p5.js
Status: Specified
Bloom Level: Analyze
Bloom Verb: differentiate
Learning Objective: The learner will differentiate, for each of six trade-off decisions in the dating-safety app, the option that breaks a must-be-right rule from the options that are acceptable judgment calls.

Prerequisites: trade-off, must-be-right parts, good-enough-for-now parts, no false all-clear, "not checked" result (all defined in the sections above).

Evidence of Mastery: For each of six decision cards, the learner marks every option as either "breaks a must-be-right rule" or "acceptable judgment call." A card is correct when every option on it is marked as in the answer column. Mastery is 5 of 6 cards correct on the first attempt. Reading the "what you get / what you give up" text is exploration, not evidence.

Misconceptions: (1) The fastest option is always the riskiest. (2) Any option that makes results less complete is unsafe. (3) If an option looks fine on screen, it is safe.

Instructional Rationale: Analyze-level differentiation needs the learner to separate parts of a decision that look alike. Each card holds options that all sound reasonable, so the learner must test each one against the must-be-right rules rather than pick by speed or polish.

Content:

Each card shows a decision, then its options. Each option shows "What you get" and "What you give up."

Card Decision Option What you get What you give up Correct mark Why (feedback)
1 A people-search vendor sometimes takes 40 seconds A. Wait as long as it takes Every check finishes when the vendor is healthy Some members wait 40 seconds Acceptable Slow but truthful. This is a speed trade, not a safety one.
1 B. Stop after 10 seconds and score the check as passed Fast results A slow vendor reads as clean Breaks a rule A check that didn't run is counted as passed: a false all-clear.
1 C. Stop after 10 seconds and mark it "not checked" Fast and truthful The score has a gap Acceptable The gap is shown, so the member isn't misled.
2 The results page looks cramped on small phones A. Ship now and fix the layout next week Launch on time A cramped page for a week Acceptable Layout is a good-enough-for-now part.
2 B. Hold the launch until the layout is perfect A polished page A week of delay Acceptable Allowed, but it spends care on a gate. Nothing breaks.
3 An image-search vendor returns an error A. Treat the error as "no matches found" Simpler code An error reads as a clean photo Breaks a rule A failed search read as "no results" is a false all-clear.
3 B. Mark the photo check "not checked" Truthful results A less complete score Acceptable Failures are shown as gaps, never as passes.
4 A people-search vendor returns a match's home address A. Show the address so the member can verify it A more detailed report The app now reveals a location Breaks a rule The app must never return an address, workplace or location.
4 B. Drop the address and keep only whether a record matched A safe report Less detail Acceptable The no-locate rule is kept.
5 Signing in with a magic link is faster to build than passwords A. Use the magic link, checked on the server Faster to build Depends on email delivery Acceptable Either sign-in method is fine if the server checks it.
5 B. Hide the scans page in the browser when the member is signed out, with no server check Fastest to build Anyone who calls the server directly gets the data Breaks a rule Access must be checked on the server, not only in the browser.
6 Each AI model call costs money A. Use a cheaper model for the message check Lower bill Somewhat weaker pattern spotting Acceptable A cost trade the builder can change later.
6 B. Skip the message check when the daily budget runs out and score it as passed Lower bill Skipped checks read as clean Breaks a rule A skipped check must show as "not checked."

Provenance: Cards 1, 3 and 4 rest on the dating-safety app's product rules in research/seed-notes.md (no false all-clear; a failed search read as "no results"; no-locate). Card 1's timings (2 seconds, 40 seconds, 10-second timeout) are illustrative, from the section "A Worked Trade-Off: The Slow Vendor." Cards 1, 2, 5 and 6 are illustrative and must be labeled "illustrative scenario."

Rules: An option is "Breaks a rule" when it causes any of: a check that didn't run counted as passed; a location revealed; access checked only in the browser. Every other option is "Acceptable." A card is correct only when all of its options are marked correctly.

Learner Activity:

  1. The learner sees card 1, with all its options face up and each option unmarked.
  2. The learner marks each option "Breaks a rule" or "Acceptable." Changing a mark before checking is allowed.
  3. The learner presses Check. Each option shows a correct or incorrect sign and its "Why" text.
  4. The learner moves to the next card. Cards come in the fixed order 1 to 6.
  5. After card 6, a summary lists which cards were correct and repeats the three rules from Rules.

Feedback: Six cards, fixed order, one attempt each; a checked card can't be re-answered. Correct option: "Right. " followed by its Why text. Incorrect option: "Not quite. " followed by its Why text. The correct marks are revealed on Check. A running count "Cards correct: n of 6" is shown.

Starting State: Card 1 is shown with three unmarked options. The prompt reads "Which of these options breaks a must-be-right rule?"

Chapter Anchors: The vendor answers in 2 seconds most of the time and sometimes takes 40. The timeout is 10 seconds. There are three options in the worked example, and the second is the trap. Eight checks run in parallel.

Tell your agent

"Find every place where this app calls an outside service. For each one, tell me what the app does when the call fails or times out. Flag any place where a failure could show up to the member as a passing or clean result."

One-Way Doors and Two-Way Doors

Some trade-offs are easy to undo and some are not. In his 2015 letter to Amazon shareholders, Jeff Bezos described the difference with doors. Some decisions, he wrote, are like a door you can walk back through. If you don't like what's on the other side, you return. Others are like a door that locks behind you.

A two-way door decision is a choice you can reverse cheaply if it turns out wrong. Moving the score on the results page, renaming a button, switching the AI model the message check uses, changing the wording of an email: all of these are two-way doors. Make them fast, watch what happens, and change them if you need to.

A one-way door decision is a choice that is costly or impossible to reverse. Sending a member's photo to a vendor that keeps it, deleting a database table without a backup, publishing a secret key, telling a member a match is safe: once these happen, they can't be taken back. One-way doors deserve slow thought, a second opinion, and a check before you walk through.

The property that separates the two is reversibility: how cheaply and completely a decision can be undone after you've made it. It is rarely all or nothing. A change to the database can be reversed if you took a backup first, and it can't be if you didn't. Much of engineering, as later chapters show, is the work of turning one-way doors into two-way doors. A backup makes a database change reversible. Saving each version of the code (Chapter 5) makes a code change reversible. A practice copy of the app (Chapter 14) lets you walk through a door and back before any user sees it.

A quick door test

Sawyer giving a tip Before a change, ask yourself what you would do to put it back if it went wrong tonight. If the answer is "undo the commit" or "restore the backup," it's a two-way door. If you have no answer, treat it as one-way.

Here are some decisions from the dating-safety app, sorted by which kind of door they are.

Decision Door What would make it more reversible
Changing the color of the trust score Two-way Nothing needed
Deleting a column of data from the database One-way A tested backup taken first (Chapter 11)
Committing a live API key to a public code repository One-way Nothing undoes the leak. You can only replace the key with a new one (Chapter 6)
Sending scan photos to a new vendor One-way Read the vendor's retention terms before the first call
Changing how the score is calculated Two-way for future scans, one-way for members who already acted on an old score A test suite that pins down the score for known inputs

The last row shows that one change can be both kinds of door. You can change the code back, but you can't undo a decision a member made from the old score.

Tell your agent

"Before you make any change today, tell me whether it is a one-way door or a two-way door. For anything one-way, such as a database change, a deletion, or sending data to a new service, stop and show me the plan and how we'd undo it before you run anything."

Risk: How Likely, How Bad, How Far

The fence and the wall differ in one more way. A crooked gate brace has a small chance of failing and does little harm if it does. A badly removed wall may well fail, and the harm is large. That combination has a name.

Risk is the chance that something goes wrong, weighed by how much harm it does when it does. It has two parts. Likelihood is how probable it is that a failure happens in a given stretch of time. Impact is how much harm a failure does when it happens: to a user, to their data, to your money, to trust in the app. A failure that is likely but harmless is a low risk. A failure that is rare but would hurt someone badly is a high risk. Rare failures with large impact are the easiest to skip, because they haven't happened yet.

A third measure helps when you compare failures. Blast radius is how much of the system, and how many users, one failure reaches. A bug on the results page reaches one member at a time. A bug in sign-in reaches every member at once. A leaked database password reaches everything the database holds.

A Worked Risk Comparison

Here are four things that could go wrong in the dating-safety app, rated on a simple three-step scale for each measure. These ratings are rough on purpose, because they're for comparing failures, not measuring them.

Failure Likelihood Impact Blast radius Overall
Score circle overlaps text on a small phone High Low One member at a time Low
Image-search vendor down for an hour, failures shown as "not checked" Medium Low Every scan during the hour Low to medium
Image-search vendor down, failures read as "no matches" Medium High Every scan during the outage High
A route lets a signed-in member open another member's scan by changing a number Low High Every member's scans High

Compare rows two and three. They describe the same vendor and the same outage, with the same likelihood. The only difference is how the code handles the failure, and that moves the risk from low to high. The no-false-all-clear rule doesn't stop vendors from failing. It keeps the impact of their failure small.

Now compare rows one and four. The overlapping score circle is the most likely failure on the list and the least risky. The access bug is the least likely and the most risky. Fixing whatever users complain about first would fix row one and leave row four, because nobody complains about a bug they don't know is there. You can rate failures yourself in the diagram below.

Diagram: Risk Placement Grid

Run the Risk Placement Grid MicroSim Fullscreen

Risk Placement Grid

Type: microsim sim-id: risk-placement-grid
Library: p5.js
Status: Specified
Bloom Level: Evaluate
Bloom Verb: prioritize
Learning Objective: The learner will prioritize eight failures of the dating-safety app by rating each one's likelihood, impact and blast radius and ranking the three that should be fixed first.

Prerequisites: risk, likelihood, impact, blast radius, must-be-right parts (all defined in the section "Risk: How Likely, How Bad, How Far").

Evidence of Mastery: The learner rates each of eight failures on likelihood, impact and blast radius, then commits a top-three list. The top three is correct when it contains failures 4, 6 and 7 in any order. Mastery is all three correct. Individual ratings are scored for feedback but are not the mastery evidence.

Misconceptions: (1) The most likely failure is the most urgent. (2) A failure that hasn't happened yet is low risk. (3) Blast radius doesn't matter if the harm per person is the same.

Instructional Rationale: Prioritizing is an Evaluate skill: the learner must weigh three measures against each other and defend a ranking. Placing each failure on a grid before ranking makes the weighing visible, so the learner can see why a rare failure outranks a common one.

Content:

Each failure is rated Low, Medium or High on likelihood and impact, and One, Some or All on blast radius.

# Failure shown to the learner Expected likelihood Expected impact Expected blast radius Why (feedback)
1 The score circle overlaps text on a small phone High Low One Common and annoying, but nobody is harmed and it's fixed in minutes.
2 The check names on the results page are in an odd order High Low All Every member sees it, but the harm is near zero.
3 The image-search vendor is down for an hour; its check shows "not checked" Medium Low Some The member sees a gap and can rerun the scan. The truthful label keeps the impact low.
4 The image-search vendor is down; failures read as "no matches found" Medium High Some A failure becomes a false all-clear for every scan during the outage.
5 A confirmation email has a typo Medium Low Some Embarrassing and harmless.
6 Changing a number in a link lets one member open another member's scan Low High All Rare until someone tries it, then every member's private photos are exposed.
7 A people-search result includes a match's home address on the report Medium High Some The app reveals a location, which breaks the no-locate rule.
8 The weekly usage report to the builder is a day late Medium Low One Only the builder notices, and nothing is lost.

Expected top three: failures 4, 6 and 7.

Provenance: Failures 3, 4, 6 and 7 come from the section "A Worked Risk Comparison" and the product rules in research/seed-notes.md. Failures 1, 2, 5 and 8 are illustrative and must be labeled "illustrative."

Rules: Score each rating Low or One = 1, Medium or Some = 2, High or All = 3. Overall risk score = likelihood × impact × blast radius, from 1 to 27. Overall band: score >= 12 is High, and so is score >= 9 when impact is High; any other score >= 4 is Medium; score < 4 is Low. The impact rule keeps the rare access bug (Low × High × All = 9) in the High band, as the chapter rates it. A learner's rating matches when it equals the expected rating in Content. When two failures tie on overall score, the one with the higher impact ranks first. With the expected ratings, the scores are: 1 = 3, 2 = 9, 3 = 4, 4 = 12, 5 = 4, 6 = 9, 7 = 12, 8 = 2. Failures 4 and 7 rank first and second. Failures 2 and 6 tie at 9, and failure 6 takes third place on the impact tie-break (High against Low).

Learner Activity:

  1. The learner sees the first failure card and rates its likelihood, impact and blast radius.
  2. When all three are set, the card drops onto a grid with likelihood on one axis and impact on the other. Its blast radius is shown as the size of its marker.
  3. The learner repeats for all eight failures. Ratings can be changed until the learner moves on to ranking.
  4. The learner picks three cards as "fix first" and presses Check.
  5. The sim shows the expected rating for each failure next to the learner's, with the Why text, and marks the top three.

Feedback: Eight failures, fixed order 1 to 8. Ratings can be changed freely before ranking. One attempt at the top three. Correct top three: "Right. Each of these can hurt a member badly, even if it rarely happens." Incorrect: names each wrong pick with its Why text and names the missed failure with its Why text. If the learner picked failure 1 or 2, add: "The most common failure isn't the most urgent one." A count "Ratings matched: n of 24" is shown after Check.

Starting State: An empty grid and failure card 1. The prompt reads "Rate this failure. Which three would you fix first?"

Chapter Anchors: The chapter compares four failures: the overlapping score circle (Low overall), the vendor outage shown as "not checked" (Low to medium), the outage read as "no matches" (High), and the access bug from changing a number (High). Ratings use a three-step scale.

Tell your agent

"List the ten worst things that could go wrong with this app. For each one, rate how likely it is, how badly it would hurt a user, and how many users it would reach, each as low, medium or high. Sort the list so the highest risks are on top, and tell me which ones have no test or alert today."

Heuristics: Rules of Thumb That Can Be Wrong

So far this chapter has given you a handful of rules: set a bar for each part, treat one-way doors with care, fix high-impact failures before likely ones. Where do rules like these come from, and how far can you trust them?

Billy Vaughn Koen, an engineering professor at the University of Texas, spent much of his career on that question. His answer was that engineering runs on heuristics. An engineering heuristic is a rule of thumb that helps you decide what to do when you can't work out the answer for sure. It is useful, and it can be wrong. Koen described the engineering method as using heuristics to make the best change you can in a situation you only partly understand, with the resources you have.

Here are three heuristics that run through this book.

Heuristic What it helps you decide When it can be wrong
Fix the high-impact failure before the likely one What to work on first When the likely failure is cheap to fix and costs users every day
Make one-way doors two-way when you can How to make a risky change safer When the extra machinery costs more than the risk it removes
Build in small, stable pieces How to break up the work When the pieces are so small that joining them becomes the work

Most of the lesson is in the third column. A heuristic is a tool for a kind of situation, and a skilled engineer notices when the situation has changed. That is why two heuristics can contradict each other and both still be useful.

When Heuristics Disagree: Commit Late or Freeze Early

One heuristic is delay commitment: hold off on a decision while making it wrong would cost more than keeping your options open. Here is a hypothetical case. Before an app like the dating-safety app has any users, its builder doesn't need to choose a final people-search vendor. Trying two vendors side by side for a few weeks costs a little extra and shows which one returns cleaner data.

The opposite heuristic is freeze the design: stop changing a part once further changes teach you less than they cost. Now carry the same hypothetical past launch. The scoring rule has been tested, and members have come to understand what a 50 means. Every change to it risks confusing them, so the score's design needs to hold still, and any change goes through a test and a note to members.

Koen's point is that choosing between them is itself a judgment. You delay while options are cheap and you are still learning. You freeze once learning has slowed and change has become expensive. The same part of the app can move from one to the other over a few months.

Set-Based Design

Toyota's car engineers turned "delay commitment" into a method. Researchers who studied Toyota in the 1990s, including Durward Sobek, Allen Ward and Jeffrey Liker, found that its engineers kept several designs alive at once and dropped options only when tests showed they wouldn't work. This is set-based design: explore a set of possible designs in parallel, and narrow the set as evidence comes in, instead of picking one design early and fixing its problems as they appear. It sounds slower, but Toyota often finished faster, because it rarely had to back out of a choice made too early.

AI agents make set-based design cheap for anyone. Asking an agent to build three versions of the results page costs an afternoon. A builder can show them to a few members and keep the one that works. Set-based design suits two-way doors and gates. You don't want three versions of sign-in running for real users. The prompt below uses branches, separate copies of the code that don't touch the live app; Chapter 5 explains them.

Tell your agent

"For the next feature, build two small versions on separate branches, so neither touches the live app until we pick one. Show me your plan for both before you start. When they're done, write me a short comparison: what each one does well, what each one risks, and which parts of each would be hard to change later."

Stable Subassemblies: Hora and Tempus

Herbert Simon told a parable that explains why breaking work into finished pieces matters so much. It appears in his 1962 paper "The Architecture of Complexity."

Two watchmakers, Hora and Tempus, each build fine watches of about a thousand parts. Both are popular, and their phones ring often. Every time a phone rings, the watchmaker has to put down the watch to answer it.

Tempus builds each watch in one long run, part after part. When he puts down a half-built watch to answer the phone, it falls apart, and he has to start again from the first part. Hora builds differently. She puts ten parts together into a small unit that holds on its own. Then she puts ten of those units into a larger one, and ten of those make the watch. When her phone rings, she loses at most the small unit she was working on. Everything she had already finished stays finished.

If each part placed carries a 1-in-100 chance of a phone call, Tempus almost never gets through a thousand parts without an interruption. Working out the expected number of parts each watchmaker places gives about 1,174 for Hora and about 2.3 million for Tempus. Tempus takes roughly two thousand times as long. Simon's own rougher arithmetic in the paper came to about four thousand; either way the gap is enormous. Hora prospers, and Tempus goes out of business.

A stable subassembly is a piece of a larger system that is complete and holds together on its own, so work done on it is kept even when work on the whole is interrupted. Simon used the parable to explain why complex things in nature and in organizations tend to be built from stable parts.

Builders working with AI agents get interrupted constantly. The agent loses track of a long conversation, or goes down a wrong path and has to be stopped. A vendor changes how its service works halfway through a feature. And the builder has a day job. Each of these is Tempus's phone ringing. Hora's defenses work here too:

  • Save working code often, so each save point is a finished unit. Chapter 5 calls these commits.
  • Give the agent one small, complete task at a time instead of one large one.
  • Make each adapter a stable piece with its own tests, so a change to one vendor can't break the other seven checks.
  • Write down the app's rules in a project file, so a fresh session doesn't start from the first part. Chapter 4 covers this.

In the simulation below you can change the interruption rate and the size of the pieces and watch the numbers move.

Diagram: Hora and Tempus Watchmaker Simulator

Run the Hora and Tempus Watchmaker Simulator MicroSim Fullscreen

Hora and Tempus Watchmaker Simulator

Type: microsim sim-id: hora-tempus-watchmakers
Library: p5.js
Status: Specified
Bloom Level: Understand
Bloom Verb: explain
Learning Objective: The learner will explain why building in stable subassemblies shortens the expected time to finish a 1,000-part watch, by predicting and then checking how the gap between Hora and Tempus changes as the interruption chance rises.

Prerequisites: stable subassembly, the Hora and Tempus parable, interruption (all defined in the section "Stable Subassemblies: Hora and Tempus").

Evidence of Mastery: At three interruption settings, the learner predicts whether Tempus's disadvantage will be "small (under 10 times)," "large (10 to 1,000 times)" or "huge (over 1,000 times)" before the sim reveals the ratio. A prediction is correct when it matches the band in the Predictions table. Then the learner picks, from four statements, the one that explains the result. Mastery is 3 of 3 predictions correct and the correct explanation chosen.

Misconceptions: (1) Building in pieces only helps a little, because the total number of parts is the same. (2) The advantage grows in step with the interruption rate. (3) Smaller pieces are always better, no matter how small.

Instructional Rationale: The surprise in the parable is how fast Tempus's disadvantage explodes, which prose can state but not make felt. Predicting before each reveal, then watching both watchmakers work, makes the learner confront the steep growth and explain it.

Content:

Adjustable quantities:

Quantity Min Max Step Default Unit
Chance of interruption per part placed 0.001 0.020 0.001 0.010 probability
Parts in Hora's smallest unit 2 50 1 10 parts

Fixed: the watch has 1,000 parts. Tempus builds in one run of 1,000. Hora's structure is computed from her unit size (see Rules).

Predictions, in this order:

# Interruption chance Hora unit size Expected placements, Tempus Expected placements, Hora Ratio Correct band
1 0.001 10 1,720 1,116 1.5 small (under 10 times)
2 0.005 10 29,857 1,141 26.2 large (10 to 1,000 times)
3 0.010 10 2,316,257 1,174 1,973.7 huge (over 1,000 times)

Explanation choices (correct answer is C):

  • A. Hora works faster than Tempus.
  • B. Hora has fewer parts to place.
  • C. Tempus must place all 1,000 parts with no interruption, and the chance of that falls very fast as the interruption chance rises; Hora only ever needs 10 parts in a row.
  • D. Tempus gets more phone calls than Hora.

Feedback for wrong choices: A: "They place parts at the same speed." B: "Hora places a few more parts in total, because she also joins units." D: "Both get the same chance of a call per part placed."

Provenance: The parable is from Herbert A. Simon, "The Architecture of Complexity," Proceedings of the American Philosophical Society 106(6), 1962. The numbers in the Predictions table are computed from the Rules formula and rounded; they are a model of the parable, not Simon's own figures.

Rules: Let p be the interruption chance and q = 1 − p. The expected number of placements to finish a run of n parts with no interruption, starting over on each interruption, is E(n) = ((1/q)^n − 1) / p. Tempus's expected placements = E(1000). For Hora with unit size k: she builds units of k parts, then joins k units at a time, level by level, until one watch remains. The number of join steps at each level is the ceiling of the number of items at that level divided by k. For k = 10 there are 100 + 10 + 1 = 111 joins of 10 items each, so Hora's expected placements = 111 × E(10). For a general k, Hora's expected placements = the sum over every join of E(size of that join). Ratio = Tempus ÷ Hora, shown to one decimal place. When p is at its minimum of 0.001, the ratio is still shown even though it is small. Hora's unit size of 2 or 50 is allowed so the learner can see that very small units add many joins and very large units bring back Tempus's problem.

Learner Activity:

  1. The sim sets prediction 1's values and asks the learner to choose a band for Tempus's disadvantage.
  2. The learner commits a band. The sim runs both watchmakers side by side with random interruptions at that rate, speeded up, and then shows the expected placements and the ratio from the Rules.
  3. Steps 1 and 2 repeat for predictions 2 and 3.
  4. The learner picks one of the four explanation statements.
  5. Free exploration unlocks: the learner changes the interruption chance and Hora's unit size and sees the expected placements and ratio update at once. The learner should notice that unit sizes far below or far above 10 make Hora slower.

Feedback: Three predictions in fixed order, one attempt each, then one explanation question with one attempt. Correct prediction: "Right: Tempus takes about [ratio] times as long." Incorrect prediction: "Tempus takes about [ratio] times as long. The chance of placing all 1,000 parts with no interruption is q to the power 1,000, and that shrinks very fast." Explanation feedback as listed in Content. Correct answers are revealed after each attempt. A count "Predictions correct: n of 3" is shown.

Starting State: Both workbenches are empty. Prediction 1's settings are shown. The prompt reads "If each part placed has a 1-in-1,000 chance of a phone call, how much longer will Tempus take than Hora?"

Chapter Anchors: A watch has about a thousand parts. Hora builds units of ten. The interruption chance in the chapter is 1 in 100. Hora's expected placements are about 1,174 and Tempus's about 2.3 million, so Tempus takes roughly two thousand times as long.

Tell your agent

"Break the next feature into steps small enough that each one can be finished, tested and committed in one sitting. Show me the list of steps before you start. After each step, run the tests and commit before you start the next one. If a step grows past that size, stop and split it."

Engineering Judgment and Where It Comes From

Every section so far has ended at the same place. Someone has to decide which bar a part needs, which side of a trade wins, which door is one-way, which risk comes first, and which heuristic applies today. Engineering judgment is the ability to make sound decisions about a system when the rules don't settle the answer: choosing which heuristic fits, weighing trade-offs and risks, and knowing when a part is good enough. It is the skill that moved to the front when AI made building cheap.

Judgment is built, and the psychologist Gary Klein spent decades studying how. He watched firefighters, nurses and military commanders make fast, good decisions under pressure, and found that experts recognize patterns. A fire commander walks into a burning house, feels that something is wrong, and orders everyone out seconds before the floor collapses. He has seen enough fires that a quiet, hot room tells him something he hasn't yet put into words.

In a 2009 paper with Daniel Kahneman, Klein laid out when this kind of skill can form at all. Expertise from feedback is the principle that skilled intuition develops only where the situation follows regular patterns and the person gets clear, timely feedback on whether their decisions were right. Firefighters get it: the floor holds or it doesn't. Stock pickers mostly don't, because the market is too noisy to tell them whether they were skilled or lucky.

The tool that makes feedback clear and timely is a fast feedback loop: a setup that tells you whether a change worked within seconds or minutes of making it, instead of days or weeks later. Tests that run on every change, and an error tracker that alerts you the hour something breaks, are fast feedback loops.

How long until you know?

Sawyer thinking Try this on your own app. If the scoring broke this morning, how would you find out, and how long would it take? That gap is how long each lesson takes to reach you.

Without them, an app gives slow and unclear feedback. The scoring bug that reads a vendor failure as "no matches" doesn't announce itself. It might surface weeks later, when a member writes in, or never. A builder can work hard for a year in that setting and gain little judgment, because the app never said which decisions were wrong. Compare two hypothetical versions of the same week.

Day Without fast feedback With fast feedback
Monday The agent changes how vendor errors are handled Same change. A test with every vendor down runs and fails: the score came back 100, not 50
Monday, ten minutes later Nothing happens The builder reads the failing test, asks the agent why, and fixes the handling
Wednesday The image-search vendor has a two-hour outage Same outage. Scans show "not checked" for the photo check
Wednesday Scans during the outage score as clean An alert fires when the vendor's error rate jumps
Three weeks later A member writes in, upset, after meeting a match whose photos belonged to someone else Nothing to report
What the builder learned That something went wrong, weeks late, with no clear cause That error handling in adapters needs a test, and that the test works

The builder in the right-hand column made the same mistake. They got the lesson in ten minutes instead of three weeks, and nobody was hurt. Do that a hundred times and you have engineering judgment. Most of this book's habits, from tests to alerts, are ways of building fast feedback loops.

Tell your agent

"Write a test that runs a scan while every outside service fails. Use stand-ins for the services, and don't call the real ones. The test should pass only if the score is 50 and every check says 'not checked.' Show me your plan before you write it, then run it and show me the result. Tell me how we could make it run every time the code changes, but don't set that up yet."

Putting It Together: Sorting Your App

Every idea in this chapter feeds one task: sorting the parts of an app into must-be-right and good-enough-for-now. Here is the sort, written as questions you can ask about any part.

  1. What happens to a user if this part is wrong? If the answer is harm, exposed private data or lost money, the impact is high.
  2. Can a mistake here be undone? If not, it's a one-way door.
  3. How many users would one failure reach? A wide blast radius raises the stakes.
  4. Would a failure here be noticed quickly? A failure that looks fine on screen needs a test, because no one will report it.

A part that scores high on any of the first three questions is a must-be-right part. A part that scores high on the fourth needs a fast feedback loop whichever list it lands on. Everything else is good enough for now, and you are free to ship it, watch it, and change it.

You can practice this sort on the dating-safety app in the simulation below.

Diagram: Must-Be-Right or Good Enough for Now

Run the Must-Be-Right or Good Enough for Now MicroSim Fullscreen

Must-Be-Right or Good Enough for Now

Type: microsim sim-id: must-be-right-sorter
Library: p5.js
Status: Specified
Bloom Level: Analyze
Bloom Verb: organize
Learning Objective: The learner will organize twelve parts of the dating-safety app into must-be-right and good-enough-for-now, using the four sorting questions, with at least ten of twelve correct.

Prerequisites: must-be-right parts, good-enough-for-now parts, impact, one-way door decision, blast radius, the four sorting questions (all defined in the chapter above).

Evidence of Mastery: The learner places each of twelve part cards into one of two bins and presses Check. A placement is correct when it matches the answer column in Content. Mastery is 10 of 12 correct on the first attempt. Opening a card's sorting-question hints is exploration, not evidence.

Misconceptions: (1) Anything a user sees is must-be-right. (2) Anything behind the scenes is good enough for now. (3) A part that's hard to build must be a must-be-right part.

Instructional Rationale: Sorting forces the learner to apply the same four questions to parts that look alike on the surface, such as the results page layout and the "not checked" label on that same page. Committing a placement before seeing the answer makes the learner organize by consequence rather than by appearance.

Content:

# Part shown to the learner Correct bin Why (feedback)
1 Sign-in and checking that a member can open only their own scans Must-be-right A failure exposes private photos to strangers, reaches every member, and can't be undone.
2 Showing "not checked" when a vendor fails, instead of a pass Must-be-right A failure becomes a false all-clear that could send a member to meet a scammer.
3 Never showing a match's address, workplace or location Must-be-right A failure turns a safety app into a stalking tool, and a revealed location can't be taken back.
4 The color and shape of the trust score on the results page Good enough for now Changing it is a two-way door with no harm done.
5 The order the eight checks are listed in on the results page Good enough for now Cosmetic, cheap to change, and harmless.
6 Charging the member the right amount through Stripe Must-be-right Money mistakes hurt members and trust, and refunds don't undo the harm of a double charge.
7 Wording of the welcome email Good enough for now Easy to change, low impact.
8 Keeping API keys out of the code repository Must-be-right A leaked key can't be un-leaked; it can only be rotated, and it reaches every service the key opens.
9 Which AI model the message check uses Good enough for now A two-way door: swap it, measure, swap it back.
10 Layout of the results page on a small phone Good enough for now Annoying if wrong, fixed in minutes, nobody harmed.
11 Deleting a member's photos when they close their account Must-be-right Keeping private photos after a member asked to leave exposes data they no longer trust you with.
12 The marketing page's headline Good enough for now Change it whenever you like.

Provenance: Parts 1 to 5 are from the sections "Must-Be-Right Parts," "Good-Enough-for-Now Parts" and the product rules in research/seed-notes.md. Parts 6 to 12 are illustrative parts of a typical app with this stack (Stripe, private storage, AI model adapters) and must be labeled "illustrative."

Rules: Each card has exactly one correct bin. A card goes in Must-be-right when a failure would harm a user, expose private data, lose money or be irreversible; otherwise it goes in Good enough for now. Six cards are must-be-right (1, 2, 3, 6, 8, 11) and six are good enough for now (4, 5, 7, 9, 10, 12).

Learner Activity:

  1. The learner sees twelve cards in a shuffled stack and two empty bins.
  2. The learner moves each card into a bin. For any card, the learner can open a hint that lists the four sorting questions. Cards can be moved between bins until Check.
  3. When all twelve are placed, the learner presses Check. Each card shows whether it is in the right bin and its Why text.
  4. The learner should notice that cards 2 and 10 are both about the results page and land in different bins.

Feedback: Twelve cards, shuffled order, one attempt. Correct: "Right. " followed by the Why text. Incorrect: "This one belongs in [correct bin]. " followed by the Why text. If cards 2 and 10 were placed in the same bin, add: "Two parts of the same screen can need very different care." The score "n of 12 correct" is shown after Check, with "Mastery reached" at 10 or more.

Starting State: Two empty bins labeled "Must-be-right" and "Good enough for now," and a stack of twelve cards. The prompt reads "Which parts of this app are load-bearing walls?"

Chapter Anchors: The three must-be-right examples in the chapter are sign-in, no false all-clear and never revealing a location. The chapter's good-enough-for-now example is the look of the results page. There are four sorting questions.

Tell your agent

"Go through every route, every background job and every outside service in this app. For each one, answer the four questions: what happens to a user if it's wrong, can a mistake be undone, how many users would one failure reach, and would we notice quickly. Put the answers in a table in a new file called docs/must-be-right.md, with the must-be-right parts at the top."

Back to the Fence

The homeowner with the sagging gate didn't read a book on satisficing. She knew without thinking that the gate could be rough and the wall could not, because she has lived in houses all her life and has seen what breaks.

Few people have that sense for software yet, because an app doesn't creak before it fails. Until you do, the four sorting questions stand in for it. The rest of the book takes the walls one at a time, starting in Chapter 2 with how the parts of a web app fit together.

Key Takeaways

  • Give each part of your app its own bar, with a test that shows when the part meets it. Spend your care on the must-be-right parts first.
  • Before a change, ask whether it's a one-way door. If it is, slow down and plan how you'd undo it.
  • Rank failures by impact and blast radius, not by how often members complain.
  • Work in small finished pieces, and set up fast feedback loops so each mistake shows up in minutes. That is how engineering judgment grows.

You can sort an app now

Sawyer celebrating You can now look at any part of an app and ask the four questions. That sort decides where every later chapter spends its care. Good enough for now, and you know why.

See Annotated References


Slides for this chapter

If you would prefer the slide-deck view of this chapter, or want to present it in a class or workshop:

Slides Slides in Viewer