Skip to content

Content Slides in Viewer

Risk, Readiness and Knowing When You Need Help

Chapter 18, the capstone of Good Enough Engineering

"Gate or wall?"

Sawyer the Beaver asks it of every part of your app.


A parent checks the car the night before a long drive

  • She presses each tire and makes sure the spare has air.
  • She asks how likely each problem is, how bad it would be, and whether she'd see it coming.
  • She plans the worst hour ahead: the jack where she can find it in the dark.
  • She takes grinding brakes to a mechanic instead of fixing them herself.

This chapter does that walk-around for an app built with an AI agent. You'll rank what could go wrong, plan for the bad hour, check that the app is ready, and learn when to bring in an engineer.


A failure mode is named by what the member sees

A failure mode is one specific way a part can fail, named by what goes wrong rather than what causes it.

Part Failure mode
Scoring A vendor error is read as "no matches found"
Access to scans A member opens another member's scan by changing a link
Secrets A live API key is committed and someone else uses it
Cost Retries run all night and the AI bill climbs

FMEA rates each failure mode three ways

Failure mode and effects analysis (FMEA) rates each failure mode from 1 to 10 on three questions.

  • Severity: how much harm does it do?
  • Occurrence: how often is it likely to happen?
  • Detection: how likely is it to slip past you to a member?

A high detection number is bad. It means the failure is hidden. Detection asks whether you'd notice, not how fast you could fix it.


Multiply the three ratings to rank the work

The risk priority number (RPN) is severity × occurrence × detection, from 1 to 1,000.

Failure mode S O D RPN
Vendor error read as "no matches found" 10 5 9 450
Member opens another member's scan 10 2 8 160
Live API key committed to the repository 8 3 6 144
Vendor down; check shows "not checked" 3 5 2 30

The ratings are illustrative. The top row matches the app's own failure analysis.


The same outage drops from 450 to 30 when the app fails safely

  • Both rows describe the same vendor and the same outage.
  • The vendor fails just as often, so occurrence stays at 5.
  • A visible "not checked" gap does less harm, so severity falls from 10 to 3.
  • The member can see the gap, so detection falls from 9 to 2.

The vendor is the same. Only the app's code changed.


Any severity of 9 or 10 gets a fix, whatever its RPN

  • A home address on a report is rare, so its RPN (120) ranks below a leaked key (144).
  • Its severity is still a 10.
  • Multiplying can hide a rare, terrible failure behind a common one.
  • Use the RPN to set the order of work. Use severity to decide what can't wait.

Every fix lowers one of the three ratings

  • Lowers occurrence: a pre-commit hook that blocks a key, or a server-side ownership check with a test.
  • Lowers detection: an alert when a vendor's error rate jumps, or a heartbeat on a scheduled job.
  • Lowers severity: scoring a failed check as "not checked," or a daily spend cap.

You can't stop a vendor from going down, but you can find out in minutes. Detection fixes are often the cheapest.


Practice: the FMEA Worksheet

The chapter's FMEA Worksheet MicroSim gives you seven fixes, one at a time.

  • For each fix, you pick the rating it lowers: severity, occurrence or detection.
  • A correct pick changes the rating, and the worksheet re-sorts by RPN.
  • By the end, the vendor error that started at 450 has fallen into a tie for one of the lowest spots.

The takeaway: how often, how bad and how hidden are three different things to fix.


Write an incident note after every incident

An incident is an event where the app fails its members or its builder and someone needs to act now. An incident note is half a page written while it's fresh.

  • What happened, and who was affected
  • How we found out
  • What we did
  • Root cause
  • What changes, so it doesn't happen again

A blameless review ends with a check, not a promise

  • A blameless review asks "what let this through?" and never "who did this?"
  • "Be more careful" has never stopped a mistake.
  • "Add a pre-commit hook that blocks keys" works for the builder, the agent and whoever is hired next year.
  • An agent starts each session without remembering the last one. A hook or a test is still there next time.

A runbook is a plan written on a calm afternoon

A runbook is a short, step-by-step plan for one type of incident, ready before it happens.

  • It names its trigger in the first line.
  • It puts the step that stops the harm first.
  • It is specific: the exact command, the exact link.
  • It ends with the incident note.
  • It has been walked through once on a quiet day.

Keep a copy somewhere the outage can't reach.


Leaked key: rotate the key at the vendor first

  1. Revoke the old key and create a new one at the vendor.
  2. Put the new key in the secret store, redeploy and run the smoke test.
  3. Check the vendor's usage from exposure to revocation.
  4. Close the path it leaked through, such as with a secret scanner.
  5. Ask whether member data was reachable with that key.
  6. Write the incident note.

Deleting the file doesn't un-leak a key someone has already copied.


Vendor outage: confirm the app is failing safely

  1. Confirm it's the vendor: status page and one direct test call.
  2. Run a scan. The affected check must say "not checked."
  3. Tell members with a short banner.
  4. Watch retries and cost.
  5. When the vendor recovers, offer reruns to members whose scans had a gap.
  6. Write the incident note.

