55. The human in the loop
Chapters 52 to 54 built a way to hand a change to a daemon and receive a branch that passed three gates; this chapter is about the person on either side of that handover.
Why this layer exists
What is left is the person’s: whether to hand a task over, how to read what comes back, how to tell whether it helped, and what went wrong when one book was made this way. Nothing in the daemon decides whether a task should go to it, and nothing in it can tell the reader that the agent has made his week slower. Approval is chapter 27’s protocol as chapters 42 and 47 enforce it, the user model is chapter 35’s, and the gate is chapter 47’s; this chapter discusses how the human works with them and re-derives none of them.
The evidence is this book’s own production record: CONTEXT.md, DECISIONS.md, the commit log, and the Parts 0 to VI ledgers that lived on talos, read there and read-only. The ledgers Part X itself kept are git-ignored scratch and are not a source here. The record is read into two CSVs that the lab pins to their lines, so a number in this chapter is a quotation with a line number and not an impression. One thing the record cannot say is how long any human review took. The reviewers it records were models, and the reader’s own time is his and was not read.
Mechanism
When to delegate
Write the cost of doing a task alone as and the cost of delegating it as
is the cost of writing the spec: chapter 52’s document, whose goal line names an acceptance test. is the wait for round , machine time that falls as models get faster. is the human’s reading of round ’s output, which does not fall with the model. is the number of fix rounds the loop’s budget allows: chapter 53’s MaxRounds counts fix rounds after the first review, so allows four reviews and four readings, . is the probability that a defect survives every review and its cost. Delegate when . Each term is a measurement or a gap, and the record says which.
What the record is. aec-work production reads production.csv: 36 counted reviews, each a row for one review round of one chapter or one part, with its Critical, Important and Minor counts and the file:line it was read from. A review is in the record when its line carries a full triple of the three counts; two lines that give a single count (CONTEXT.md:39, “8 Minor + 2 nits”, and DECISIONS.md:1735, “5 Important defects”) are not in it, and never reach the scan. The CSV’s header lists the lines that carry a full triple and were left out, and why. The rows group into series. A part’s series starts with the Opus cross-check of its plans, made before any code existed, and continues with the part review, the final review and its re-review. A chapter’s series is its task reviews and then its chapter review. So the “first review” of a part series is a review of plans and not of the artefact the later ones read, and the numbers below are about the book’s process, not a detection rate. Severity is the book’s own, and a review is clean when it found no Critical and no Important finding. Six of the 36 rows, the task1 rows of chapters 46 to 51, are sums: the record gives one count for the Opus reviews of three tasks together, and the CSV’s notes say so. A row is a counted review and not always one reading, and the first row of such a chapter series is three readings. Across the 36 rows the findings were 14 Critical, 151 Important and 408 Minor.
, from the series. The part series run two to four reviews: Part V is clean at its second review of two, Part VI at its second of three, Part VII at its fourth of four (the cross-check’s 3 Critical, the part review’s 1, the final review’s 3 Important, then a scoped re-review at 0 C, 0 I, 4 M) and Part IX at its third of three. Parts IV and VIII reach no clean review in the record, and each for a reason the record states. Part IV’s one counted review is the Fable final at 0 C, 4 I, 8 M (CONTEXT.md:42), followed by a fix wave and a re-review that DECISIONS.md:1097 records as “re-reviewed once with no new findings”: a re-review with no count is not a counted clean review, so rounds.txt says “no clean review recorded”. Part VIII’s final review is 0 C, 2 I, 8 M, and its re-review “said it may land” without a count (CONTEXT.md:52). No chapter series reaches a clean review in the record, nine of nine. The fix round after a chapter review was read by the part and final reviews that came next and, in the record’s own words, was sometimes “verified by the controller’s reading of its gate log, not by a further review” (CONTEXT.md:50; :49 reads “gate log and tables”); the record’s counts end a chapter’s series on the review before that fix. Chapter 53 chose its budget from the fix-wave counts of chapters 42 to 45 in CONTEXT.md:47 to :51 (53-loop-engineering.md:608, :622), not from this CSV.
. A counted review returns a median of 15 findings (the 36 rows’ totals, six of which sum three task reviews, so the figure overstates a single reading; the 95% order-statistic interval of the median is , at ranks of , from chapter 49’s quantile interval). The interval treats the rows as independent draws and reviews of one artefact are not, so its 95% is nominal. Of the 12 series with two or more reviews, the median share of a series’ findings found in its first counted review was 0.486 (the nearest-rank median, the lower of the middle two shares; rounds.txt prints 0.4864864864864865, and the midpoint of the middle two is 0.5075): the first counted review found about half of what the sequence found. That reads as a planning number and not as recall, because the later reviews read different things (the code, then the chapter, then the whole part). A plan that budgets one review budgets about half of the findings the book’s sequences recorded, and for a chapter that review is sometimes three readings. The one measured in the book is 4.8 seconds per item over 60 items, talos, in chapter 39’s labelling (39-judge.md:1694): the time to read a request and a final of a few lines and answer one letter. It bounds nothing larger.
and . The record holds no estimate of . What it holds is how many planted bugs the tests catch (next section), which says something about whether the grade can be trusted and nothing about what reaches production.
What not to delegate falls out of the terms. A task whose is near , because reading the change is as hard as making it: a one-line fix with an invariant behind it, anything at a trust boundary chapter 46 names. A task with no writable acceptance test: chapter 52’s lint refuses a goal that names none, and without a test is not small. A task the reader is doing in order to learn it, where the cost of doing it alone is the point. Bainbridge’s “Ironies of automation” (1983) gives the shape in one sentence: the operator left with the parts automation could not do is left with the hardest parts and the least practice.
Reviewing agent output
Recompute every printed number. DECISIONS.md:3617 to :3619 records that the planned re-derivation of chapter 50’s maths and chapter 49’s quantile interval by a Fable seat inside the Part IX sub-plans did not run, and that “the Opus chapter reviews recomputed every printed number instead”; CONTEXT.md:164 records that the final review then did it (“94 and 61 numbers, all matching”). The rule is that a number a reviewer did not recompute is a claim.
Plant bugs to test the tests. Chapter 53’s mutation pass does it for the daemon’s loop. The book’s own counts: Part II’s review ran 23 mutants against chapter 13’s lab, 18 killed and 5 survived, “four distinct gaps” (talos, task-7-findings-r1.md:65); the next review ran 22 against chapter 14’s (task-8-findings-r1.md:53); and an implementer’s own mutation pass in the same part ran 28 mutants, all killed after one fix (task-6-report.md:31); chapter 47’s gate had 21 mutants, 19 killed and 2 equivalent (CONTEXT.md:54), and chapter 48’s 13 of 13 (CONTEXT.md:55). Chapter 53’s table says what a survivor is: a test gap, with the line, or an equivalent mutant, with the reason (53-loop-engineering.md:462, :463). A mutation score is evidence about the tests. It is not a measurement of .
Credit a check only by its artefact. The next section’s first record is the reason.
Read the sentence that claims the most first. Part II’s boundary check, an implementer’s read-through, of “How this book was made” caught “Every code listing in the chapters is pulled from real source files by a small tool”, which was false of the lab scripts and of chapter 14’s quoted ggml struct (talos, task-9-report.md:68); the provenance page now says “Every listing of the reference code in the chapters’ walkthroughs is pulled from the source files by a small tool” (provenance.md:64). The strongest claim in a document is the one an unread detail is most likely to contradict.
Read the trace before the report. Chapter 52’s reviewer opens aec-trace view over the capture before anything the model wrote (52-specs.md:1069), chapter 54’s policy gate reads the audit log and fails a session that has no record, and a worker’s report in chapter 45 is quoted inside a fence and never read as an instruction. A reviewer’s text to the controller is the same kind of thing: data about the work, not a command.
Severity as the book used it: Critical, Important, Minor, with the record’s 14, 151 and 408, and the rule that a Minor accuracy issue in teaching prose is fixed, not deferred (AGENTS.md). A grade computed by running the attempt’s own code is evidence against honest mistakes only (chapter 53, “What a sandboxed grade cannot see”), which is why a reviewer reads a diff that contains everything that shaped the grade.
Fagan’s inspections (1976) are the ancestor of the arrangement: a reading role, a checklist and a rate. Parasuraman and Riley (1997) name the failure this section guards against: their abstract defines misuse as over-reliance on automation, “which can result in failures of monitoring or decision biases”. A reviewer who trusts the agent’s report is over-relying, and so is a controller who trusts the reviewer’s.
Measuring whether the agent helps
The design is the paired one. The reader does the same task class with the agent and without it, in one unit, and is the difference on task with the cost with the agent and the cost without. The statistic is the mean of the and its interval is the percentile interval of the paired bootstrap over the pairs: chapter 38’s Resampler.Paired, , seed 1, nearest-rank quantiles.
Chapter 38’s section on dependence is why pairing is used, and it is cited and not re-derived: , so “pairing helps exactly when the covariance is positive”. Here the covariance is the task’s own difficulty, which both arms share. The clustered standard error over the cluster column (task kinds; chapter 38’s ClusteredSE) is printed beside the interval and decides nothing: the reader’s clusters will be few and small, and the number is there to show whether his kinds pull together.
The rule is registered here, before any reader’s data exist. aec-work paired prints it before any number; the text is Rule.Text(), and the Walkthrough quotes it from the command’s output. Four derivations belong to this chapter.
The reference is internal/measure: Record is one row of the paired CSV, Rule the registered rule, Effect the rule applied and Verdict its reading of an interval.
// Record is one task done both ways: the time (or any cost) without the
// agent and with it, in the same unit, and the cluster the task belongs to
// (a repository, a kind of task), for the clustered standard error.
type Record struct {
Task string `json:"task"`
Cluster string `json:"cluster,omitempty"`
Before float64 `json:"before"`
After float64 `json:"after"`
}
Rule is the registered decision, with its text and defaults; Effect applies it to the differences and Verdict reads the interval it returns:
// Rule is the pre-registered decision: the paired bootstrap interval of
// mean(after − before) at Level with B replicates and Seed, the smallest n
// the rule accepts, and the verdicts: "helps" when the interval lies below
// zero (less time with the agent), "hurts" above zero, "undecided"
// across it, "refused" under MinN. The text of the rule is printed before
// any number, as chapter 38's decide prints its own. A zero field takes
// Registered's value.
type Rule struct {
Level float64
B int
Seed int64
MinN int // default 6, from MinNForQuantile(0.5, 0.95)'s six: the smallest n whose extremes bound the median at 95%
}
// Registered is the rule chapter 55 registers before any reader's data
// exist. MinN is MinNForQuantile(0.5, 0.95), computed, not written.
var Registered = Rule{Level: 0.95, B: stats.DefaultB, Seed: 1, MinN: stats.MinNForQuantile(0.5, 0.95)}
// Text is the rule as printed, with its parameters, before any number.
func (r Rule) Text() string {
r = r.withDefaults()
return fmt.Sprintf(`Rule (registered before the data): for each task i, d_i = after_i - before_i,
the cost with the agent minus the cost without it, in one unit. The
statistic is the mean of d_i; its %d%% interval is the percentile interval
of the paired bootstrap over tasks, B = %d, seed %d, nearest-rank
quantiles (chapter 38). Verdict: helps when the interval's upper bound is
below zero; hurts when its lower bound is above zero; undecided otherwise.
Refused, with no interval, under n = %d pairs (chapter 49's smallest n whose
extremes bound the median at 95%%). The clustered standard error over the
cluster column is printed beside the interval and decides nothing.`,
int(math.Round(r.Level*100)), r.B, r.Seed, r.MinN)
}
func (r Rule) withDefaults() Rule {
if r.Level == 0 {
r.Level = Registered.Level
}
if r.B == 0 {
r.B = Registered.B
}
if r.Seed == 0 {
r.Seed = Registered.Seed
}
if r.MinN == 0 {
r.MinN = Registered.MinN
}
return r
}
// Result is the rule applied.
type Result struct {
N int
Mean float64 // mean(after − before)
Interval stats.Interval // the paired bootstrap percentile interval
ClusteredSE float64 // over Cluster
Verdict string
Rule string // the rule's text as printed
}
// Differences is after − before per record, in file order: the d_i the
// rule resamples.
func Differences(recs []Record) []float64 {
d := make([]float64, len(recs))
for i, r := range recs {
d[i] = r.After - r.Before
}
return d
}
// Clusters groups the differences by Cluster, in order of first
// appearance, for ClusteredSE.
func Clusters(recs []Record) [][]float64 {
index := map[string]int{}
var out [][]float64
for _, r := range recs {
i, ok := index[r.Cluster]
if !ok {
i = len(out)
index[r.Cluster] = i
out = append(out, nil)
}
out[i] = append(out[i], r.After-r.Before)
}
return out
}
// Effect applies Rule to recs. Under MinN it returns the refusal (Verdict
// "refused", NaN statistics) and no error: the refusal is the rule's
// answer, not a failure to read. A level outside (0, 1) or B below 1 after
// defaults is an error.
func Effect(recs []Record, r Rule) (Result, error) {
r = r.withDefaults()
if !(r.Level > 0 && r.Level < 1) {
return Result{}, fmt.Errorf("measure: level %v is not in (0, 1)", r.Level)
}
if r.B < 1 || r.MinN < 1 {
return Result{}, fmt.Errorf("measure: B %d and min n %d must be positive", r.B, r.MinN)
}
res := Result{N: len(recs), Mean: math.NaN(), ClusteredSE: math.NaN(), Rule: r.Text()}
res.Interval = stats.Interval{Lo: math.NaN(), Hi: math.NaN(), Level: r.Level}
if len(recs) < r.MinN {
res.Verdict = "refused"
return res, nil
}
after := make([]float64, len(recs))
before := make([]float64, len(recs))
for i, rec := range recs {
after[i], before[i] = rec.After, rec.Before
}
// Paired(a, b) resamples the mean of a − b: a is after, b is before, so
// the statistic is the rule's d, not its negative.
iv, _ := stats.Resampler{Seed: r.Seed, B: r.B}.Paired(after, before, r.Level)
res.Interval = iv
res.Mean = stats.Mean(Differences(recs))
res.ClusteredSE = stats.ClusteredSE(Clusters(recs))
res.Verdict = Verdict(iv)
return res, nil
}
// Verdict is the rule's reading of an interval on mean(after − before):
// helps when the whole interval is below zero, hurts when it is above,
// undecided when it contains or touches zero. Effect uses it; the lab
// tests its boundaries.
func Verdict(iv stats.Interval) string {
switch {
case iv.Hi < 0:
return "helps"
case iv.Lo > 0:
return "hurts"
default:
return "undecided"
}
}
(a) Resolution. The interval is with , and for a true mean difference the sample mean is distributed (normal approximation, treated as known). The interval excludes zero when , an event about the sample mean and not about . If exactly, lands above that bound half the time: . So the size
is the one at which the verdict is decided about half the time. For a probability that the interval excludes zero when the effect is (the power), the far tail aside,
At 80% power and . If the differences scatter with , task times varying by 30% of their mean, and the effect is , then is the 50% size (35 pairs) and the 80% size: 71 pairs to see a 10% change. For the sizes are and : six and 12. At the power against that 25% effect is , so six pairs see only large effects, and then about half the time. The bootstrap percentile interval replaces by resampled quantiles and its width scales the same way. At the honest multiplier is a quantile with five degrees of freedom, larger than 1.96, so these sizes are floors. The reader reads the printed width before the verdict.
(b) The floor . Chapter 49 derived that the extreme order statistics bound the -quantile with probability : the bound fails only when every observation lies on one side of the quantile. At this is
so : at the probability is and at it is . measure.Registered computes this with MinNForQuantile(0.5, 0.95) and does not write the six. The bound is on a median. It is the smallest sample at which a distribution-free statement about the centre exists at 95%, and the rule uses it as a refusal floor, not as the interval’s guarantee.
The percentile interval at has no coverage guarantee of its own. A resample of six items is a multiset of the six, and by stars and bars (six draws placed into six item bins) there are
of them, so the 2,000 replicate means take at most 462 values (104 distinct ones for the synthetic example’s six differences, because two are equal and some sums coincide) and the interval’s ends are two of them: the 50th and 1,950th of the sorted replicates, chapter 38’s nearest rank at and . A replicate that is one item six times has probability , so about of them are expected in a run. The synthetic example (below) shows the discreteness: its differences are integers, so the replicate means lie on the lattice of multiples of , and on straylight seeds 1 to 5 give the same interval while seed 6 moves its lower end by exactly one step. That agreement across seeds is the lattice and not a property of the data. Coverage is the direct measurement, and the Walkthrough prints it: with differences drawn from a normal distribution of mean zero, the nominal 95% interval at contained the true mean in 0.854 of 4,000 samples (one standard error, 0.006), and from an exponential parent shifted to mean zero, 0.806. So six is a floor for printing a verdict and not a promise about how often the verdict is right.
(c) The sign test as the honest floor. Under no effect each is negative with probability . All six with the same sign has probability . Exactly five of six one way or the other has probability , and at least five, the two-sided tail the test reads, has . So six pairs reject “no effect” at 5% only when every pair agrees, which is what the floor means in words. Wilcoxon’s signed-rank test (1945) uses the magnitudes too; exercise (b) runs both on the synthetic rows.
(d) What pairing does not control. Learning across the pair: the second attempt at a task is faster whichever arm it is, so alternate which arm goes first. Selection: the tasks a reader chooses to delegate are not the tasks he would do alone, so choose the task before the arm. Drift: the day, fatigue. And the agent’s own variance: one run per task, the lesson of chapter 50, whose measured gain rested on one student, one seed, two training runs (the second with a corrected trainer) and twelve tasks (50-fine-tuning.md:15).
Two randomised studies show the range a design can give. METR’s trial (Becker, Rush, Barnes and Rein, arXiv 2507.09089, v2, 2025) had 16 developers complete 246 tasks in mature projects on which they averaged five years of prior experience, each task randomised to allow or disallow AI tools (25 issues early in the study were randomised differently, the paper says). The developers forecast that allowing AI would reduce completion time by 24% and were measured 19% slower. Peng, Kalliamvakou, Cihon and Demirer (arXiv 2302.06590, 2023) had developers implement one task, an HTTP server in JavaScript, and the treatment group finished 55.8% faster. Each is what that study found with that design on those dates. Neither is a claim about this reader’s agent, and the two together are why the rule is registered before the data and why the reader’s is printed before his verdict.
Three failure modes, from the record
A check credited that never ran. CONTEXT.md:56, the Part IX row, records make nix-check with exit 0 at 9bfdc1a, 0b07cc2 and f975666 “but not a VM run (nix flake check finds the derivation in the store and runs 0 checks, so those “all checks passed!” lines prove only evaluation)”. The VM runs that were real, in the same record, were the part review’s forced --rebuild, the final review’s, and the final fix wave’s make nix-check at c180290, “which now evaluates with --no-build, builds, and rebuilds with nix build --rebuild, and printed vm-test-run-aecd-vm> test script finished in 40.77s with exit 0”. An exit code of zero stood in the record for a check that had run nothing, and the record sets those three lines apart from the runs it calls real. The rule the book took is that a check is credited only by its artefact, which is what chapter 53’s reviewer turn requires of the acceptance and mutation reports (files under rounds/<n>/, not the model’s word) and what chapter 54’s eval gate requires of its code 4 (a skipped cell fails, and is named). Part X’s own gate is a related case, caught before it was credited. DECISIONS.md:3702 to :3709 records that with bwrap on the PATH the sandbox package’s tests stop skipping, and that “a gate run outside it skips the bwrap rows and does not count (Task 0’s first gate was withdrawn for that reason)”. A skipped test is not a failure, so a gate run outside the dev shell exercises less of the sandbox than its exit code suggests; the rule, P10-9, is that every gate runs inside the shell, and the gate that did not was withdrawn.
The record’s honest form is the same fact written down as a skip: “Fix round 3 is verified by the controller’s reading of its gate log and tables, not by a further review” (CONTEXT.md:49) and “Fix 7 is not separately re-reviewed” (:48), and the Part IX entry’s sentence that a planned re-derivation did not run (DECISIONS.md:3617). A check recorded as not run is the only acceptable form of one. The same class the other way round is a check run before it could mean anything: on 2026-10-04 a fail-first run of a new guard’s test sent one real completion to straylight’s 35b before the guard existed (CONTEXT.md:83; talos, Part VI’s 6a ledger, line 40), and the lesson recorded with ruling 6a-E11 reads “a fail-first test of a safety guard must run against a dial-refusing transport, never against the real host the guard protects” (line 41).
An agent running another agent’s scratch script. Part II’s ledger, talos part-2/progress.md:87, whole: “Task 6: fix round 1 committed 8bbbb4e (35 lab tests); implementer accidentally ran reviewer’s scratch mutate.py (no change). Rule added to implementer-rules: agents use their own scratch subdirectory and never run/edit others’ scripts.” The rule it produced is the implementer rules’ line 19: “The scratchpad is shared with reviewers and other agents: never run or edit another agent’s scripts there.” Later seats attest to it in their reports (“I did not run any other agent’s scratch files”, task-8-findings-r2.md:82; “I did not run or edit any of the reviewer’s files; I only read killtests.py”, task-7-fix-r1-report.md:12). No committed rule file of this repository carries the never-run rule itself; AGENTS.md has the neighbouring scratch hygiene (scripts live outside the repository, :51; scratch copies on wntrmute are removed when a section closes, :58, for the reason CONTEXT.md:71 gives: wntrmute’s /tmp is RAM-backed). The incident changed nothing in the code, and the rule is the whole of its consequence.
It is a channel in chapter 46’s sense. A file another agent wrote is a tool result nobody fenced, and a shared scratch directory is the one place in this loop where one agent’s output reaches another as something runnable and not as text under a fence. The daemon’s answer is to not share the place: a session has its own workspace (chapter 40), the sandbox’s one writable bind is that workspace (chapter 43), and chapter 54’s factory gives each attempt a worktree of its own.
Context rot. The record holds no defect dated to it, and the chapter claims none. What it holds is the book’s mitigations. Chroma’s measurement (Hong, Troynikov and Huber, “Context Rot”, dated July 16, 2025, read 2026-11-09) evaluates 18 models and reports that “even under these minimal conditions, model performance degrades as input length increases, often in surprising and non-uniform ways”, on tasks beyond Needle in a Haystack’s lexical retrieval. That is the failure mode’s definition here: a long window is not a uniformly usable one. The book’s mitigations are records. CONTEXT.md:3 says the file exists “so that a new or compacted session, human or agent, can resume without the conversation that produced it”, and AGENTS.md calls the ledgers “the recovery map for work in flight”. The ledgers show the pauses and resumptions (talos part-2/progress.md:233, :238, :240, and part-3/progress.md:41), a power loss that ended with a fresh implementer on the same brief (part-2/progress.md:81), and plans that rotted against the code and were refit: “7f is refit to the code as landed by its Fable writer before execution” and “each of 7b–7f starts from an amendments file read against the code” (CONTEXT.md:71), “the plan’s Task 4 outline is stale (the chapter was written from the code)” (:51). Part X’s index carries the same rule, that a sub-plan reads what is built and never plans against pre-execution text. On the daemon’s side the mitigations are chapter 31’s loss check and chapter 53’s round ledger.
“Dive into Claude Code” (Liu, Zhao, Shang and Shen, arXiv 2604.14228, v3) is cited for the shape every harness shares, which its abstract puts as “a simple while-loop that calls the model, runs tools, and repeats”, compared there with two other systems, OpenClaw and Hermes Agent. Nothing quantitative is taken from it.
The human the daemon models
The user model (chapter 35) is four forms matched as whole lines of the reader’s own messages and never read by a model. Chapter 35’s reason (35-memory-service.md:267) is measured: the deriver copied a planted sentence as a fact in exactly the form 6, 2 or 0 times in 6 depending on its settings, and a fact is attributed to evidence the model chose, so a policy source that sometimes works is one nobody can state. The model is read “from the reader’s own lines and nothing else” (CONTEXT.md:96). Its NeverAuto lines are asks the unattended approver cannot lift (47-policy-engine.md:212), and the pasted form is the one way a line he did not write binds him (47-policy-engine.md:1294).
Approval is chapter 27’s protocol as chapters 42 and 47 enforce it: a call marked as needing approval, the approval bound to that one call, and silence a timeout. Unattended answers the timeout at once and the loop’s Abort ends the run (42-autonomy.md:1142). It aborts and does not allow because “oversight degrades with the use of the thing overseen” (42-autonomy.md:11), citing Mitchell, Ghosh and Passi as chapter 47 reads them: a position paper and not a measurement of this system (47-policy-engine.md:13). Anthropic’s study of Claude Code sessions, a vendor post and supplementary, reports that experienced users auto-approve more but also interrupt more, a shift from approving each action to monitoring, which the post does not call a degradation.
The interruption rule is chapter 42’s, and its derivation is there (42-autonomy.md:1980): a notice interrupts when , where depends only on the ratio of the reader’s cost of an unwanted interruption to his cost of a missed one and not on their scale (:2258), the median rule at . The daemon’s own notices are never scored (:1276), and critical marks the one thing that interrupts inside quiet hours.
The oversight numbers are chapter 47’s, stated with what they are. On the replayed day the gate asked 330 attended prompts against Part VII’s 310, and 17 of the 20 it added are patch calls, an artefact of a tool this daemon lacks (47-policy-engine.md:1213 to :1224). The head asked about 9 of the 30 rule-missed dangerous calls (CONTEXT.md:54). The gate’s latency to dixie was p50 147.1 ms, p90 192.5 ms, 0 of 50 over 250 ms (CONTEXT.md:59; :125 says it was measured from wntrmute), which is the price of asking a model before asking the person. Every prompt is a cost the person pays, and the gate’s measured value on the replayed day was zero prompts removed, a property of that day. Whether the person answers the 330 well is Mitchell’s question, and no number here answers it.
The third of chapter 53’s live captures left an audit log (straylight, 2026-11-09 UTC, its fixtures in go/labs/ch53/testdata/capture3/). aec-trace oversight and aec-trace cost -by actor over it print:
2026-11-09 turns=13 policy: allow=63 deny=0 ask=12 approvals: allow=1 deny=31 tools=1
actor lines prompt cached completion reasoning amount unpriced
principal 75 291511 242942 122795 0 0.000000 0
total 0.000000 USD (75 lines, 0 unpriced)
The 32 approvals were asked of the loop’s client approver, a list of command shapes (chapter 53, “The approver”), and not of a person: in that run no human answered anything. -by actor has one row, principal, the person on whose behalf the daemon acts and not a seat of the loop. The split by seat is -by session, whose eight rows (the work sessions of the two runs and their reviews) are in the same capture’s cost.txt. The amount is 0.000000 because the model is local and priced at zero. The line is a measure of how much a policy asked, which is what chapter 49 built it to count, and says nothing about a person’s attention.
Walkthrough
The registered rule on six synthetic pairs
The CSV below is synthetic and is not the reader’s data: six tasks timed in minutes, two task kinds as clusters, and the lab’s own file says so in its first line.
# synthetic example, not the reader's data: six tasks timed in minutes, two task kinds as clusters
task,cluster,before,after
example-1,refactor,40,31
example-2,refactor,25,29
example-3,tests,55,38
example-4,tests,18,22
example-5,refactor,33,27
example-6,tests,47,50
aec-work paired -csv go/labs/ch55/testdata/paired-example.csv on straylight (2026-11-09), whole output:
Rule (registered before the data): for each task i, d_i = after_i - before_i,
the cost with the agent minus the cost without it, in one unit. The
statistic is the mean of d_i; its 95% interval is the percentile interval
of the paired bootstrap over tasks, B = 2000, seed 1, nearest-rank
quantiles (chapter 38). Verdict: helps when the interval's upper bound is
below zero; hurts when its lower bound is above zero; undecided otherwise.
Refused, with no interval, under n = 6 pairs (chapter 49's smallest n whose
extremes bound the median at 95%). The clustered standard error over the
cluster column is printed beside the interval and decides nothing.
n 6
mean after-before -3.5000
95% paired bootstrap interval [-10.3333, 2.1667]
clustered se 1.4453 (over 2 clusters) naive se 3.5285
verdict undecided
The mean is minutes: the agent’s arm was 3.5 minutes faster. The interval crosses zero, so the verdict is undecided, and the figure takes no side: three lines fall and three rise. The two standard errors need a reading, because the clustered one (1.4453) is below the naive one (3.5285). The deviations from the mean are , whose squares sum to 373.5, so and the naive error is . Chapter 38’s clustered error adds the within-cluster cross terms, over the residuals from the grand mean. The refactor residuals are with sum and squares , giving , and the tests residuals give . The total is , so
The two cluster means, and , sit within of the grand mean, so each cluster’s residuals nearly cancel and the cross terms cancel almost all of the independent variance. Chapter 38 said this: the clustered error is not a floor at the naive one, and the cross terms are negative when the cluster means vary less than independent trials would make them. When a cluster’s residuals lean the same way, the cross terms are positive and the clustered error exceeds the naive one. With two clusters the number rests on two cluster means and is weak evidence of anything, which is why the rule prints it and lets it decide nothing.
The floor. The same file with example-6 deleted (five rows, a copy outside the repository):
n 5
verdict refused: 5 pairs is under the rule's 6; no interval is printed
printed after the rule’s text, with refused: 5 pairs under min n 6 on stderr, and the command exits 4, the code chapter 38’s decide and chapter 54’s land use for a refused verdict.
The seeds. -seed 1 through -seed 10 print these intervals (only the interval line is shown; for a seed other than 1 the rule’s text prints that seed, a note: not the registered rule line follows it, and the verdict is exploratory):
| seed | interval |
|---|---|
| 1, 2, 3, 4, 5 | [-10.3333, 2.1667] |
| 6, 7, 10 | [-10.1667, 2.1667] |
| 8 | [-9.6667, 2.1667] |
| 9 | [-9.8333, 2.1667] |
Seeds 1 to 5 agree and 6 is the first to differ, by one sixth. The upper end is for all ten seeds. The agreement is the lattice of the earlier derivation and says nothing about how stable the data’s interval is: which two of the at most 462 values the resample’s 50th and 1,950th ranks land on is a property of the seed.
// cmdPaired is aec-work paired -csv FILE [-B 2000] [-seed 1] [-level 0.95]
// [-min-n 6]: chapter 55's rule over a paired CSV the reader wrote. It
// prints the rule's text before any number, then n, the mean difference,
// the interval, the clustered and the naive standard error and the
// verdict, and nothing of the rows. A refused verdict is exit 4, as
// chapter 38's decide exits on a refusal.
func cmdPaired(args []string, stdout, stderr io.Writer) int {
const pairedUsage = "usage: aec-work paired -csv FILE [-B N] [-seed N] [-level L] [-min-n N]"
fs := flag.NewFlagSet("aec-work paired", flag.ContinueOnError)
fs.SetOutput(stderr)
path := fs.String("csv", "", "the paired CSV: task,cluster,before,after")
b := fs.Int("B", measure.Registered.B, "bootstrap replicates")
seed := fs.Int64("seed", measure.Registered.Seed, "the resampler's seed")
level := fs.Float64("level", measure.Registered.Level, "the interval's level")
minN := fs.Int("min-n", measure.Registered.MinN, "the smallest n the rule accepts")
if err := fs.Parse(args); err != nil || *path == "" || fs.NArg() != 0 {
fmt.Fprintln(stderr, pairedUsage)
return 2
}
if *b < 1 || *minN < 1 || !(*level > 0 && *level < 1) {
fmt.Fprintln(stderr, "paired: B and min-n must be positive and level in (0, 1)")
fmt.Fprintln(stderr, pairedUsage)
return 2
}
rule := measure.Rule{Level: *level, B: *b, Seed: *seed, MinN: *minN}
fmt.Fprintln(stdout, rule.Text())
if rule != measure.Registered {
fmt.Fprintln(stdout, "note: not the registered rule (chapter 55 registers level 0.95, B 2000, seed 1, min n 6); the verdict below is exploratory")
}
f, err := os.Open(*path)
if err != nil {
fmt.Fprintln(stderr, "aec-work:", err)
return 1
}
defer f.Close()
recs, err := measure.ReadCSV(f)
if err != nil {
fmt.Fprintln(stderr, "aec-work:", err)
return 1
}
res, err := measure.Effect(recs, rule)
if err != nil {
fmt.Fprintln(stderr, "aec-work:", err)
return 1
}
fmt.Fprintf(stdout, "n %d\n", res.N)
if res.Verdict == "refused" {
fmt.Fprintf(stdout, "verdict refused: %d pairs is under the rule's %d; no interval is printed\n", res.N, rule.MinN)
fmt.Fprintf(stderr, "refused: %d pairs under min n %d\n", res.N, rule.MinN)
return exitRefused
}
d := measure.Differences(recs)
fmt.Fprintf(stdout, "mean after-before %s\n", num(res.Mean))
fmt.Fprintf(stdout, "%d%% paired bootstrap interval [%s, %s]\n", int(res.Interval.Level*100+0.5), num(res.Interval.Lo), num(res.Interval.Hi))
fmt.Fprintf(stdout, "clustered se %s (over %d clusters) naive se %s\n", num(res.ClusteredSE), len(measure.Clusters(recs)), num(stats.SE(d)))
fmt.Fprintf(stdout, "verdict %s\n", res.Verdict)
return 0
}
// cmdProduction is aec-work production -csv FILE: the committed record
// summarised as chapter 55 reads it (measure.Rounds). It reads one file
// and runs nothing.
func cmdProduction(args []string, stdout, stderr io.Writer) int {
fs := flag.NewFlagSet("aec-work production", flag.ContinueOnError)
fs.SetOutput(stderr)
path := fs.String("csv", "", "the production CSV")
if err := fs.Parse(args); err != nil || *path == "" || fs.NArg() != 0 {
fmt.Fprintln(stderr, "usage: aec-work production -csv FILE")
return 2
}
f, err := os.Open(*path)
if err != nil {
fmt.Fprintln(stderr, "aec-work:", err)
return 1
}
defer f.Close()
ps, err := measure.ReadProduction(f)
if err != nil {
fmt.Fprintln(stderr, "aec-work:", err)
return 1
}
if _, err := io.WriteString(stdout, measure.Rounds(ps)); err != nil {
fmt.Fprintln(stderr, "aec-work:", err)
return 1
}
return 0
}
Coverage at the floor
The program below draws samples of differences from a parent whose mean is zero, takes each sample’s paired bootstrap interval (, seed for sample ) and counts the intervals that contain zero. Its output is one RNG’s path (Go’s math/rand, seed 1) and not a claim about others.
// T samples of n differences, drawn from a parent with mean zero; the
// before column is all zeros, so Paired's mean of after - before is the
// sample mean of the draw.
const T = 4000
func coverage(n int, draw func(*rand.Rand) float64) float64 {
rng := rand.New(rand.NewSource(1))
zeros := make([]float64, n)
hit := 0
for t := 1; t <= T; t++ {
d := make([]float64, n)
for i := range d {
d[i] = draw(rng)
}
iv, _ := stats.Resampler{Seed: int64(t), B: stats.DefaultB}.Paired(d, zeros, 0.95)
if math.IsNaN(iv.Lo) || math.IsNaN(iv.Hi) {
panic("coverage: Paired returned no interval") // NaN bounds fail both comparisons below and would count as a miss, hiding a broken resampler as lower coverage
}
if iv.Lo <= 0 && 0 <= iv.Hi {
hit++
}
}
return float64(hit) / T
}
func main() {
normal := func(r *rand.Rand) float64 { return r.NormFloat64() }
exponential := func(r *rand.Rand) float64 { return r.ExpFloat64() - 1 }
for _, n := range []int{6, 8, 10, 20} {
fmt.Printf("n=%-2d normal %.3f exponential %.3f\n", n, coverage(n, normal), coverage(n, exponential))
}
}
go run ./labs/ch55/coverage on straylight, 2026-11-09, 4.7 s:
n=6 normal 0.854 exponential 0.806
n=8 normal 0.887 exponential 0.833
n=10 normal 0.901 exponential 0.851
n=20 normal 0.923 exponential 0.897
The one standard error of a coverage near 0.85 over 4,000 samples is 0.006. The nominal 95% interval is below nominal at every tried, by 0.10 to 0.14 at and by 0.03 to 0.05 at , and lower for the skewed parent. Chapter 38 said the percentile bootstrap undercovers at small (at 8 of 9 successes its interval is narrower than Clopper and Pearson’s); this is the same fact for a mean.
The record
aec-work production -csv go/labs/ch55/testdata/production.csv, on straylight, whole output (rounds.txt in the same directory is the committed copy):
rows 36 findings critical=14 important=151 minor=408
findings per review: median 15 95% order-statistic interval [11, 18] ranks (12, 24) of n=36
share of a series' findings in its first review: median 0.4864864864864865 over 12 series with two or more reviews
chapters: 0 reach a clean review in the record, 9 end on a review that is not clean
parts: 4 reach a clean review in the record, 2 end on a review that is not clean
part IV: final1 0/4/8 no clean review recorded (1 review)
part V: part1 0/3/7 final1 0/0/5 clean at review 2 of 2 first-review share 0.6666666666666666
part VI: xcheck1 1/4/13 part1 0/0/13 final1 0/0/6 clean at review 2 of 3 first-review share 0.4864864864864865
part VII: xcheck1 3/13/16 part1 1/1/14 final1 0/3/4 rereview1 0/0/4 clean at review 4 of 4 first-review share 0.5423728813559322
part VIII: xcheck1 4/13/20 part1 0/5/18 final1 0/2/8 no clean review recorded (3 reviews) first-review share 0.5285714285714286
part IX: xcheck1 0/13/16 part1 0/2/9 final1 0/0/11 clean at review 3 of 3 first-review share 0.5686274509803921
chapter VII ch 40: task1 0/1/8 no clean review recorded (1 review)
chapter VII ch 42: chapter1 0/7/19 chapter2 0/1/4 rereview1 0/2/7 no clean review recorded (3 reviews) first-review share 0.65
chapter VII ch 43: task1 1/4/5 no clean review recorded (1 review)
chapter VIII ch 46: task1 0/5/12 chapter1 0/6/9 no clean review recorded (2 reviews) first-review share 0.53125
chapter VIII ch 47: task1 1/4/7 task2 1/1/12 chapter1 0/3/14 no clean review recorded (3 reviews) first-review share 0.27906976744186046
chapter VIII ch 48: task1 2/7/14 task2 0/5/10 chapter1 0/3/18 no clean review recorded (3 reviews) first-review share 0.3898305084745763
chapter IX ch 49: task1 0/5/14 chapter1 0/5/22 no clean review recorded (2 reviews) first-review share 0.41304347826086957
chapter IX ch 50: task1 0/4/11 chapter1 0/5/14 no clean review recorded (2 reviews) first-review share 0.4411764705882353
chapter IX ch 51: task1 0/7/12 task2 0/5/8 chapter1 0/8/16 no clean review recorded (3 reviews) first-review share 0.3392857142857143
A triple is Critical, Important and Minor. A part’s xcheck1 is the cross-check of its plans, before any code existed, so Part VII’s first row at 3/13/16 is a review of plans and its clean review, at the fourth row, is a scoped re-review of the final fix wave. Chapter 42’s three rows are its chapter review, its second chapter review and the review of the fix made after them (CONTEXT.md:48), the only chapter-series row that reviews a fix and not a chapter, which the CSV’s header says. Chapters 40 and 43 have one counted row each, the Fable re-derivations of their code (DECISIONS.md:2992, :2994). first-review share is printed only for series with two or more reviews, so Part IV, with one counted review, has none.
// Label is one review-count triple in CONTEXT.md or DECISIONS.md.
type Label struct {
File string // CONTEXT.md or DECISIONS.md, relative to the repository root
Line int // 1-based
Span int // how many lines from Line are joined with a space before the triple is read (a count wrapped across a line break); 0 means 1
Ordinal int // which count triple on the line, 1-based, in the order Forms match left to right
Part string
Chapter string // "" for a part-level review
Review string // one of measure.Reviews
Round int
Also string // FILE:LINE of a second line that must carry the same counts (the two records agree), or ""
Note string // what the chapter says about this row, if anything
}
// Forms are the count triples the records write, as RE2 with disjoint
// alternatives: "0 C / 4 I / 8 M", "0 C, 4 I, 8 M", "0 Critical, 4
// Important, 8 Minor" (also "0 Critical, 0 Important and 5 Minor"), and the
// two-count "7 I / 19 M" (no Critical count written; read as 0, which the
// row's Note says). A triple wrapped across a line break is read by joining
// the lines (Label.Span), and the unlabelled-line scan joins each line with
// the next for the same reason. The bare "0 / 5 / 22" of DECISIONS.md:3615
// is not a form: it is matched only as an Also line.
var Forms = regexp.MustCompile(`(\d+) C / (\d+) I / (\d+) M|(\d+) C, (\d+) I, (\d+) M|(\d+) Critical, (\d+) Important(?:,| and) (\d+) Minor|(\d+) I / (\d+) M`)
// bare matches the Also-only form.
var bare = regexp.MustCompile(`(\d+) / (\d+) / (\d+)`)
// Labels is the record as chapter 55 reads it, checked at 420b870
// (2026-11-09). The status rows of CONTEXT.md are canonical; DECISIONS.md
// is read where CONTEXT.md has no count (Part V, and the two Part VII re-derivations)
// and checked for agreement where both carry one. Excluded lines, with the
// reason, are in Excluded.
var Labels = []Label{
{File: "CONTEXT.md", Line: 42, Ordinal: 1, Part: "IV", Review: "final", Round: 1, Also: "DECISIONS.md:1096"},
{File: "DECISIONS.md", Line: 1690, Span: 2, Ordinal: 1, Part: "V", Review: "part", Round: 1, Note: "CONTEXT.md has no count for Part V; the count is wrapped across two lines"},
{File: "DECISIONS.md", Line: 1697, Ordinal: 1, Part: "V", Review: "final", Round: 1, Note: "CONTEXT.md has no count for Part V"},
{File: "CONTEXT.md", Line: 44, Ordinal: 1, Part: "VI", Review: "part", Round: 1, Also: "DECISIONS.md:1741"},
{File: "CONTEXT.md", Line: 44, Ordinal: 2, Part: "VI", Review: "final", Round: 1, Also: "DECISIONS.md:1747"},
{File: "CONTEXT.md", Line: 44, Ordinal: 3, Part: "VI", Review: "xcheck", Round: 1},
{File: "CONTEXT.md", Line: 45, Ordinal: 1, Part: "VII", Review: "xcheck", Round: 1, Also: "DECISIONS.md:2982"},
{File: "CONTEXT.md", Line: 186, Ordinal: 1, Part: "VII", Review: "part", Round: 1, Also: "DECISIONS.md:3114"},
{File: "CONTEXT.md", Line: 186, Ordinal: 2, Part: "VII", Review: "final", Round: 1},
{File: "CONTEXT.md", Line: 186, Ordinal: 3, Part: "VII", Review: "rereview", Round: 1},
{File: "CONTEXT.md", Line: 47, Ordinal: 1, Part: "VII", Chapter: "42", Review: "chapter", Round: 1, Note: "no Critical count written; read as 0"},
{File: "CONTEXT.md", Line: 47, Ordinal: 2, Part: "VII", Chapter: "42", Review: "chapter", Round: 2, Note: "no Critical count written; read as 0"},
{File: "CONTEXT.md", Line: 48, Ordinal: 1, Part: "VII", Chapter: "42", Review: "rereview", Round: 1, Note: "the review of fix 6, after the own-notice rule, a change made after the chapter reviews, not a review of the chapter; fix 7 was not re-reviewed"},
{File: "DECISIONS.md", Line: 2992, Ordinal: 1, Part: "VII", Chapter: "40", Review: "task", Round: 1, Note: "the fable-reviewer re-derivation of the ledger and resume rule"},
{File: "DECISIONS.md", Line: 2994, Ordinal: 1, Part: "VII", Chapter: "43", Review: "task", Round: 1, Note: "the fable-reviewer re-derivation of Local's isolation claims"},
{File: "CONTEXT.md", Line: 52, Ordinal: 1, Part: "VIII", Review: "part", Round: 1},
{File: "CONTEXT.md", Line: 52, Ordinal: 2, Part: "VIII", Review: "final", Round: 1},
{File: "CONTEXT.md", Line: 52, Ordinal: 3, Part: "VIII", Review: "xcheck", Round: 1, Also: "DECISIONS.md:3454"},
{File: "CONTEXT.md", Line: 53, Ordinal: 1, Part: "VIII", Chapter: "46", Review: "task", Round: 1, Also: "DECISIONS.md:3460", Note: "the Opus reviews of Tasks 0-2 summed in the record, not one review"},
{File: "CONTEXT.md", Line: 53, Ordinal: 2, Part: "VIII", Chapter: "46", Review: "chapter", Round: 1},
{File: "CONTEXT.md", Line: 54, Ordinal: 1, Part: "VIII", Chapter: "47", Review: "task", Round: 1, Note: "the Opus reviews of Tasks 0-2 summed in the record, not one review"},
{File: "CONTEXT.md", Line: 54, Ordinal: 2, Part: "VIII", Chapter: "47", Review: "task", Round: 2, Also: "DECISIONS.md:3462", Note: "the fable-reviewer re-derivation of the gate"},
{File: "CONTEXT.md", Line: 54, Ordinal: 3, Part: "VIII", Chapter: "47", Review: "chapter", Round: 1},
{File: "CONTEXT.md", Line: 55, Ordinal: 1, Part: "VIII", Chapter: "48", Review: "task", Round: 1, Note: "the Opus reviews of Tasks 0-2 summed in the record, not one review"},
{File: "CONTEXT.md", Line: 55, Ordinal: 2, Part: "VIII", Chapter: "48", Review: "task", Round: 2, Also: "DECISIONS.md:3465", Note: "the fable-reviewer re-derivation of the chain, anchor and redactor"},
{File: "CONTEXT.md", Line: 55, Ordinal: 3, Part: "VIII", Chapter: "48", Review: "chapter", Round: 1},
{File: "CONTEXT.md", Line: 56, Ordinal: 1, Part: "IX", Review: "xcheck", Round: 1, Also: "DECISIONS.md:3608"},
{File: "CONTEXT.md", Line: 56, Ordinal: 2, Part: "IX", Review: "part", Round: 1},
{File: "CONTEXT.md", Line: 56, Ordinal: 3, Part: "IX", Review: "final", Round: 1},
{File: "CONTEXT.md", Line: 57, Ordinal: 1, Part: "IX", Chapter: "49", Review: "task", Round: 1, Also: "DECISIONS.md:3615", Note: "the Opus reviews of Tasks 0-2 summed in the record, not one review"},
{File: "CONTEXT.md", Line: 57, Ordinal: 2, Part: "IX", Chapter: "49", Review: "chapter", Round: 1},
{File: "CONTEXT.md", Line: 58, Ordinal: 1, Part: "IX", Chapter: "50", Review: "task", Round: 1, Note: "the Opus reviews of Tasks 0-2 summed in the record, not one review"},
{File: "CONTEXT.md", Line: 58, Ordinal: 2, Part: "IX", Chapter: "50", Review: "chapter", Round: 1},
{File: "CONTEXT.md", Line: 59, Ordinal: 1, Part: "IX", Chapter: "51", Review: "task", Round: 1, Note: "the Opus reviews of Tasks 0-2 summed in the record, not one review"},
{File: "CONTEXT.md", Line: 59, Ordinal: 2, Part: "IX", Chapter: "51", Review: "task", Round: 2, Note: "the review of the Nix module"},
{File: "CONTEXT.md", Line: 59, Ordinal: 3, Part: "IX", Chapter: "51", Review: "chapter", Round: 1},
}
// Excluded names the lines whose count triples are not rows, and why.
var Excluded = map[string]string{
"CONTEXT.md:5": "the status summary repeats the Part VIII and IX rows of lines 52 and 56",
"CONTEXT.md:60": "Part X's cross-check, written at its boundary after this record was fixed at 420b870 and before its part and final reviews ran",
"CONTEXT.md:74": "repeats the Part VIII cross-check of line 52",
"CONTEXT.md:187": "a review of side work at the Part VII boundary, not of a part or a chapter",
"DECISIONS.md:3116": "repeats the Part VII final review of CONTEXT.md:186 (0 C, 3 I, 4 M), wrapped across two lines",
"DECISIONS.md:3126": "repeats the Part VII scoped re-review of CONTEXT.md:186 (0 C, 0 I, 4 M), wrapped across two lines",
"DECISIONS.md:3041": "repeats the Part VII part review of CONTEXT.md:186 (also at DECISIONS.md:3114, the Also line)",
"DECISIONS.md:4071": "repeats Part X's cross-check of CONTEXT.md:60",
}
The reading of a review’s kind and round is not machine-readable from prose, so a hand-labelled table, Labels, names each count triple by file and line, and derive re-reads every named line and refuses when a line no longer carries the counts its label was written against. Moving one count shows it. With CONTEXT.md:44’s 0 C / 0 I / 13 M changed to 14 M in the working tree, go test -run TestProductionCSVCurrent ./labs/ch55 fails on straylight with
--- FAIL: TestProductionCSVCurrent (0.00s)
lab_test.go:175: derive: CONTEXT.md:44 reads 0/0/14 but DECISIONS.md:1741 reads 0/0/13
because the two files carry the same review and the label requires them to agree. The test reads the working tree’s two files and the CSV is committed with them, so editing either file without regenerating the CSV fails the lab on purpose.
Production is one row of the record, and Clean the test a series stops at:
// Production is one row of the book's own record: a review round of one
// chapter or part, with its finding counts, from the committed CONTEXT.md
// and DECISIONS.md (the file and line each row names are in the CSV).
type Production struct {
Part string `json:"part"`
Chapter string `json:"chapter,omitempty"`
Review string `json:"review"` // task | chapter | part | final | rereview | xcheck
Round int `json:"round"`
Critical int `json:"critical"`
Important int `json:"important"`
Minor int `json:"minor"`
Source string `json:"source"` // file:line
}
// Reviews are the kinds a row may carry, in the order a part's reviews
// run: the cross-check of the plans, then, after the chapters, the part
// review, the final review and its re-review. task and chapter reviews are
// ordered by Round within their chapter.
var Reviews = []string{"xcheck", "task", "chapter", "part", "final", "rereview"}
// Total is the row's findings of every severity.
func (p Production) Total() int { return p.Critical + p.Important + p.Minor }
// Clean is a review that found nothing above Minor, the state at which the
// book's rounds stop.
func (p Production) Clean() bool { return p.Critical == 0 && p.Important == 0 }
Summarize groups the rows into series and Rounds prints the summary above:
// Series is the reviews of one chapter (Chapter set) or one part (Chapter
// empty), in the order they ran, and what they reached.
type Series struct {
Part, Chapter string
Rows []Production
CleanAt int // 1-based index of the first clean review; 0 when the record has none
FirstShare float64 // findings in the first review over the series' total; NaN with one review or no finding
}
// Summary is the record the way chapter 55 reads it.
type Summary struct {
Rows int
Critical, Important, Minor int
Chapters, Parts []Series
PerRound []float64 // every row's Total, sorted
Median, MedianLo, MedianHi float64 // nearest-rank median of PerRound and its order-statistic bounds
MedianJ, MedianK int // the ranks; 0 when n < 6 and the interval is refused
FirstShares []float64 // FirstShare over the series with two or more reviews, sorted
FirstShareMedian float64
CleanChapters, CleanParts int // series whose record reaches a clean review
OpenChapters, OpenParts int // series whose last recorded review is not clean (fixed without a re-review, or still open)
}
// Summarize reads the rows into a Summary. Rows are grouped into series by
// (part, chapter) and ordered by Reviews then Round; a series with
// a chapter is a chapter series, one without a part series.
func Summarize(ps []Production) Summary {
s := Summary{Rows: len(ps)}
groups := map[string][]Production{}
var order []string
for _, p := range ps {
s.Critical += p.Critical
s.Important += p.Important
s.Minor += p.Minor
s.PerRound = append(s.PerRound, float64(p.Total()))
k := p.Part + "\x00" + p.Chapter
if _, ok := groups[k]; !ok {
order = append(order, k)
}
groups[k] = append(groups[k], p)
}
sort.Float64s(s.PerRound)
for _, k := range order {
rows := groups[k]
sort.SliceStable(rows, func(i, j int) bool {
ri, rj := reviewIndex(rows[i].Review), reviewIndex(rows[j].Review)
if ri != rj {
return ri < rj
}
return rows[i].Round < rows[j].Round
})
ser := Series{Part: rows[0].Part, Chapter: rows[0].Chapter, Rows: rows, FirstShare: math.NaN()}
for i, p := range rows {
if p.Clean() {
ser.CleanAt = i + 1
break
}
}
if total := seriesTotal(rows); len(rows) >= 2 && total > 0 {
ser.FirstShare = float64(rows[0].Total()) / float64(total)
s.FirstShares = append(s.FirstShares, ser.FirstShare)
}
if ser.Chapter != "" {
s.Chapters = append(s.Chapters, ser)
if ser.CleanAt > 0 {
s.CleanChapters++
} else {
s.OpenChapters++
}
} else {
s.Parts = append(s.Parts, ser)
if ser.CleanAt > 0 {
s.CleanParts++
} else {
s.OpenParts++
}
}
}
sort.Float64s(s.FirstShares)
s.Median = stats.Quantile(s.PerRound, 0.5)
iv, j, k := stats.QuantileInterval(s.PerRound, 0.5, 0.95)
s.MedianLo, s.MedianHi, s.MedianJ, s.MedianK = iv.Lo, iv.Hi, j, k
s.FirstShareMedian = stats.Quantile(s.FirstShares, 0.5)
return s
}
// Rounds summarises the record the way chapter 55 reads it: findings per
// round by severity, the share found in the first round, and the number of
// rounds to a clean review per chapter, with nearest-rank quantiles and
// their order-statistic intervals where n allows (QuantileInterval refuses
// otherwise, and the summary says so).
func Rounds(ps []Production) string {
s := Summarize(ps)
var b strings.Builder
fmt.Fprintf(&b, "rows %d findings critical=%d important=%d minor=%d\n", s.Rows, s.Critical, s.Important, s.Minor)
if s.MedianK > 0 {
fmt.Fprintf(&b, "findings per review: median %s 95%% order-statistic interval [%s, %s] ranks (%d, %d) of n=%d\n",
num(s.Median), num(s.MedianLo), num(s.MedianHi), s.MedianJ, s.MedianK, len(s.PerRound))
} else {
fmt.Fprintf(&b, "findings per review: median %s interval refused (n=%d, fewer than %d)\n", num(s.Median), len(s.PerRound), stats.MinNForQuantile(0.5, 0.95))
}
if len(s.FirstShares) > 0 {
fmt.Fprintf(&b, "share of a series' findings in its first review: median %s over %d series with two or more reviews\n", num(s.FirstShareMedian), len(s.FirstShares))
}
fmt.Fprintf(&b, "chapters: %d reach a clean review in the record, %d end on a review that is not clean\n", s.CleanChapters, s.OpenChapters)
fmt.Fprintf(&b, "parts: %d reach a clean review in the record, %d end on a review that is not clean\n", s.CleanParts, s.OpenParts)
write := func(label string, series []Series) {
for _, ser := range series {
fmt.Fprintf(&b, "%s %s", label, ser.Part)
if ser.Chapter != "" {
fmt.Fprintf(&b, " ch %s", ser.Chapter)
}
b.WriteString(":")
for _, p := range ser.Rows {
fmt.Fprintf(&b, " %s%d %d/%d/%d", p.Review, p.Round, p.Critical, p.Important, p.Minor)
}
if ser.CleanAt > 0 {
fmt.Fprintf(&b, " clean at review %d of %d", ser.CleanAt, len(ser.Rows))
} else {
fmt.Fprintf(&b, " no clean review recorded (%s)", plural(len(ser.Rows), "review"))
}
if !math.IsNaN(ser.FirstShare) {
fmt.Fprintf(&b, " first-review share %s", num(ser.FirstShare))
}
b.WriteString("\n")
}
}
write("part", s.Parts)
write("chapter", s.Chapters)
return b.String()
}
Who wrote it
commits.csv is git’s record of this repository at one named commit, 420b870 (the end of Part X’s third sub-plan), generated by the same program and pinned by TestCommitsCSVCurrent:
| key | value | count |
|---|---|---|
| commits | 786 | |
| subjects naming a fix | 270 | |
| trailer | Claude Sonnet 5.5 | 407 |
| trailer | Claude Opus 5.5 (1M context) | 268 |
| trailer | Claude Fable 5.1 | 43 |
| trailer | Claude Opus 5.5 | 42 |
| trailer | Claude Haiku 4.5 | 28 |
| trailer | Claude Sonnet 5 | 3 |
| trailer | crossbar/ornith-1.5-35b-a3b | 2 |
| trailer | Claude Haiku 5.5 | 1 |
A subject names a fix when it matches (?i)\bfix(es|ed|ing)?\b: word-bounded, so “fixture” is not one (a bare case-insensitive fix would count 276). A trailer is the Co-Authored-By value without its address. The trailers sum to 794 over 786 commits because some commits carry two trailers and a few none (a count of git log, not of the CSV); a trailer names the model that wrote the commit. The two spellings of Opus are kept apart because the record keeps them apart. The two crossbar/ornith-1.5-35b-a3b commits are the book’s own local model writing into its own repository, both changes to the book’s reader-column style.
The ruling count is a grep count and is loose by construction. For ids the entries name, drop the word, fold case, keep only ids that contain a digit (which removes “ruling of”, “rulings at” and “rulings that”), and count distinct:
git show COMMIT:DECISIONS.md | grep -oi 'rulings\? [A-Za-z0-9-]\+' | sed 's/^[Rr][Uu][Ll][Ii][Nn][Gg][Ss]\? //' | tr A-Z a-z | grep '[0-9]' | sort -u | wc -l
That prints 82 at d8e1a2d, master before Part X began, and 100 at 420b870, on straylight. A range such as “8a-1..8c-5” contributes its first id only, so the count is a lower bound on rulings. The ledgers’ own form is different: Part II’s progress.md on talos (checkout a9d1cef, read 2026-11-09) has 48 lines containing Ruling. Of those, 46 begin with it, and line 45 carries a ruling in the ledger’s form (“Ruling: no change, contract documented — cost if wrong: none”) after a review note; only line 165 is a mention. By hand that is 47 rulings, 46 if line 102, which refines line 101, is folded into it, against the grep count of 48.
The commands and the reader’s data
aec-work paired and aec-work production are the two case lines added to chapter 52’s run switch; each returns an exit code, 2 for a usage error after printing the usage line, 1 for a read error and, for paired only, 4 for the refused verdict. The reader’s own paired lab is his: the CSV is ~/Work/aec-runs/part10-paired/paired.csv, outside the repository and never committed, and no number of his appears in this book unless he puts it in this chapter’s margin.
Exercises
(a) Derive the floor for 95% and for 99%, and say why the bound is the median’s.
Answer
The extremes bound the median with probability . For 95%, gives , so 6. For 99%, gives , so 8: at the probability is and at it is . The bound is the median’s because it counts observations below the quantile: the number below the median is Binomial, and the interval fails only when that number is or . The mean has no such count: whether the sample mean is above or below the true mean depends on the sizes of the observations, not only their sides, so there is no distribution-free analogue for it.
(b) Run the sign test and Wilcoxon’s signed-rank test on the synthetic rows. What do they say, and how do they compare with the bootstrap interval?
Answer
The differences are : three negative and three positive. The sign test’s two-sided is , with for . For Wilcoxon, rank as . The positive differences are , so , and , which sum to . Enumerating the sign assignments over those ranks, 13 give , so the two-sided is ; the table’s two-sided 5% critical value at is 0, and 6 is not at or below it. Neither test finds evidence, which agrees with the interval crossing zero.
(c) Compute the resolution on the synthetic rows: how many pairs would it take to resolve a 3-minute mean saving, at 50% and at 80% power?
Answer
The six deviations from are , whose squares sum to , so , and , the naive error as printed. A 3-minute mean saving is resolved about half the time at , so 32 pairs, and with 80% power at , so 66 pairs. Both use the normal approximation, which is generous at these sizes.
(d) Why is the clustered error below the naive one on these rows, and what would a clustered error above the naive one mean for the reader’s own task kinds?
Answer
Within a cluster the cross term is over residuals from the grand mean. Here the clusters’ residuals sum to and because the cluster means, and , are within of , so the terms are and and nearly cancel the independent variance: and . Chapter 38’s sentence: the clustered error is not a floor, and the cross terms are negative when the cluster means vary less than independent trials would make them. A clustered error above the naive one means the residuals lean the same way inside each kind, so the kinds differ from each other by more than the noise: the agent helps in one kind and hurts in another, or helps much more in one. The reader should read the result by kind and not as one mean.
(e) From production.csv, compute Part IX’s first-review share by hand. Why does no chapter series have a clean review recorded, and what would a re-review per chapter have cost and bought?
Answer
Part IX’s rows are 0/13/16, 0/2/9 and 0/0/11: totals , and , so the first review’s share is , matching rounds.txt. A chapter series ends on a review that is not clean because the fix round after a chapter review was read by the part and final reviews that came next and, in the record’s words, was in some cases “verified by the controller’s reading of its gate log, not by a further review” (CONTEXT.md:50; :49 reads “gate log and tables”); the record counts what was written down with a triple. A re-review of each of the nine chapters would have added nine reviews to the record’s 36, a quarter more, each at the record’s median of 15 findings per counted review to read. What it would have bought the record cannot say: the part reviews read all the chapters and found Important findings in four of the five parts that have one (Parts V, VII, VIII and IX), and which of those were in a chapter’s fix round is not recorded.
(f) Solve the delegation inequality for with the budget of chapter 53’s loop.
Answer
with reads each of four rounds at : with , so delegation stops paying when . With a negligible wait and , a task the reader does alone in time is worth delegating only while each reading costs under about a quarter of what remains of after the spec. A task he can do in an hour with a ten-minute spec leaves 50 minutes, so under about 12 minutes per reading. With the record’s median of 15 findings per counted review (the 36 rows include six that sum three task reviews) that is under a minute a finding.
(g) On the replayed day the gate asked 330 attended prompts against Part VII’s 310. How many did it add on this daemon’s tools, and what would Mitchell’s thesis need measured that the day does not measure?
Answer
were added and none removed; 17 are patch calls, a tool this daemon lacks, so are the gate’s rules acting on this daemon’s tools (the three write_file calls on .bashrc files whose paths begin with ~, which the lexical rule reads as relative paths). The thesis is about the person’s answers: that oversight degrades with the use of the thing overseen. It needs the answers measured over the 330, how their quality and speed change across the day and across days, and the day replays calls and not people, so it measures none of it.
Lab
make lab CH=55 IMPL=mine runs go/labs/ch55 against go/labs/ch55/mine/effect.go; IMPL=ref runs it against internal/measure. The reader writes one piece, Effect: the refusal under MinN with NaN statistics and no error; the paired bootstrap interval of mean(after − before) through stats.Resampler{Seed, B}.Paired(after, before, level), in that argument order; the clustered error over the cluster column; the verdict from the interval against zero; Rule.Text() as the result’s text; and Registered’s value for a zero field. The tests that call it are TestRuleRefusesSmallN, TestEffectReproduces, TestVerdictBoundaries, TestClusteredSE and TestClusteredSEClustersOfOne. On straylight (2026-11-09) make lab CH=55 IMPL=ref passes, and with the stub unwritten make lab CH=55 IMPL=mine fails exactly those five.
The record’s tests run on the reference whichever IMPL is set, because they pin the committed record and not the reader’s code: TestProductionCSVCurrent and TestCommitsCSVCurrent regenerate the two CSVs and compare, TestRoundsSummary and TestRoundsGolden pin the summary and rounds.txt, TestSyntheticIsMarked requires the example’s first line to say so, and TestNoSecretsInTestdata reads the lab’s testdata for secrets.
The opt-in lab is the reader’s. The CSV lives at ~/Work/aec-runs/part10-paired/paired.csv, outside the repository: never committed, never read by a seat, never sent to any model. aec-work paired -csv ~/Work/aec-runs/part10-paired/paired.csv prints the rule before any number and nothing of the rows. The pairs are the same task class done both ways, in an order he alternates, the task chosen before the arm, in one unit throughout. The rule is the one registered in this chapter, so its reading cannot be chosen after the fact; the reader’s is printed before his verdict. His numbers are his to paste into this chapter’s margin or not, and aec-dataset build over his own aecd sessions stays under chapter 50’s rules for the builder: a private session is skipped before any line is read, and the dataset is written outside any git work tree. The worked example above is synthetic, and no number of his appears in this book unless he puts it there.
Further reading
- Joel Becker, Nate Rush, Elizabeth Barnes and David Rein, Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity, arXiv 2507.09089 (v2, 2025). The randomised design, and the 19% slower against the 24% forecast.
- Sida Peng, Eirini Kalliamvakou, Peter Cihon and Mert Demirer, The Impact of AI on Developer Productivity: Evidence from GitHub Copilot, arXiv 2302.06590, 2023. One task, a treatment group 55.8% faster.
- Margaret Mitchell, Avijit Ghosh and Samir Passi, AI Agents Push Humans Out of the Loop, arXiv 2608.23642 (v3, 2026), as chapter 47 cites it: a position paper on oversight degrading with use.
- Lisanne Bainbridge, Ironies of automation90046-8), Automatica 19(6), 775–779, 1983. What is left to the operator.
- Raja Parasuraman and Victor Riley, Humans and Automation: Use, Misuse, Disuse, Abuse, Human Factors 39(2), 230–253, 1997, cited from its abstract: misuse as over-reliance.
- M. E. Fagan, Design and code inspections to reduce errors in program development, IBM Systems Journal 15(3), 182–211, 1976, its record verified through Crossref, cited for the design: a reading role, a checklist and a rate.
- Frank Wilcoxon, Individual Comparisons by Ranking Methods, Biometrics Bulletin 1(6), 80–83, 1945. The signed-rank test of exercise (b).
- Kelly Hong, Anton Troynikov and Jeff Huber, Context Rot: How Increasing Input Tokens Impacts LLM Performance, Chroma, July 2025, read 2026-11-09.
- Jiacheng Liu, Xiaohan Zhao, Xinyi Shang and Zhiqiang Shen, Dive into Claude Code: The Design Space of Today’s and Future AI Agent Systems, arXiv 2604.14228 (v3, 2026). The loop every harness shares.
- Anthropic, Measuring AI agent autonomy in practice, 18 February 2026, a vendor post; supplementary.
Chapter 38’s entries (Efron 1979, DiCiccio and Efron 1996, Miller 2024) are cited through chapter 38 and not relisted.