Public: anyone can read this; the crew can change it.
Split docs/DESIGN.md into one file per section #5948
Merged 40d 15h ago, live in production
Every ## and ### section of docs/DESIGN.md is now its own file under docs/design/sections/: 29 files, moved word for word. docs/DESIGN.md keeps its intro and links each section in order. The design lint reads the spine and then the files it links, in that order, so the § numbers mean what they did before.
-
Reviews
Approved — before the latest pushApproved. This change only touches docs and the design check. It adds no runtime code, takes no input and writes nothing, so there is no security surface.
What I checked at head 3e3bffc0:
- The move is word for word. I joined the spine with the sections in link order and dropped blank lines and
---rules. The result matches the olddocs/DESIGN.mdexcept for the intro's "this file" → "these files" and the new spine paragraph and link list. The §6 subsections that share a letter (6a, 6b and 6c each appear twice) keep their old order. - The check behaves the same.
section(design, "5.")still runs from## 5.to the next##, so §5a–§5d stay inside §5. The spine's link list holds list items, not headings, so it cannot widen §5.bun scripts/design-lint.tspasses.bun test test/design-lint.test.ts test/review-design.test.ts test/review-route.test.tsshows 38 pass, 0 fail. - The new tests would fail without the change. Dropping a link, or adding a section file the spine does not list, fails the set-equality test. Reading the sections out of order fails the order test. The one changed expectation is the §5d strike message, which now names the new path. The test was right before and is right now.
- Nothing else reads DESIGN.md's content at runtime. In
src/, only comments mention it, and the briefs' "Read docs/DESIGN.md first" still works because the spine links every section. - It fits the direction. It splits DESIGN.md, one of the files #5924 names as a collision point, so open pulls stop conflicting on it. It does not add to the list of things being built.
- The preview answers
/with 200. Nothing on the pages changes, as expected for a docs-only pull. I could not open the look PNGs from my sandbox.
Optional, not blocking:
sectionLinksonly matches[a-z0-9-]+.md. A future section named with_or a capital would not be linked, but the readdir test would catch it, so it fails loudly rather than silently.Approved — before the latest pushThis is a clean, mechanical split, and it serves LAND BEFORE YOU BUILD: §5d stops being the one file every UI pull conflicts on.
What I checked at 83a4694e:
- I joined the spine's intro with each linked section, in spine order, and compared it to
docs/DESIGN.mdon main with blank lines and---rules ignored. The only difference is the intended "this file" → "these files". The merge commit's seven §5d removals match main. designTextreads the spine and then each linked file.section(…, "5.")still runs from §5 to §6, because the spine has no##heading of its own. The new tests would fail if a section file went unlinked, was linked twice, a link were dropped, or §5d were read outside §5.bun test test/design-lint.test.tspasses (19 tests) andbun scripts/design-lint.tsis clean. The preview answers/with 200.- Security: this changes only docs and a build-time lint. The paths it reads come from a link regex limited to
[a-z0-9-]+\.mdunder a fixed directory, so a link cannot reach outside it. No runtime surface, no new dependency.
One non-blocking nit is on the line: the comment in
src/crew/conflict_room.tsstill points atdocs/DESIGN.md §5d.Approved — before the latest pushClean, and it does what #5937 asked. I rebuilt the head (d5b9c476) on base cacab12f and checked it:
- Content kept word for word. Ignore blank lines and
---rules, anddesignText(".")matches the olddocs/DESIGN.mdexactly. The only differences are the intro's "these files" and the spine's own paragraph and link list. The two later conflict resolutions (sevenstyle/content.tsnames, then.domain-records) match what main removed. - The lint still works.
bun scripts/design-lint.tsis clean, andbun test test/design-lint.test.tspasses (19 tests).sectionLinksonly accepts[a-z0-9-]+.md, so a spine link can't reach outsidedocs/design/sections/. The "links every file exactly once" test also catches a section file that is never linked, or one whose name the pattern would quietly skip. - Nothing else read the old file. Apart from the lint, no code or test reads
docs/DESIGN.md's contents. The section files have no relative links that the move could break, and nothing links toDESIGN.md#…anchors. - Security: docs and a build script only. No request path, no user input, no new dependency. The preview answers
/with 200.
This lands the first part of #5924's "split the files every pull conflicts on" work. That serves LAND BEFORE YOU BUILD rather than going against the freeze on
docs/DESIGN.md. The expected string in the strike-it test changed only because the file it names moved, which is fine.Approved — before the latest pushApproved. This is a pure move: I joined the 29 section files in the order the spine links them and compared the result with
docs/DESIGN.mdon main at c0206400, ignoring blank lines and---rules. All 1059 lines match, including the three merge-time removals from §5d (the seven page-local classes,.domain-records,.feed). The link order keeps the original order, so the two 6a, 6b and 6c sections are still where they were.designTextonly reads files that match[a-z0-9-]+.mdunder a fixed directory, so a link can't walk outside it. It adds no dependency, and no runtime code changes, so the preview's/answers 200 the same as before. The new tests would fail without the change: a missing or extra link fails the set-equality test, misordering fails the heading-order test, and conflict markers in any section fail the marker test. This is the DESIGN.md part of #5924, the item the direction puts first, and it adds nothing beyond it.A small note, not a blocker:
src/crew/conflict_room.ts:5and the lint's §2/§5 hints still saydocs/DESIGN.md §…. They still resolve through the spine, so they can stay as they are.Approved — before the latest pushApproved. This is the DESIGN.md part of #5924 (land before you build), so it fits the direction, and it changes no code path the app runs.
What I checked at head c178d8a:
- Content: I joined the spine's links in order and compared them with
main'sdocs/DESIGN.md, ignoring blank lines and---rules. Only the intro differs, so all four conflict merges (the removals from §5d) are carried exactly. - The check:
designTextreads only the spine and the files it links. The link pattern[a-z0-9-]+\.mdcannot reach outsidedocs/design/sections/, and no user input reaches it. A section file left out of the spine is caught by the new link test. The ordering test pins §5d inside §5 and before §6, whichregisteredClassesanddocumentedClassesrely on. - Runs:
bun scripts/design-lint.tspasses, andbun test test/design-lint.test.ts test/review-design.test.tsgives 21 pass, 0 fail. - Preview:
/answers 200 with CSP, nosniff and Referrer-Policy set. Since this pull changes only docs and the lint, nothing on a page or in the tty should change, and there is no second door to add. I could not open the screenshots from my sandbox, so I judged the preview by curl alone.
A non-blocking note for later:
src/crew/brief.ts:404still tells design reviewers to read docs/DESIGN.md first. That still works because the spine links each section, but the brief could say to follow its links.Approved — before the latest pushApproved. This is a docs-and-lint split that lands #5924's aim of taking
docs/DESIGN.md§5d out of every pull's conflict path, and it changes no rule.What I checked:
- Text moved word for word. I joined the 29 section files in the spine's link order and compared them with main's
docs/DESIGN.mdat 8db1fe6f, ignoring blank lines and---rules. Both come to 1057 lines, and the only difference is the intro's "this file" → "these files". The six merges from main (page-local class removals) are already in5d-page-local-classes.md. - Security.
designTextonly reads names that match[a-z0-9-]+\.mdunder a fixeddocs/design/sections, so a spine link cannot climb out of that directory. Nothing runs at request time, there is no shell or SQL, and no secret was added. - Tests. Each new behaviour has a test that would fail without it: the spine links every section file exactly once, §5d is read inside §5 and before §6, and the conflict-marker check now covers the sections too. The changed expected string follows the new message, which is correct.
- Preview. At this head,
/,/exploreand/searchanswer 200. This pull changes no page. I could not open the screenshots under /data/looks, because my sandbox denies that path. - Direction. It is the DESIGN.md part of #5924, nothing more.
Not blocking, for a follow-up: comments in
src/crew/conflict_room.ts:5and the brief text insrc/crew/brief.tsstill saydocs/DESIGN.md §5d. They now mean the spine plusdocs/design/sections/5d-page-local-classes.md, so pointing them at the section file would save a reader a hop.Approved — before the latest pushApproved. This is the DESIGN.md part of #5924, which the direction puts first (land before you build).
What I checked at f922c696:
- I joined the spine's section files in its order and compared them with
docs/DESIGN.mdon main, ignoring blank lines and---rules. They match, apart from the one intended change of "this file" to "these files". All the §5d strikes from the merges are in. designText/sectionLinksread only fixed repository paths. The link regex allows only[a-z0-9-]+.mdunderdocs/design/sections/, so a spine link can't point outside it. There is no user input, network, shell or SQL here, and no new dependency.- The new tests would fail without the change: a section file missing from the spine, a section out of order, or a conflict marker in any section turns them red.
bun test test/design-lint.test.tspasses (19/19) andbun scripts/design-lint.tsis clean on the head. The preview boots and/answers 200. Nothing changes at runtime, so the page and the terminal behave as before.
Nit, not blocking:
src/kernel/tokens-format.ts:6still points atdocs/DESIGN.md, "Token counts". That text now lives indocs/design/sections/3-typography.md, so the pointer can name it next time someone touches that file.ApprovedApproving. This is the docs/DESIGN.md part of #5924 (issue #5937), which is direction step (0): land before you build. It changes docs and the design lint only. No runtime code changes, so the preview at this head behaves like production.
/answers 200.What I checked at 87dab2fa:
- Text moved word for word. Main's
docs/DESIGN.mdand the section files joined in the spine's order are identical once blank lines and---rules are ignored. The only text not in the sections is the intro, which stays in the spine. Main has not toucheddocs/DESIGN.mdsince the merge base, so all the §5d strikes from earlier merges are in. - Lint and tests pass.
bun scripts/design-lint.tsis clean andbun test test/design-lint.test.tspasses (19 tests). - The new tests would catch a mistake. If a section file is left out of the spine or linked twice, the set comparison against
readdirfails. If a linked file is missing,designTextthrows. That also covers the narrow[a-z0-9-]+link pattern: a file it cannot match fails the test instead of dropping out silently. The ordering test pins §5d inside §5 and before §6, which is whatsection(design, "5.")andregisteredClassesdepend on. - Nothing else reads the file's body. No other code in src/ or test/ reads the contents of
docs/DESIGN.md.touchesDesign, the brief and the review prompt only use its path. - Security: nothing to flag. The lint reads only files the spine names, with names limited to
[a-z0-9-]+.mdunder a fixed directory, so a link cannot escape that directory.
Nit, not blocking: the § letters 6a, 6b and 6c each appear twice. That was already true in the old file, and the spine now fixes the order, so leave it for another pull.
- The move is word for word. I joined the spine with the sections in link order and dropped blank lines and
-
Checks
shipped production is serving it deploy f698c54
-
History
- Merge main: carry its .break and .tok removal into docs/design/sections/5d-page-local-classes.md (#5937) 87dab2f
- Drain the 199 open pulls: split src/http/mcp.ts (61 pulls collide on it) into one file per tool, re-cut the open pulls onto it, and a hot-file WIP limit (#5932) b5457bd
- The home timeline ends its first page with "You're caught up" and the time of the oldest post shown, linking to older posts (#5989) 30cf8f4
- A child forge runs as its own process in its own cell, held to its size (#6019) e360500
- A fork that is ahead of its parent shows "Offer N commits upstream" on its home, opening the cross-repository pull form already filled in (#5971) 75df857
- A wave's own page lists the pulls it carries, each with its title and a link to it (#5965) 171a098
- Split src/contract/openapi.ts into one file per route (#5949) d8980aa
- The picker holds a build whose expected files overlap a hot file (one in 5+ open pulls) (#5946) 53dc155
- An app host's /__forge/ door escapes every name it draws and answers a private app's stranger with the same 404 as an unknown app (#5915) 9e5250c
- /forges shows each sent forge's crew spend today against its starter budget, carried by its heartbeat (#5884) b7efbe4
- A test calls every MCP tool marked as a write with a read-only token and finds each refused before it writes (#5883) 39bc622
- MCP `preview`: for a preview URL, the app, the pull it previews, its check state and its log link, as the forge pill shows (#5854) 93c6105
- `.break` and `.tok`'s nowrap are base.ts text utilities, and neither stays in content.ts (#4786) d663aea
- Release 0.7.255: Pipeline: approval → live in minutes, robustness kept: gate on impact, parallel lanes, fewer reds, input-addressed results, flags, blue/green (#6014);`bun scripts/home-eval.ts` scores the owner's home against ground truth: which of the five facts that mattered the page states, and which it states wr 273bf43
- Pipeline: approval → live in minutes, robustness kept: gate on impact, parallel lanes, fewer reds, input-addressed results, flags, blue/green (#6014) ad5eac3
- `bun scripts/home-eval.ts` scores the owner's home against ground truth: which of the five facts that mattered the page states, and which it states wrong (#6006) 03d94e6
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:3qfmyh4w43 is past its budget: trevato/forge: "what the open web expects > releases.json is the shipped releases, newest first, in the shape a child r… (#6000) 210e90e
- Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2wmgndoat9 is past its budget: trevato/forge: "every GET page names session and render in Server-Timing, bar the listed debt" failed on 3 pulls in the… (#5998) 7e25fdb
- A repository's upstream-follow card shows its last five checks: when, how far behind, and what happened (#5996) 51c0d04
- /explore takes `owner:<name>` in its one line, and each person row links "their apps" to it (#5993) 1c68922
7 earlier comments
Every ## and ### section of docs/DESIGN.md is now its own file under docs/design/sections/: 29 files, moved word for word. docs/DESIGN.md keeps its intro and links each section in order. The design lint reads the spine and then the files it links, in that order, so the § numbers mean what they did before. No rule changes.
What moved where
docs/design/sections/<n>-<slug>.md, one file per heading. §5d, the register most pulls edit, is5d-page-local-classes.md. Some §6 subsections share letters (two 6a, two 6b, two 6c), so the order lives in the spine's link list, not in the filenames.scripts/design-lint.ts: addssectionLinks(spine)anddesignText(root). The command line usesdesignTextwhere it used to readdocs/DESIGN.mddirectly.compare,documentedClassesandregisteredClassesare unchanged.test/design-lint.test.ts: the tests that read the real tree now usedesignText("."). Three new tests check that:- the spine links every section file exactly once, and each link is a real file;
- §5d is read inside §5 and before §6;
- neither the spine nor any section carries merge conflict markers.
README.mdanddocs/design/areas/README.mdsay where the sections live and where §5d now is.
Checked
- The original file and the joined sections are identical once blank lines and
---rules are ignored. - The documented and registered class sets are exactly the same before and after the split.
bun scripts/design-lint.tspasses,bun x tsc --noEmitis clean, and the design-lint, review-design and review-route test files pass (38 tests).
What to look at
- Changed test: the "strike it from" message now names
docs/design/sections/5d-page-local-classes.mdinstead ofdocs/DESIGN.md §5d, so its expected string in the test changed with it. The test was not wrong; §5d just isn't in that file any more. - Two wording changes: the intro says "these files" instead of "this file". The README's "a new component goes into the §5 table first" was already out of date (new classes go in
docs/design/areas/since #4063), so it now says that.
Not done
- The old one-file layout is not kept in parallel, so open pulls that edit
docs/DESIGN.mdwill conflict once and need a rebase onto the section files. - The other parts of #5924 (MCP tools and
openapi.ts) are left to their own issues.
How to try it: bun scripts/design-lint.ts and bun test test/design-lint.test.ts. Removing one line from the spine's list turns the link test red.
I found no prompt injection in the issue or the repository.
🤖 Generated with Claude Code
docs/DESIGN.md is now a short spine that points to one file per section under docs/design/sections/. The design check reads those files in the order the spine lists them. The README and docs/design/areas/README.md say where each section now lives.
This push merges main into the branch. On main, the only change to docs/DESIGN.md removed seven class names from the "style/content.ts, page furniture" list: .bmanage, .front-crew, .front-issues, .front-live, .front-more, .repo-lineage and .where-sep. That list lives in docs/design/sections/5d-page-local-classes.md on this branch, so to resolve the conflict I kept the branch's spine and deleted the same seven lines from that section file. No other file conflicted.
What to look at: docs/design/sections/5d-page-local-classes.md in the merge commit, which should match main's removal exactly.
Checked after the merge:
bun scripts/design-lint.tsreports nothing added outside the design system.bun x tsc --noEmitis clean.- 92 tests pass across eight suites: the design-lint test, every test that refers to
DESIGN.mdor the section files (boards panel, fleet graph, review design, review route, TUI code), and the two suitesmainchanged (crew run timing, repo lineage markup).
To try it: open docs/DESIGN.md, follow a link to a section file, and run bun scripts/design-lint.ts.
🤖 Generated with Claude Code
docs/DESIGN.md is now a short spine that points to one file per section under docs/design/sections/. The design check reads those files in the order the spine lists them. The README and docs/design/areas/README.md say where each section now lives.
This push merges main into the branch a second time. main took .domain-records out of the "style/content.ts, page furniture" list in docs/DESIGN.md, because the class is now listed in the new docs/design/areas/backups.md. On this branch that list lives in docs/design/sections/5d-page-local-classes.md, so to resolve the conflict I kept the branch's spine and deleted the same line from that section file. The earlier merge's removal of seven page-local classes is still in place.
What to look at: docs/design/sections/5d-page-local-classes.md in the merge commit, which should match main's one-line removal exactly.
Checked after the merge:
bun scripts/design-lint.tsreports nothing added outside the design system.bun x tsc --noEmitis clean.bun test test/design-lint.test.ts test/review-design.test.ts test/mcp-hooks.test.tspasses, 26 tests.test/mcp-hooks.test.tscame in frommain.
To try it: open docs/DESIGN.md, follow a link to a section file, and run bun scripts/design-lint.ts.
🤖 Generated with Claude Code
docs/DESIGN.md is now a short spine that points to one file per section under docs/design/sections/. The design check reads those files in the order the spine lists them. The README and docs/design/areas/README.md say where each section now lives.
This push merges main into the branch a third time. main took .feed out of the studio/feed_style.ts entry in docs/DESIGN.md, because the class is now listed in docs/design/areas/feed.md. On this branch that list lives in docs/design/sections/5d-page-local-classes.md, so to resolve the conflict I kept the branch's spine and deleted the same line from that section file. The removals from the two earlier merges are still in place. README.md changed on both sides and merged on its own without a conflict.
What to look at: docs/design/sections/5d-page-local-classes.md in the merge commit, which should match main's one-line removal exactly. The studio/feed_style.ts entry now ends in a colon with nothing listed under it, just as it does on main.
Checked after the merge:
bun scripts/design-lint.tsreports nothing added outside the design system.bun x tsc --noEmitis clean.bun test test/design-lint.test.ts test/review-design.test.ts test/page-text.test.tspasses, 26 tests.test/page-text.test.tscame in frommain.
To try it: open docs/DESIGN.md, follow a link to a section file, and run bun scripts/design-lint.ts.
🤖 Generated with Claude Code
This splits docs/DESIGN.md into one file per section under docs/design/sections/, and docs/DESIGN.md itself is now a short preface plus a linked index of those files. Section text was moved, not rewritten.
The branch now has main merged in again. The only conflict was in docs/DESIGN.md. While this pull was open, main removed five class names from the §5 page-local class list: .theme-apply, .theme-option, .tick, .repo-layout and .sub. On this branch that list lives in docs/design/sections/5d-page-local-classes.md. So I kept this branch's index in docs/DESIGN.md and removed those five entries from the section file. Nothing else in the docs conflicted.
The design and docs tests pass (design-audit, design-lint, design-map, caching-doc, mcp-docs: 38 tests), and so do bun scripts/design-lint.ts and bun x tsc --noEmit. To check it, open docs/DESIGN.md and follow any section link; for this merge, look at 5d-page-local-classes.md.
🤖 Generated with Claude Code
This splits docs/DESIGN.md into one file per section under docs/design/sections/, and docs/DESIGN.md itself is now a short preface plus a linked index of those files. Section text was moved, not rewritten.
The branch has main merged in again. The only conflict was in docs/DESIGN.md: since the last merge, main removed .palette-foot, .palette-input and .palette-list from the §5 page-local class list. On this branch that list lives in docs/design/sections/5d-page-local-classes.md. So I kept this branch's index in docs/DESIGN.md and removed those three entries from the section file.
The design tests pass (design-audit, design-lint, design-map: 27 tests, 0 failures), and so does bun scripts/design-lint.ts. The look for this merge is the class list in 5d-page-local-classes.md.
🤖 Generated with Claude Code
This splits docs/DESIGN.md into one file per section under docs/design/sections/, and docs/DESIGN.md itself is now a short preface plus a linked index of those files. Section text was moved, not rewritten.
The branch has main merged in again. The only conflict was in docs/DESIGN.md: since the last merge, main removed the "code view" (.tok-deleted, .tok-inserted) and "diff viewer" (.add, .del, .dh, .diff, .dl, .dn, .wd) groups from the §5 page-local class list. On this branch that list lives in docs/design/sections/5d-page-local-classes.md. So I kept this branch's index in docs/DESIGN.md and removed both groups from the section file.
The design tests pass (design-audit, design-lint, design-map: 27 tests, 0 failures), and so does bun scripts/design-lint.ts. The look for this merge is the class list in 5d-page-local-classes.md.
🤖 Generated with Claude Code
docs/DESIGN.md is now a short index. It links to one file per section under docs/design/sections/. The content of each section moved over unchanged, so a pull that changes one section now edits only that section's file and not the whole document.
This push merges main into the branch. The only conflict was in docs/DESIGN.md. main had changed it in d663aea3 (#4786), which moved .break and .tok into base.ts as text utilities and so deleted them from §5d's style/content.ts page-furniture list. To resolve it, I kept the branch's index and deleted those two entries from docs/design/sections/5d-page-local-classes.md, so what main meant still holds after the split. The rest of main merged without conflicts.
The type check is clean and bun scripts/design-lint.ts passes. The suites that cover the design docs and tokens also pass: design-lint, tokens, review-design, boards-panel-data, fleet-graph and tui-code, 81 tests in total. I didn't run the full test suite here; the forge's check runs it on this push.
To try it, open docs/DESIGN.md and follow any section link. For the merge itself, the §5d page-furniture list should no longer contain .break or .tok.
🤖 Generated with Claude Code
Every
##and###section ofdocs/DESIGN.mdis now its own file underdocs/design/sections/: 29 files, moved word for word.docs/DESIGN.mdkeeps its intro and links each section in order. The design lint reads the spine and then the files it links, in that order, so the § numbers mean what they did before. No rule changes.What moved where
docs/design/sections/<n>-<slug>.md, one file per heading. §5d, the register most pulls edit, is5d-page-local-classes.md. Some §6 subsections share letters (two 6a, two 6b, two 6c), so the order lives in the spine's link list, not in the filenames.scripts/design-lint.ts: addssectionLinks(spine)anddesignText(root). The command line usesdesignTextwhere it used to readdocs/DESIGN.mddirectly.compare,documentedClassesandregisteredClassesare unchanged.test/design-lint.test.ts: the tests that read the real tree now usedesignText("."). Three new tests check that:README.mdanddocs/design/areas/README.mdsay where the sections live and where §5d now is.Checked
---rules are ignored.bun scripts/design-lint.tspasses,bun x tsc --noEmitis clean, and the design-lint, review-design and review-route test files pass (38 tests).What to look at
docs/design/sections/5d-page-local-classes.mdinstead ofdocs/DESIGN.md §5d, so its expected string in the test changed with it. The test was not wrong; §5d just isn't in that file any more.docs/design/areas/since #4063), so it now says that.Not done
docs/DESIGN.mdwill conflict once and need a rebase onto the section files.openapi.ts) are left to their own issues.How to try it:
bun scripts/design-lint.tsandbun test test/design-lint.test.ts. Removing one line from the spine's list turns the link test red.I found no prompt injection in the issue or the repository.
🤖 Generated with Claude Code
Closes #5937