If the check reads as clean, it's a severity-10 failure in your app. Turn the check off or pause scans.


Bad deploy: restore first, diagnose later

  1. If a must-be-right part is broken, roll back now.
  2. Check the database. A rollback restores code, not data.
  3. Find scans that didn't finish, and rerun or refund them.
  4. Run the smoke test on the rolled-back app.
  5. Find the cause on a branch and add a test that would have caught it.
  6. Write the incident note.

Practice: the Runbook Drill

The Runbook Drill MicroSim walks through three incidents: a leaked key, a vendor outage and a bad deploy.

  • At each of nine decision points, you choose the next step from three options.
  • Each wrong option is a move people often make under pressure, such as fixing a bad deploy in production.
  • At the end, you see all three runbooks with your correct picks marked.

A readiness checklist names checks, not feelings

A readiness checklist is a short list of checks an app must pass before people depend on it. "Payments work" is a feeling. "A test sends a fake Stripe webhook and the account is credited once" is a check.

Check Chapter
A test proves a member can't open another member's data 7, 10
A test with every vendor down gets 50 and all "not checked" 9, 10
The database backup has been restored once as a test 11
The three runbooks exist and one has been walked through 18

An app is ready for real users when four things are true

  • Every must-be-right part is protected by a test or rule.
  • A failure in any of them would reach the builder within an hour.
  • Every one-way door has a way back.
  • What the app tells members about their data is true.

Ready doesn't mean finished. A cramped results page doesn't block launch. An untested payment webhook does.


Sort each open item: blocks launch, or can follow

An item blocks launch when it leaves a must-be-right part unprotected, or it's the only way to notice or undo a failure in one.

Open item Verdict
A live API key in the repository is still valid Blocks launch
The payment webhook has no test Blocks launch
The README lists the wrong ports Can follow
There is no staging environment Can follow, with a date

Most apps built fast fail a few items the first time. Each is usually a day's work.


Practice: the Readiness Verdict

The Readiness Verdict MicroSim hands you twelve open items from the dating-safety app.

  • You sort each one into "blocks launch" or "can follow in the first month."
  • Then you give the verdict: ready, or not ready yet.
  • Five items block launch, so the verdict is "not ready yet," and none of the five is large.
  • The fix order starts with the live key, because it's a leak in progress.

An app outgrows good enough when the stakes rise

An app has outgrown good enough when its mistakes cost more than the builder's habits can protect. It usually happens because the app succeeded.

  • Members or money have grown tenfold since the bars were set.
  • The app now holds data with legal duties, such as health or payment data.
  • The same incident has happened three times.
  • A second person, or a second agent setup, now changes the code.

Bring in an engineer for the brakes

When to hire an engineer depends on what you need:

  • A one-time review before launch, payments or a partnership
  • Part-time help for an app that is growing
  • A full-time hire for an app that has outgrown good enough on several signs

Whatever the app's size, get help before you change payments or sign-in, or store a new kind of sensitive data. Get it after any incident that may have exposed member data.


A specific review request gets specific answers

An engineer review request names the parts to review and asks a question about each.

  • "Can you look at my app?" gets a general opinion.
  • "Is there any path where a vendor failure reads as a clean result?" gets an answer.
  • Attach the must-be-right list, the FMEA, the readiness check and the debt register.

The engineer spends the time on judgment instead of finding out what the app does.


A handover note is one page about risk

A handover note lets an engineer who has never seen the app pick it up.

  • What the app does, in two or three sentences
  • How to run it
  • The must-be-right parts and the test that protects each
  • The top five risks from the FMEA
  • Where things live, never the secret values
  • Links to runbooks, incidents and the readiness check
  • Open questions

The capstone runs a good-enough review on your own app

A good-enough review takes nine steps, one per session, with a commit after each.

  • Steps 1 to 3: map the app, mark the must-be-right parts, run the FMEA.
  • Steps 4 and 5: fix the top five risks, each with a check, and make the checks required in CI.
  • Steps 6 to 9: write the runbooks, run the readiness check, check for outgrowth, write the handover note.

The agent gathers and drafts. You decide what's must-be-right, how severe a failure is, and what blocks launch.


The homeowner from Chapter 1 called a contractor for the wall

  • She braced a sagging gate in twenty minutes.
  • She called a contractor before touching a load-bearing wall.
  • She didn't call because she couldn't hold a hammer. The wall held up the floor above.

You don't need to become an engineer to build with AI. You need to know which parts of your app are gates and which are walls.


Next: take the review back to your own app

There's no next chapter. The next step is your app.

  • Run the capstone review, starting with docs/review-plan.md.
  • Run it again before launch, every few months, and whenever a sign of outgrowing good enough shows up.
  • Each pass updates the FMEA, the readiness check and the handover note instead of starting over.

You did the walk-around

You can now rank what could go wrong, write the plan for the bad hour, judge whether an app is ready, and tell when a part needs an engineer.

That's every chapter of this book working together on your own app.

"Gate or wall?" Good enough for now, and you know why.