The book as a graph
Creating a Book Using Agentic Workflows v0.2.0, decomposed all the way to the word and provably put back together. Six levels: book → chapter → section → block → sentence → word. Built by admin/build/gen_bookgraph.py from the chapter markdown, which stays the authored source.
Why this exists, and it is not because a graph is interesting. Brief 42 asks for the book’s opening to change: a new first part, the history moved behind it. Doing that by hand is exactly the edit the founder says broke his earlier books — “you almost start to be locked by the first version of the content, because making changes becomes quite painful.” Doing it as a transformation on this graph, with a gate proving every chapter that was not meant to move is byte-identical, is the thing a word processor cannot do. Every chapter below rebuilt byte-identical on this build. That is the claim the restructure rests on.
| # | Chapter | Sections | Blocks | Words | Forms | Identities | Graph |
|---|---|---|---|---|---|---|---|
| 01 | Creating a Book Using Agentic Workflows | 7 | 32 | 1,183 | 441 | 39 | json |
| 02 | 1 · The loop | 7 | 38 | 1,689 | 627 | 45 | json |
| 03 | 2 · The first book, and the pivot that saved the second | 6 | 42 | 1,757 | 593 | 48 | json |
| 04 | 3 · Briefs as the contract | 8 | 51 | 1,829 | 624 | 59 | json |
| 05 | 4 · Gates buy speed | 8 | 48 | 1,922 | 655 | 56 | json |
| 06 | 5 · From a page to an instrument | 8 | 56 | 1,558 | 554 | 64 | json |
| 07 | 6 · Two agents, one repository | 7 | 46 | 1,549 | 549 | 53 | json |
| 08 | 7 · The failures, lovingly | 15 | 70 | 2,427 | 759 | 85 | json |
| 09 | 8 · Reviewing out loud | 8 | 51 | 1,619 | 559 | 59 | json |
| 10 | 9 · The experiments | 7 | 69 | 2,238 | 709 | 76 | json |
| 11 | 10 · The founder's craft | 8 | 45 | 1,424 | 548 | 53 | json |
| 12 | 11 · The playbook | 15 | 84 | 1,795 | 624 | 99 | json |
| 13 | 12 · What it costs, and where it loses | 16 | 43 | 1,636 | 573 | 59 | json |
| 14 | Appendix A · One brief, annotated | 13 | 57 | 2,351 | 632 | 70 | json |
| 15 | Appendix B · The chronology | 8 | 17 | 87 | 54 | 25 | json |
| 16 | Appendix C · The harness | 16 | 41 | 607 | 295 | 57 | json |
| 17 | Colophon | 8 | 32 | 1,331 | 512 | 40 | json |
| The book | 165 | 822 | 27,002 | — | — | index.json |
What each chapter folder holds
| File | What it is |
|---|---|
index.json | the chapter’s section skeleton, counts and shard pointers |
sec-NN.json | one shard per section: its blocks, sentences and word instances |
fmt.json | the formatting graph — heading lines, gaps and raw markdown per block. This is the half that makes the rebuild possible; the semantic shards are provably derivable from it |
words.json | one node per distinct form, with every instance |
tokens.json | the token analysis: classes, stem families, co-occurrence |
ids.json | the identity ledger — short opaque uids carried across edits, so a cross-reference survives a rewrite |
Sharded per chapter, on purpose. Brief 43 flagged size as a strain before any code was written, and it was right: this graph is 3,646,054 bytes against 552KB for the single pilot document. Opening one chapter fetches one chapter. The estimate made before building was ~4MB; the measured figure is 3.6MB.
What this does not yet do. There is no explorer here — this page is a table, not the instrument brief 43 asks for (“the visualisation of that parser… is more important than the actual output”). That is activity A5. The five reading levels are A4, and the restructure this all exists to enable is A6. The plan tracks all seven.