← All lessons Lesson 0025 · Software factory 4 of 4

Software factory

The ramp

You have the parts: the test for a real factory (0022), a check the builder cannot see (0023), a repo the builder can read (0024). What is left is the order to build them in and the one decision that actually changes how you work: when to stop reading the diff. The answer is never “now, for everything.” You stop reading one class of change at a time, and only after the check has spent a while agreeing with your eyes.

What this is. A way up Shapiro’s ladder that one developer can afford and a team can govern: four landings, a log that tells you when to step up, a budget cap, and a list of what stays with a person. The shadow log is my synthesis. It applies to code what 0019 taught about calibrating a judge, and it follows how Anthropic’s harness team tuned their evaluator: by reading its logs for places where its verdict differed from the author’s own. Harness design for long-running apps

What this is not. A route to level 5 for everything you ship. Most code never should get there, and most teams should stop at a landing. It is also not a method for a ten-year-old codebase. Every first-hand report I could find started from an empty repository, and I have no high-trust source for the other case. The landings still apply; the effort to reach the first two will be larger and nobody has published by how much.

  1. 1 · ShadowThe check runs beside your review. Log disagreements.
  2. 2 · ReleaseOne class of change: covered, and undoable.
  3. 3 · KeepThe spec, the exam, the irreversible stay human.

The lights go out last (0022), and one room at a time.

Four rising landings. One, map and records, lesson 0024. Two, one check for one feature, lesson 0023. Three, shadow: the check runs beside your own review and every disagreement is logged. Four, release: one class of change merges on the check and you read a sample. A bracket under the first three says you still read every diff. An arrow returns from landing four to landing two for the next class of change.

Architecture first. Landings 1 and 2 are the last two lessons. Tonight is 3 and 4.

Three moves

Shadow log · refund logic · 20 agent changes · numbers invented for illustration

                         check PASS    check FAIL
  you would merge            13             1
  you would reject            2             4

  agreement: 17 of 20

  THE CELL THAT MATTERS: you reject, check passes  (2)
    #7    the refund was issued twice when the request was retried
          -> new scenario: "the same request arrives twice"
    #15   right amount, wrong currency on the refund
          -> the twin now records currency; the judge compares it

  re-run all 20 with the two additions:  that cell is 0
  the other odd cell: you merge, check fails  (1)
    #11   you missed a monthly plan being refunded. The check was right.

What this shows. Seventeen of twenty sounds like a good check. It is not the number to read. The two changes in the bottom-left cell are what would have shipped had the lights been off, so each one becomes a scenario or a field the twin records, and the run is repeated. The top-right cell is worth a look for the opposite reason: sometimes the check is too strict, and sometimes, as with #11, it caught what you did not. You step up when the bottom-left cell stays empty across a run long enough that you believe it. I have no sourced number for how long that is; pick one before you start so you cannot talk yourself into stopping early.

What may go, and what may not

Releasing a class needs two things to be true of it, not one. The check covers it, and a mistake in it can be undone.

A two by two grid. Columns: a shadowed check covers the change, or no trusted check covers it. Rows: the effect can be undone, or cannot. Covered and undoable: let it merge and sample afterwards. Not covered and undoable: read the diff and write the scenario. Covered but not undoable: the code may merge, the action waits for a person at a gate. Neither: read it and approve it.

My synthesis, not a quoted source. The bottom row is the allow gate from 0007 and 0020, placed on the action and not on the code.

Skill: decide who looks

Six changes arrive in the billing assistant’s queue. Refund logic has been shadowed and released. Nothing else has.

Merge, approve, or read?

The bill, and a cap on it

The check costs more than the build. That is the consistent finding in the reports, and the reason to release narrow classes instead of buying a factory.

Two habits keep the bill honest. First, the same team found an evaluator earns its cost only where the task is beyond what the model does reliably alone, and that each piece of a harness stands for something the model could not do when you added it. When the model changes, take pieces out one at a time and see what breaks. Second, give every unattended run a ceiling. You wrote one in 0021 as maxTurns. Claude Code’s non-interactive mode has the same cap and a dollar one:

claude -p --max-turns 30 --max-budget-usd 5 "Fix the failing refund scenario"

The docs note that the dollar cap is checked against a client-side estimate that can differ from the bill. This line is here to show the shape. It makes paid calls, so it is not something to run in this course. Claude Code · CLI reference

Where a human stays

Solo developer

One repo, one feature, one class. A map, six scenarios and a twin. Shadow twenty changes on a notepad. Release that class with a turn cap. Reaching landing 4 for a single class is a real result. Stay there as long as you like.

Team

A written list of released classes, each with an owner, its check, and the date it was last shadowed. Scenarios live where builders cannot push. A budget per person. Re-shadow after a model change. Legal reads the list before customers rely on it.

After this

The section ends here. The ramp’s first two landings are waiting in code/: the lint from 0024 and the check from 0023. Or build track 2, the allow gate that the bottom row of the grid depends on.

Your ramp, this week

No new code tonight. Three exercises are open, and they are the ramp in order of value. Pick one.

cd code/0023-a-check-the-builder-cannot-see     landing 2: the check
node check.ts

cd code/0024-a-rule-that-teaches                landing 1: a rule in the repo
node check.ts

cd code/0021-write-the-loop                     the loop every agent runs on
node check.ts

Then, for something of your own: name one class of change in a repository you work in, write down the two or three things you look for when you review it, and send me the list. Those are your first scenarios.

Parked: many agents in parallel, task locks and worktrees; LLM judges for outcomes code cannot grade, and why they bring the shared-blind-spot problem with them; running each scenario several times so the score is a rate; factories on old codebases, where I have no source worth teaching from yet.

Check

From memory.

1. During shadowing the check runs
2. The cell of the shadow log to empty first is
3. You stop reading diffs
4. A change whose effect cannot be undone needs
5. Re-test each piece of your harness when

Primary source. Harness design for long-running application development, by Prithvi Rajasekaran. Read the cost tables, the passage on how the evaluator was tuned against the author’s own judgment, and the section on removing harness pieces after a model upgrade. It is a vendor report on its own models, with the limits stated. Then, for the half engineers skip, Built by Agents, Tested by Agents, Trusted by Whom?

Wisdom lives with people doing this. Simon Willison’s coding-agents posts and the discussions they link to are the most candid running record I know of; read the disagreements, not only the posts.

Card: software factory (now with the ramp). Calibrating a judge: 0019. The gate: 0020.