45.19 How this book is made now⧉
The appendix before this one is frozen on purpose. It describes a method that worked and then stopped being the method: an outline held what the book said, a compile step turned it into prose, and a human edit was triaged back upstream so the next compilation would not forget it. Two things happened to that plan. The prose got good enough to react to, so the author started editing the result rather than the specification. And the project grew a web edition, a course, hundreds of interactive demos and a search index, until one collaborator working one task at a time could not hold it, and became eleven agents with written ownership of separate parts of it.
Neither change was designed. Both were forced, and both cost something. This appendix records a checkpoint in that evolving process, including the costs; counts and implementation details refer to the snapshot described here.
45.19.1 From compiling a book to editing one⧉
The inversion is the important part. For a chapter that has been written, the draft is now the source. Nobody recompiles a drafted chapter from its outline, and the triage machinery that made recompilation safe has correspondingly less to do. The outline did not become useless: it still holds the structure of the book, the sources each section draws on, the figures a section needs, and the full specification for everything not yet drafted. A new part is still planned there before a word of it exists, and the five reconstruction parts written most recently were outlined first, chapter by chapter, and only then drafted. What the outline stopped being is the thing the prose is generated from.
What was lost is a real promise: that the whole book could be regenerated and come back with the author's corrections intact. That promise is gone, because the corrections now live in the prose itself. Three things replaced it. Version control, so every change to prose and tooling is committed and recoverable. Stable identifiers, so a section keeps its identity through any reorganization: each section carries an id that never changes, and permanent links, the readiness records, the reader's annotations and the assistant's navigation all key on that id rather than on a number. And gates, which is the subject of a later section: automated checks that fail the build when the pieces stop agreeing, since nothing else now guarantees that they do.
The same logic removed hand-typed numbers from the book entirely. A cross-reference is written as a link to a title, and the chapter or part number is resolved when the book is built. This sounds fussy until you measure it: when the rule was first enforced, of the forty-two hand-typed part numbers sitting in the drafts, forty-one named the wrong part. They had been correct when written, and the book had moved underneath them.
45.19.2 How the author and an agent work together⧉
The working loop is short. The author reads the rendered page, locally or on the deployed site, and says what should be different. An agent makes the change in the draft, carries any structural consequence back to the outline, rebuilds that chapter, runs the checks that apply, and reports what it did and what it skipped. The interface is the book, not the specification.
Several conventions make that loop cheaper than it sounds.
- The page can talk back. Reading tools are built into the pages themselves. A passage that reads like a machine wrote it gets flagged with one button, which writes a marker into the draft where the offending sentence is; the writing agent rewrites it in place, then searches the rest of the book for the same tic and fixes those too. Author prompts can be dropped inline as
{{write: ...}},{{fig: ...}}or{{todo: ...}}and collect into an agenda, so "this needs a third example" can be left in the margin at reading speed and picked up later by whichever agent owns it. - Batches run to completion. A list of ten edits is worked to the end in one go, not reported on halfway. The author's standing instruction is to stop only at a genuine roadblock, and to finish with an audit of what is left rather than a progress note. A checkpoint that asks "shall I continue" costs a reply and buys nothing.
- Defaults are chosen, not asked about. An agent that can infer the answer from the repository, the conventions, or the surrounding chapters is expected to act and say what it assumed. Questions are for decisions that are genuinely the author's and would change the work.
- A correction outranks everything. When the author says a caption is wrong, or that a figure's measurement contradicts the prose, that is the strongest signal in the system, and it propagates: the same claim is hunted down everywhere else it appears. Several of this book's captions were rewritten because the agent that built the figure measured the effect and found the text had it backwards.
- A prompt sent to the wrong agent gets pushed back. With eleven owners, the author does not track who owns what, and does not have to. An agent handed something outside its area says so in one line, names the owner, and offers to file the handoff; the author can override, and then the work is done and the owner is told what changed in their area. Silent compliance and silent refusal are both failures, because both destroy the usefulness of the map. One agent, dispatch, exists only to read a request and name its owner, which removes even that decision from the author.
- Publishing is never assumed. An agent builds freely and deploys only when the author asks for it in that message. Approval to deploy does not carry over from the previous message, and "yes" to something else is not authorization. The reason is blunt: a deploy ships the entire site at once, including whatever else eleven agents happen to have in flight.
- Everything is logged. Every instruction the author gives is appended verbatim to a running log. It is the real record of the human direction, it is where the word-count accounting in this appendix comes from, and it is the only artifact that would let someone reconstruct how the method changed.
What stays human has not moved since the first appendix said it. The author chooses the structure and the argument, decides what matters and what to cut, marks how finished each chapter is with a number that is theirs and not a guess, and owns every claim that remains. What changed is that the machinery around that judgment got much larger, and the judgment got correspondingly more leveraged.
45.19.3 Eleven agents and an ownership map⧉
The work is split among eleven agents, each with a written mandate, an explicit list of the paths it owns, and an equally explicit list of what it does not: the build and publishing pipeline; the chapter prose; the still figures, video and cover art; the interactive figures and demos; the lecture notes and the class view; the slides; the problem sets; the assistant and its retrieval index; the browser raw developer; the clearing of third-party figure permissions; and the dispatcher.
They are separate sessions with separate contexts. They cannot see each other's conversations and there is no shared memory, so every mechanism that holds them together is a file. Two rules do most of the work. An ownership document answers "may I edit this", path by path, and it is the authority rather than a suggestion. And seeing something wrong in another agent's area is a reason to report it, not to fix it. That second rule is counterintuitive and was learned expensively: an agent once restored a deleted renderer by writing a second module beside the original, and the project now carries two where one belongs. Editing inside someone else's area is allowed in exactly two cases, an explicit override from the author, or a one-line fix to unblock your own work, and either way it owes the owner a note.
45.19.4 The files that hold it together⧉
Four kinds of file carry everything that used to travel in a conversation.
- A shared contract, loaded automatically into every session, holding only the conventions that more than one agent depends on: the identifier spaces that keep colliding, the rules about numbers and links, the traps that have already cost a day. It carries its own maintenance rule, which is that a new convention is recorded there in the same change that introduces it. A convention that lives in one agent's context does not exist.
- A state file per agent, four headings: what I am in the middle of, precisely enough to resume; the ordered queue; what I am blocked on and who owns it; plus the traps a fresh session would walk into. It is updated at every checkpoint and before stopping, and it is the first thing a replacement session reads. Sessions do end mid-task, and this is what makes that cost one step instead of a day.
- An inbox per agent, for anything crossing a boundary, with a status that moves from new to claimed to done. A commit message is not a handoff, because no agent reads another's commits. There is no polling: an idle agent does nothing, deliberately, because waking one costs money and pushes its accumulated context toward compaction, and the accumulated context is most of what makes it useful.
- An objections file. An agent that thinks a rule is wrong writes down which rule, why it is wrong for its area, and what should replace it, and the rule is either defended or changed. The alternative to a place for disagreement is not agreement; it is silent non-compliance, which is the failure this replaces.
The arrangement came out of an audit in which each agent examined its own area and reported what was broken. The findings agreed almost exactly. The tooling was good; the seams between areas were not; nobody formally owned anything; there was no channel between agents; and failure was normally silent. A lecture deck was published for two weeks without the author's own edited slides. A renderer was deleted while the pipeline kept reporting success. Eighteen finished cover animations were never shipped because nobody was told they were ready. Every one of those was found by the author noticing, which is the most expensive detector in the system.
45.19.5 Skills: writing down what you repeat⧉
The audit's largest single finding was an empty layer. Across every role there were zero written procedures, so each agent reconstructed the same sequences from scratch every session, and each reconstruction was a chance to skip the step that matters. The answer is a skill: a short document that states, in order, when to use it and when not to, what must be true first and how to check, the actual commands with their traps inline, which verifiers to run and what a pass looks like, how to confirm the change reached the reader rather than only the disk, and what to write back to the state file.
There are about thirty of them, and they are deliberately about what is repeated rather than what was once done. The ones that carry the most weight are the ones whose steps are easy to get almost right: writing-style, which loads the prose contract and is mandatory before anyone writes a word a reader will see, including captions, slide text and reports; book-deploy, which is the full publish sequence with its gates; chapter-section-add, which is drafting a section complete with its identifiers, tags, notation table and rebuild; figure-add and interactive-figure-add, which each end in a verification step because both have shipped invisible figures before; deck-publish, which exists because a deck is five things and looks healthy when it is missing one of them; and dispatch-route, which is how a prompt finds its owner.
45.19.6 The gates⧉
Twenty-six numbered checks run inside the publish script, and most of them can stop a deployment. They check that every internal link and redirect resolves; that no part or chapter number has been hand-typed into prose; that every chapter with equation symbols carries the notation table its tooltips are built from; that the demo index and the demo finder agree; that an interactive figure has both a poster and a copy in the published tree, and a version stamp so readers do not get a stale one; that the search index and the pages about to ship agree, so the assistant cannot cite a page that does not exist; that a published lecture deck carries its author's edits; that the problem-set handout a student downloads matches the LaTeX it came from and still compiles once unzipped; that the color pipeline still reproduces its calibrated numbers; and that the process described in this appendix is itself alive, meaning every agent has a current state file, every claimed path is claimed exactly once, and no inbox entry has sat unclaimed too long.
Every one of them exists because something failed silently once, and the silence is the point. A green log is not evidence, so a check is written against the artifact rather than against the process that was supposed to produce it: the deployed page rather than the alias, the rendered page rather than the DOM, the unzipped handout rather than the build that made it. Two of the twenty-six are opt-in rather than automatic, because they render every page in a real browser or send them to a vision model, and a gate nobody can afford to run is not a gate.
The standing preference, after a year of this, is to answer an incident with a gate rather than with a rule. A rule is a sentence in a document that a tired human or a fresh agent will not have read. A gate is a script that fails the build.
45.19.7 What goes wrong now⧉
The failure modes moved. With one collaborator the thing to fear was fabrication, and the defenses were source-grounding, fresh context per section, and single-source registries, all of which are still in place and still doing their job. With eleven agents in one working copy, the expensive failures are coordination.
Two agents edit the same file on the same day. One agent's cleanup sweeps up another's uncommitted work. A verifier passes because the thing it was checking was being rebuilt underneath it. Two builds run at once, and since the publish script deletes and regenerates the whole output directory, the second pulls the tree out from under the first, and it does not fail as a race: it fails as a content bug, complaining about a file it had listed a second earlier or about hundreds of chapters that suddenly have no page. Work finishes and is never handed over, because the agent that finished it wrote a commit message instead of an inbox entry. A regular expression written for one chapter matches nine others.
None of those are model failures. They are the ordinary hazards of concurrent engineering, arriving in a project where the participants cannot talk to each other and where each of them is fast enough to do a great deal of damage between two of the author's messages. The answer has been the same each time: write the check, name the owner, and record the trap in the file a fresh session reads first.
45.19.8 What it cost⧉
The book's text now comes to about 1,417,000 words: an outline of roughly 267,000 and about 1,150,000 words of drafted chapters, across 44 parts. Against that, the direction typed by the author, every prompt in the verbatim log, comes to about 92,000 words. The drafted prose is therefore roughly 12 times the typed direction and the whole generated text about 15 times, which is an output-to-input ratio and not a measure of authorship, since the model expanded under that direction and against a pre-existing corpus of roughly 460,000 words of lectures, slides and problem sets.
The token accounting is more interesting than it used to be, because every session is recorded on disk and can simply be counted. Across 917 sessions on this project, the models wrote about 134 million tokens and read about 12 million tokens of fresh input, so roughly 146 million between them. That is the sum of those two reported token categories, not necessarily a billing-equivalent total, and it is where the earlier appendix's "about 100 million" has landed since.
There is a second number, larger by two orders of magnitude. A model has no memory between turns, so the entire working context, the chapter, the conventions, the files already read, is presented again on every turn. Counted that way the project comes to about 41 billion tokens, of which 39.6 billion were served from a prompt cache rather than processed fresh. The gap between 146 million and 41 billion is not waste exactly. It is what it costs to have a collaborator that must be handed its whole desk again every time it is asked a question, and the cache is why that is affordable at all. It is also the clearest measure of what the files described in this appendix are really for: a state file exists because context is a wasting asset, and every convention written down is one that does not have to be re-derived on the next turn.
Put roughly into energy, at a wide and uncertain 0.1 to 1 watt-hour per thousand tokens for large-model inference, the 146 million generated and freshly read tokens land somewhere between 15 and 150 kWh, with cached-context processing adding an unknown amount; lower cache pricing does not directly establish proportional energy savings. This is a sensitivity calculation using assumed rates, not a measurement of the project's electricity use. Streaming high-definition video costs roughly 0.1 kWh an hour, so those illustrative assumptions give a few hundred hours of streaming as an order-of-magnitude comparison, not a measured equivalence. Two caveats, both from the earlier appendix and both still true: this counts inference only, not the enormous and amortized cost of training the model, and the per-token energy of frontier models is not public, so the bracket is deliberately an order of magnitude wide.
45.19.9 The bundle⧉
A description of a process is worth less than the process. Everything above ships as a downloadable archive, copied verbatim from the book's repository: comp-photo-agent-process.zip, around seventy files and under 300 KB, rebuilt on every deploy so it never falls behind the book.
Inside it: the shared contract that is auto-loaded into every session; the process document and the ownership map; the eleven per-role instruction files; the objections file; the state-file template and the inbox format; every skill; and seventeen scripts, chosen as the ones worth reading rather than the ones with the most lines. Those include the renderer that turns a draft into the page you are reading, the single module that owns the book's tree and resolves every wikilink, the stable-identifier system with its history file, the publish script with its twenty-six gates in the order they run, and the individual verifiers behind them.
What is deliberately not in it: the agents' inboxes and state files, which are working notes about unfinished work rather than method, and anything holding a credential. The scripts are there to be read rather than run, since they expect this book's own repository around them. The shapes are the transferable part.
If you take one thing from the archive, take the publish script and read it from top to bottom. It is a list, in order, of everything this project has learned to fear.