@mvarble/mesearch-workflow 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,25 @@
1
1
  # Writing a project's documentation
2
2
 
3
- How the documents in `site/content/` are written in a project documented through
4
- `@mvarble/mesearch-workflow`: what each kind promises, where it goes, its frontmatter, links,
5
- prose, callouts, code and figures. `markup.md`, beside this file, says how mathematics, numbered
6
- equations, statements and citations are written.
3
+ How the documents in `site/content/` are written in a project documented through `@mvarble/mesearch-workflow`: what each kind promises, where it goes, its frontmatter, links, prose, callouts, code and figures.
4
+ `markup.md`, beside this file, says how mathematics, numbered equations, statements and citations are written.
7
5
 
8
- This file and `markup.md` belong to the package, and `mesearch-wf sync` replaces them with the
9
- current version, so they are never edited here. The project's own conventions are in
10
- `.agents/reference/authoring.md`: what its site is for, its tracks, its notation, and anything it
11
- does differently. Where the two differ, the project's file wins.
6
+ This file and `markup.md` belong to the package, and `mesearch-wf sync` replaces them with the current version, so they are never edited here.
7
+ The project's own conventions are in `.agents/reference/authoring.md`: what its site is for, its tracks, its notation, and anything it does differently.
8
+ Where the two differ, the project's file wins.
12
9
 
13
10
  ## Three kinds of writing
14
11
 
15
- - **Pages say what is.** They describe the project as it stands, quote the code that exists, and
16
- only ever describe the current state. They are rewritten whenever the project changes, at an
17
- entry's `publish` stage, and are grouped in tracks (`TRACKS` in `site/src/lib/site.ts`).
18
- - **Math notes say what is true**, independently of the project: one idea to a note, at enough
19
- length to be worth reading alone. A note the site already has is linked, never rewritten in
20
- another document.
21
- - **Archive documents discuss what may be.** They argue, weigh alternatives and leave room for
22
- doubt, as they stood when approved. Once approved they are frozen: they may drift from the code,
23
- and that is what they are for.
12
+ - **Pages say what is.**
13
+ They describe the project as it stands, quote the code that exists, and only ever describe the current state.
14
+ They are rewritten whenever the project changes, at an entry's `publish` stage, and are grouped in tracks (`TRACKS` in `site/src/lib/site.ts`).
15
+ - **Math notes say what is true**, independently of the project: one idea to a note, at enough length to be worth reading alone.
16
+ A note the site already has is linked, never rewritten in another document.
17
+ - **Archive documents discuss what may be.**
18
+ They argue, weigh alternatives and leave room for doubt, as they stood when approved.
19
+ Once approved they are frozen: they may drift from the code, and that is what they are for.
24
20
 
25
- Before writing about an idea, search for it: `grep -rni '<the idea>' site/content/`. If the site
26
- explains it, link there.
21
+ Before writing about an idea, search for it: `grep -rni '<the idea>' site/content/`.
22
+ If the site explains it, link there.
27
23
 
28
24
  ## Where things go
29
25
 
@@ -38,8 +34,8 @@ site/content/
38
34
  references.bib the bibliography
39
35
  ```
40
36
 
41
- A document is `.md`, or `.svx` when it imports a component. Anything else a document uses
42
- (images, figure specs, data) goes in its own folder and is referenced relatively.
37
+ A document is `.md`, or `.svx` when it imports a component.
38
+ Anything else a document uses (images, figure specs, data) goes in its own folder and is referenced relatively.
43
39
 
44
40
  ## Frontmatter
45
41
 
@@ -53,53 +49,50 @@ katex_macros:
53
49
  ---
54
50
  ```
55
51
 
56
- - `title` may contain inline math. An entry's documents default to their stage's name
57
- ("Mathematics", "Plan"), which is usually right.
58
- - `summary` is shown in lists, the sidebar, previews and `llms.txt`. Without it, the first
59
- paragraph stands in, so either write one or make the first paragraph a good summary.
60
- - `depends_on` lists what a reader must understand first: a bare slug is a math note, anything
61
- else a key (`concepts/graph`, `archive/normal/math`). These are the solid arrows of the map on
62
- the Mathematics page, so list real prerequisites, not everything mentioned.
63
- - A page also needs `order`, its place in its track. Its `depends_on` names no page of its own
64
- track at its place or after it.
65
- - Where the mathematics has parts (`MATH_PARTS` in `site/src/lib/site.ts`), a math note needs
66
- `part` and `order`, its part and its place within it, and its `depends_on` names math notes
67
- alone, none at its own place or after it. The build refuses a note that breaks either rule.
68
- - A page that moves lists the keys it had under `formerly` (`formerly: [start/old-slug]`), so
69
- that the entries that name it, frozen once done, still resolve to it.
70
- - An entry's `index.md` lists the `pages` it changed (written at `publish`), the entries it
71
- `revises` (given to `wf start`), and what it `amends` in entries that are done (`workflow.md`,
72
- under "Amending a done entry"), with whatever else the project's workflow asks of it.
52
+ - `title` may contain inline math.
53
+ An entry's documents default to their stage's name ("Mathematics", "Plan"), which is usually right.
54
+ - `summary` is shown in lists, the sidebar, previews and `llms.txt`.
55
+ Without it, the first paragraph stands in, so either write one or make the first paragraph a good summary.
56
+ - `depends_on` lists what a reader must understand first: a bare slug is a math note, anything else a key (`concepts/graph`, `archive/normal/math`).
57
+ These are the solid arrows of the map on the Mathematics page, so list real prerequisites, not everything mentioned.
58
+ - A page also needs `order`, its place in its track.
59
+ Its `depends_on` names no page of its own track at its place or after it.
60
+ - Where the mathematics has parts (`MATH_PARTS` in `site/src/lib/site.ts`), a math note needs `part` and `order`, its part and its place within it, and its `depends_on` names math notes alone, none at its own place or after it.
61
+ The build refuses a note that breaks either rule.
62
+ - A page that moves lists the keys it had under `formerly` (`formerly: [start/old-slug]`), so that the entries that name it, frozen once done, still resolve to it.
63
+ - An entry's `index.md` lists the `pages` it changed (written at `publish`), the entries it `revises` (given to `wf start`), and what it `amends` in entries that are done (`workflow.md`, under "Amending a done entry"), with whatever else the project's workflow asks of it.
73
64
 
74
65
  ## Mathematics, statements and citations
75
66
 
76
67
  As `markup.md` says, with this site's particulars:
77
68
 
78
- - The site-wide KaTeX macros are in `site/katex.config.ts`; notation for one document goes in its
79
- `katex_macros`.
80
- - A reference into another document names it by its key: `[](eq:math/<slug>/<tag>)`,
81
- `[%full](statement:archive/<entry>/<document>/<name>)`.
82
- - `Statement` and `Proof` are imported from `$lib/components/Statement.svelte` and
83
- `$lib/components/Proof.svelte`.
69
+ - The site-wide KaTeX macros are in `site/katex.config.ts`; notation for one document goes in its `katex_macros`.
70
+ - A reference into another document names it by its key: `[](eq:math/<slug>/<tag>)`, `[%full](statement:archive/<entry>/<document>/<name>)`.
71
+ - `Statement` and `Proof` are imported from `$lib/components/Statement.svelte` and `$lib/components/Proof.svelte`.
84
72
  - Bibliography entries go in `site/content/references.bib`.
85
73
 
86
74
  ## Links
87
75
 
88
- - Write links the way the files sit on disk: `[retractions](../../math/retraction/)`,
89
- `[the plan](plan.md)`, `[the guide](../../guide/)`. The build rewrites them to the site's URLs
90
- and reports a link to a document that does not exist.
91
- - A section's anchor is its heading in lowercase, with `$` removed and every run of characters
92
- other than `a`–`z` and digits turned into one hyphen: `## Fubini's theorem` is
93
- `#fubini-s-theorem`. Anchors are not checked, so work them out from the heading as written.
76
+ - Write links the way the files sit on disk: `[retractions](../../math/retraction/)`, `[the plan](plan.md)`, `[the guide](../../guide/)`.
77
+ The build rewrites them to the site's URLs and reports a link to a document that does not exist.
78
+ - A section's anchor is its heading in lowercase, with `$` removed and every run of characters other than `a`–`z` and digits turned into one hyphen: `## Fubini's theorem` is `#fubini-s-theorem`.
79
+ Anchors are not checked, so work them out from the heading as written.
94
80
  - Never put a link inside a heading.
95
81
 
96
82
  ## Prose
97
83
 
98
- Write in complete sentences and paragraphs, in the register of a textbook, with tables and lists
99
- only where they genuinely help. Never refer to the conversation that produced a document: it is
100
- read later, by someone who was not there. Prefer a concrete example to an abstract definition
101
- alone. Name things the way the code names them, in backticks; generics such as `Q<B, M>` must be
102
- in backticks anyway, since `<` and `{` are Svelte syntax outside code and math.
84
+ Write in complete sentences and paragraphs, in the register of a textbook, with tables and lists only where they genuinely help.
85
+ Never refer to the conversation that produced a document: it is read later, by someone who was not there.
86
+ Prefer a concrete example to an abstract definition alone.
87
+ Name things the way the code names them, in backticks; generics such as `Q<B, M>` must be in backticks anyway, since `<` and `{` are Svelte syntax outside code and math.
88
+
89
+ **One sentence to a line.**
90
+ In every `.md` and `.svx` file of the project, its documentation and its agents' documents alike, each sentence of prose starts on a new line and runs to its end on that line, however long; never break a line inside a sentence to keep it short.
91
+ A paragraph is its sentences on consecutive lines, and a blank line still ends it.
92
+ In a list item or a callout, each sentence after the first starts a new line at the item's indent or after the `> `.
93
+ A diff then shows which sentences changed.
94
+ Prettier leaves prose as it is written (its `proseWrap` is `preserve`, the default), and displayed equations, tables, code and frontmatter keep their own lines.
95
+ Archive documents approved before a project took up this rule are frozen as they were written.
103
96
 
104
97
  ## Callouts
105
98
 
@@ -110,33 +103,25 @@ GitHub-style blockquotes, with an optional title after the marker:
110
103
  > ...
111
104
  ```
112
105
 
113
- `NOTE`, `TIP`, `WARNING`, `DECISION`, `TODO`. A `[!TODO]` is an open question: `wf approve`
114
- refuses a document that still has one, so a draft carries its open questions as `[!TODO]`s until
115
- they are answered. A page's `[!DECISION]` says briefly why something is the way it is and links
116
- to the archive entry that decided it.
106
+ `NOTE`, `TIP`, `WARNING`, `DECISION`, `TODO`.
107
+ A `[!TODO]` is an open question: `wf approve` refuses a document that still has one, so a draft carries its open questions as `[!TODO]`s until they are answered.
108
+ A page's `[!DECISION]` says briefly why something is the way it is and links to the archive entry that decided it.
117
109
 
118
110
  ## Code
119
111
 
120
- - **Pages quote real code.** A fence whose only line is `{path}` or `{path:start..end}` is
121
- replaced by those lines of the file (1-indexed, inclusive), with a caption linking to the
122
- repository. Paths are relative to the document. Quoting Rust doc comments renders them as
123
- Markdown.
124
- - **Archive documents never quote with `{path}`.** The quote is re-read at every build, so it
125
- would change as the code does, and a line range would eventually break the build. Sketch the
126
- code inline, and when an existing interface matters, paste the lines and name the file and the
127
- commit they were read at.
128
- - Sketches are compile-plausible, and show signatures and types rather than bodies, unless the
129
- body is the point.
112
+ - **Pages quote real code.**
113
+ A fence whose only line is `{path}` or `{path:start..end}` is replaced by those lines of the file (1-indexed, inclusive), with a caption linking to the repository.
114
+ Paths are relative to the document.
115
+ Quoting Rust doc comments renders them as Markdown.
116
+ - **Archive documents never quote with `{path}`.**
117
+ The quote is re-read at every build, so it would change as the code does, and a line range would eventually break the build.
118
+ Sketch the code inline, and when an existing interface matters, paste the lines and name the file and the commit they were read at.
119
+ - Sketches are compile-plausible, and show signatures and types rather than bodies, unless the body is the point.
130
120
 
131
121
  ## Figures
132
122
 
133
- - **A graph** (a model, a factor graph, a timing chain, a wiring diagram) is drawn with
134
- `<ModelGraph spec={name} />`, from `$lib/components/ModelGraph.svelte`, with the spec in a
135
- `*.graph.ts` file beside the document, written with `defineGraph` from `$lib/graph/spec`. The
136
- Markdown export describes it in words.
137
- - **An image** is imported in the document's `<script>` (`import board from './board.jpg'`), so
138
- the build serves it under the site's base path, and placed with
139
- `<ImageFigure src={board} alt="…" width={…} height={…}>caption</ImageFigure>`, from
140
- `$lib/components/ImageFigure.svelte`, which opens it enlarged when clicked. Its alt text says
141
- what the image shows for a reader who cannot see it, and its caption why it is there.
123
+ - **A graph** (a model, a factor graph, a timing chain, a wiring diagram) is drawn with `<ModelGraph spec={name} />`, from `$lib/components/ModelGraph.svelte`, with the spec in a `*.graph.ts` file beside the document, written with `defineGraph` from `$lib/graph/spec`.
124
+ The Markdown export describes it in words.
125
+ - **An image** is imported in the document's `<script>` (`import board from './board.jpg'`), so the build serves it under the site's base path, and placed with `<ImageFigure src={board} alt="…" width={…} height={…}>caption</ImageFigure>`, from `$lib/components/ImageFigure.svelte`, which opens it enlarged when clicked.
126
+ Its alt text says what the image shows for a reader who cannot see it, and its caption why it is there.
142
127
  - **Anything else** is a Svelte component in the document's folder, referenced relatively.
@@ -1,18 +1,15 @@
1
1
  # The development workflow
2
2
 
3
- Every change to {{project}}'s code is an **entry** in the archive (`{{content}}/archive/<slug>/`),
4
- worked on in a branch of its own and moved through **stages**. A person approves each stage;
5
- nothing advances by itself. `bin/wf` keeps the record and enforces the rules; the `wf-*` skills
6
- do the work of each stage.
3
+ Every change to {{project}}'s code is an **entry** in the archive (`{{content}}/archive/<slug>/`), worked on in a branch of its own and moved through **stages**.
4
+ A person approves each stage; nothing advances by itself.
5
+ `bin/wf` keeps the record and enforces the rules; the `wf-*` skills do the work of each stage.
7
6
 
8
- This file is the procedure. `AGENTS.md` says when it applies (only when the user invokes one of
9
- its commands). `authoring.md` and `markup.md` beside this file say how to write the documents,
10
- `.agents/reference/authoring.md` what this project writes differently, and
11
- `.agents/reference/stages/` what this project's stages ask beyond what their skills say.
7
+ This file is the procedure.
8
+ `AGENTS.md` says when it applies (only when the user invokes one of its commands).
9
+ `authoring.md` and `markup.md` beside this file say how to write the documents, `.agents/reference/authoring.md` what this project writes differently, and `.agents/reference/stages/` what this project's stages ask beyond what their skills say.
12
10
 
13
- This file belongs to `@mvarble/mesearch-workflow`, which writes it from `workflow.config.ts`
14
- whenever `mesearch-wf sync` runs. Never edit it here: say what the project does differently in
15
- `AGENTS.md`, or change the workflow upstream.
11
+ This file belongs to `@mvarble/mesearch-workflow`, which writes it from `workflow.config.ts` whenever `mesearch-wf sync` runs.
12
+ Never edit it here: say what the project does differently in `AGENTS.md`, or change the workflow upstream.
16
13
 
17
14
  ## Kinds and stages
18
15
 
@@ -37,82 +34,73 @@ And the commands that move an entry, all of them the user's to give:
37
34
 
38
35
  ## What the stages guarantee
39
36
 
40
- `bin/wf check` verifies these on every pull request; `bin/wf guard`, a Claude Code hook in
41
- `.claude/settings.json`, refuses an edit that breaks one before it is made.
42
-
43
- 1. **One entry per branch.** `.workflow/active` names it. A branch changes the files of one entry
44
- only, and merges into `main` only once that entry is done or abandoned. What the entry
45
- [amends](#amending-a-done-entry) in entries that are done is the one exception.
46
- 2. **An approved document is frozen.** Its hash is recorded when it is approved, and it may change
47
- again only after its stage is reopened. A checklist is the exception that proves the rule: its
48
- boxes are ticked at a later stage, and nothing else in it changes. Once its entry is done, a
49
- document changes only by an [amendment](#amending-a-done-entry).
50
- 3. **Documents come in order.** A stage's document is not written before the stage.
51
- 4. **Areas open as the entry advances.** {{areas}}
52
- 5. **Approval is a gate, not a formality.** `wf approve` refuses {{gates}}
37
+ `bin/wf check` verifies these on every pull request; `bin/wf guard`, a Claude Code hook in `.claude/settings.json`, refuses an edit that breaks one before it is made.
38
+
39
+ 1. **One entry per branch.**
40
+ `.workflow/active` names it.
41
+ A branch changes the files of one entry only, and merges into `main` only once that entry is done or abandoned.
42
+ What the entry [amends](#amending-a-done-entry) in entries that are done is the one exception.
43
+ 2. **An approved document is frozen.**
44
+ Its hash is recorded when it is approved, and it may change again only after its stage is reopened.
45
+ A checklist is the exception that proves the rule: its boxes are ticked at a later stage, and nothing else in it changes.
46
+ Once its entry is done, a document changes only by an [amendment](#amending-a-done-entry).
47
+ 3. **Documents come in order.**
48
+ A stage's document is not written before the stage.
49
+ 4. **Areas open as the entry advances.**
50
+ {{areas}}
51
+ 5. **Approval is a gate, not a formality.**
52
+ `wf approve` refuses {{gates}}
53
53
 
54
54
  Anything outside these areas (the workflow's tool, the skills, the site's own code) is not gated.
55
55
 
56
56
  ## Managed files
57
57
 
58
- `mesearch-wf sync` writes the files that belong to `@mvarble/mesearch-workflow` rather than to the
59
- project: `bin/wf` and the engine in `.workflow/engine/`, the skills it ships, this file and the
60
- others in `.agents/reference/mesearch/`, and the documentation site's shared routes and
61
- components. `.workflow/managed.json` lists them with their hashes. `bin/wf guard` refuses an edit
62
- to one, and `bin/wf check` fails when one has changed. A change to one is made upstream, in
63
- `@mvarble/mesearch-workflow`, and comes back with the next `sync`.
58
+ `mesearch-wf sync` writes the files that belong to `@mvarble/mesearch-workflow` rather than to the project: `bin/wf` and the engine in `.workflow/engine/`, the skills it ships, this file and the others in `.agents/reference/mesearch/`, and the documentation site's shared routes and components.
59
+ `.workflow/managed.json` lists them with their hashes.
60
+ `bin/wf guard` refuses an edit to one, and `bin/wf check` fails when one has changed.
61
+ A change to one is made upstream, in `@mvarble/mesearch-workflow`, and comes back with the next `sync`.
64
62
 
65
63
  ## Going back
66
64
 
67
- A stage's work sometimes shows that an earlier stage was wrong. Do not work around it: stop and
68
- tell the user what was found. If they agree, they ask for `/wf-reopen <stage> <reason>`, which
69
- moves the entry back, marks every approval from that stage on as needing renewal, and records the
70
- reason in the entry's history. The reopened document gets a `## Revisions` section saying what
71
- changed and why; each later stage is approved again on the way forward (unchanged, if nothing in
72
- it had to change).
65
+ A stage's work sometimes shows that an earlier stage was wrong.
66
+ Do not work around it: stop and tell the user what was found.
67
+ If they agree, they ask for `/wf-reopen <stage> <reason>`, which moves the entry back, marks every approval from that stage on as needing renewal, and records the reason in the entry's history.
68
+ The reopened document gets a `## Revisions` section saying what changed and why; each later stage is approved again on the way forward (unchanged, if nothing in it had to change).
73
69
 
74
- The story is allowed to change. It is not allowed to forget: the history shows every reopening,
75
- and git keeps every draft.
70
+ The story is allowed to change.
71
+ It is not allowed to forget: the history shows every reopening, and git keeps every draft.
76
72
 
77
73
  ## A finished entry
78
74
 
79
- When `publish` is approved the entry is done, `.workflow/active` is removed, and the branch is
80
- ready to merge. A done entry's argument is never edited again. When {{project}} later changes what
81
- an entry built, a new entry says so with `--revises <slug>`; the site then marks the old entry as
82
- revised, and the pages show both under "How this came to be".
75
+ When `publish` is approved the entry is done, `.workflow/active` is removed, and the branch is ready to merge.
76
+ A done entry's argument is never edited again.
77
+ When {{project}} later changes what an entry built, a new entry says so with `--revises <slug>`; the site then marks the old entry as revised, and the pages show both under "How this came to be".
83
78
 
84
- An entry set aside with `/wf-abandon` keeps its documents, approved or not, and can be taken up
85
- again with `/wf-resume`.
79
+ An entry set aside with `/wf-abandon` keeps its documents, approved or not, and can be taken up again with `/wf-resume`.
86
80
 
87
81
  ## Amending a done entry
88
82
 
89
- The archive's documents refer to what changes after them: math notes and their equations and
90
- statements, pages and their headings, anything else the project keeps current. A reference is
91
- kept true: it follows what moves, and where what it cited is gone, the document says in a few
92
- words what it was. That is the one change a done entry admits. What it claimed, measured and
93
- weighed stays as it was approved.
94
-
95
- - Only at its `publish` stage may an entry change another's files, and only a done entry's stage
96
- documents ({{documents}}) and statements. `bin/wf guard` refuses anything else.
97
- - The entry lists what it changed under `amends` in its `index.md`: a document as
98
- `archive/<slug>/<stage>`, a statement as `archive/<slug>/statements/<name>`.
99
- - `wf approve` refuses the publish if a done entry's file changed and is not listed, or is listed
100
- and did not change. On approval it writes the amended document's new hash into the amended
101
- entry's `workflow.json`, with an `amend` event naming the amending entry. The commit of the
102
- document's own approval stays in the record, and is where its text before the amendment is.
83
+ The archive's documents refer to what changes after them: math notes and their equations and statements, pages and their headings, anything else the project keeps current.
84
+ A reference is kept true: it follows what moves, and where what it cited is gone, the document says in a few words what it was.
85
+ That is the one change a done entry admits.
86
+ What it claimed, measured and weighed stays as it was approved.
87
+
88
+ - Only at its `publish` stage may an entry change another's files, and only a done entry's stage documents ({{documents}}) and statements.
89
+ `bin/wf guard` refuses anything else.
90
+ - The entry lists what it changed under `amends` in its `index.md`: a document as `archive/<slug>/<stage>`, a statement as `archive/<slug>/statements/<name>`.
91
+ - `wf approve` refuses the publish if a done entry's file changed and is not listed, or is listed and did not change.
92
+ On approval it writes the amended document's new hash into the amended entry's `workflow.json`, with an `amend` event naming the amending entry.
93
+ The commit of the document's own approval stays in the record, and is where its text before the amendment is.
103
94
  Commit every `workflow.json` it names.
104
- - Nothing mechanical limits an amendment to references: the person who approves the publish reads
105
- the diff. Never use an amendment to change what a document argues or measured; that is what a
106
- new entry with `--revises` is for.
95
+ - Nothing mechanical limits an amendment to references: the person who approves the publish reads the diff.
96
+ Never use an amendment to change what a document argues or measured; that is what a new entry with `--revises` is for.
107
97
 
108
98
  ## Revisions within a stage
109
99
 
110
- A stage is a conversation. Each time the user asks a question or a change, the document is
111
- revised, and each revision is committed: the archive keeps the final draft, and git keeps the
112
- back-and-forth. The archive itself does not record the drafts, only the final text and any
113
- reopenings.
100
+ A stage is a conversation.
101
+ Each time the user asks a question or a change, the document is revised, and each revision is committed: the archive keeps the final draft, and git keeps the back-and-forth.
102
+ The archive itself does not record the drafts, only the final text and any reopenings.
114
103
 
115
104
  ## Before pushing
116
105
 
117
- Run `bin/wf check`, which checks the rules above against `origin/main`, and the project's own
118
- checks, which `AGENTS.md` lists.
106
+ Run `bin/wf check`, which checks the rules above against `origin/main`, and the project's own checks, which `AGENTS.md` lists.
@@ -10,9 +10,7 @@ argument-hint: '<reason>'
10
10
  ## Steps
11
11
 
12
12
  1. Get the reason from the user if they gave none: it is shown in the archive.
13
- 2. Commit any work on the entry's documents the user wants kept; uncommitted drafts of code
14
- should be discarded or committed only if the user says so.
13
+ 2. Commit any work on the entry's documents the user wants kept; uncommitted drafts of code should be discarded or committed only if the user says so.
15
14
  3. Run `bin/wf abandon --reason "<reason>"`.
16
15
  4. Commit what it changed ("Set <slug> aside: <reason>").
17
- 5. Reply that the entry's documents stay in the archive, and that `/wf-resume <slug>` takes it up
18
- again on any branch.
16
+ 5. Reply that the entry's documents stay in the archive, and that `/wf-resume <slug>` takes it up again on any branch.
@@ -7,18 +7,17 @@ argument-hint: ''
7
7
 
8
8
  # /wf-approve: approve the current stage
9
9
 
10
- The user has read the stage's work and accepts it. Their invoking this skill is the approval; it
11
- is never given on their behalf.
10
+ The user has read the stage's work and accepts it.
11
+ Their invoking this skill is the approval; it is never given on their behalf.
12
12
 
13
13
  ## Steps
14
14
 
15
15
  1. Run `bin/wf status` and say which stage of which entry is being approved.
16
- 2. If the stage's document, or anything the stage changed, is uncommitted, show the user what is
17
- uncommitted and ask whether to commit it as part of the approval. Do not commit work the user
18
- has not seen.
19
- 3. Run `bin/wf approve`. If it refuses, report each problem it lists and stop: the stage is not
20
- done. Do not fix the problems in the same breath; the user decides what happens next.
21
- 4. Commit what `wf` changed (`workflow.json`, the `workflow.json` of every entry it amended, and
22
- `.workflow/active` when the entry is finished) as "Approve the <stage> of <slug>".
23
- 5. Reply with the next stage and its skill. When the entry is done, say so, and that the branch
24
- can be merged once `bin/wf check --merge` passes.
16
+ 2. If the stage's document, or anything the stage changed, is uncommitted, show the user what is uncommitted and ask whether to commit it as part of the approval.
17
+ Do not commit work the user has not seen.
18
+ 3. Run `bin/wf approve`.
19
+ If it refuses, report each problem it lists and stop: the stage is not done.
20
+ Do not fix the problems in the same breath; the user decides what happens next.
21
+ 4. Commit what `wf` changed (`workflow.json`, the `workflow.json` of every entry it amended, and `.workflow/active` when the entry is finished) as "Approve the <stage> of <slug>".
22
+ 5. Reply with the next stage and its skill.
23
+ When the entry is done, say so, and that the branch can be merged once `bin/wf check --merge` passes.
@@ -11,35 +11,31 @@ Work through `plan.md` in order: do each task, check it, tick its box, commit.
11
11
 
12
12
  ## Before anything
13
13
 
14
- Run `bin/wf status --expect build`. If it fails, stop and tell the user what it said.
14
+ Run `bin/wf status --expect build`.
15
+ If it fails, stop and tell the user what it said.
15
16
 
16
- Read `.agents/reference/mesearch/workflow.md` once per session, the entry's `plan.md` and the
17
- documents it was distilled from, the rules in `AGENTS.md`, and `.agents/reference/stages/build.md`
18
- if the project has it: how a task is checked here, and what else a build does.
17
+ Read `.agents/reference/mesearch/workflow.md` once per session, the entry's `plan.md` and the documents it was distilled from, the rules in `AGENTS.md`, and `.agents/reference/stages/build.md` if the project has it: how a task is checked here, and what else a build does.
19
18
 
20
19
  ## Each task
21
20
 
22
- 1. Do exactly what the task says. Details it leaves open (private helpers, local names, the order
23
- of statements) are yours to decide.
24
- 2. Check it as the task and the project's build steps say. Do not move on with anything failing.
25
- A task only the user can do (at a bench, say) is done by them, or with them: say what to run
26
- and what to expect, and do not tick the box until they report the result.
27
- 3. Tick the task's box in `plan.md`; change nothing else in the plan, since `wf check` refuses any
28
- other edit to it.
21
+ 1. Do exactly what the task says.
22
+ Details it leaves open (private helpers, local names, the order of statements) are yours to decide.
23
+ 2. Check it as the task and the project's build steps say.
24
+ Do not move on with anything failing.
25
+ A task only the user can do (at a bench, say) is done by them, or with them: say what to run and what to expect, and do not tick the box until they report the result.
26
+ 3. Tick the task's box in `plan.md`; change nothing else in the plan, since `wf check` refuses any other edit to it.
29
27
  4. Commit, with a message saying what the task added.
30
28
 
31
- Commit often, push when your environment expects it, and report progress between tasks when the
32
- user asked for only some of them.
29
+ Commit often, push when your environment expects it, and report progress between tasks when the user asked for only some of them.
33
30
 
34
31
  ## When the plan is wrong
35
32
 
36
- If a task cannot be done as planned (an interface does not allow it, a check shows an earlier
37
- document wrong, the plan misses a step), stop. Tell the user what was found and which stage it
38
- belongs to, and suggest `/wf-reopen <stage> <reason>`. Do not deviate from the plan quietly, and
39
- never edit an approved document.
33
+ If a task cannot be done as planned (an interface does not allow it, a check shows an earlier document wrong, the plan misses a step), stop.
34
+ Tell the user what was found and which stage it belongs to, and suggest `/wf-reopen <stage> <reason>`.
35
+ Do not deviate from the plan quietly, and never edit an approved document.
40
36
 
41
37
  ## At the end
42
38
 
43
- When every box is ticked, run the plan's "Done when" checks and `bin/wf check`, and whatever else
44
- the project's build steps ask at the end. Reply that `/wf-approve` moves on. Never approve
45
- yourself.
39
+ When every box is ticked, run the plan's "Done when" checks and `bin/wf check`, and whatever else the project's build steps ask at the end.
40
+ Reply that `/wf-approve` moves on.
41
+ Never approve yourself.
@@ -7,18 +7,16 @@ argument-hint: '[what to change]'
7
7
 
8
8
  # /wf-plan: the plan
9
9
 
10
- What will be done, in order, and how anyone will know it worked: a checklist that the build works
11
- through task by task. Whatever the plan rests on is already decided, in an earlier stage or in a
12
- decision entry; a choice that is expensive to reverse does not belong buried in a task.
10
+ What will be done, in order, and how anyone will know it worked: a checklist that the build works through task by task.
11
+ Whatever the plan rests on is already decided, in an earlier stage or in a decision entry; a choice that is expensive to reverse does not belong buried in a task.
13
12
 
14
13
  ## Before anything
15
14
 
16
- Run `bin/wf status --expect plan`. If it fails, stop and tell the user what it said.
15
+ Run `bin/wf status --expect plan`.
16
+ If it fails, stop and tell the user what it said.
17
17
 
18
- Read `.agents/reference/mesearch/workflow.md` once per session, the entry's `index.md`, and
19
- `.agents/reference/stages/plan.md` if the project has it: what this project's plan is distilled
20
- from, what else to read first, and the plan's template. If writing the plan shows a hole in an
21
- earlier stage, stop and suggest `/wf-reopen <stage> <reason>` rather than deciding it here.
18
+ Read `.agents/reference/mesearch/workflow.md` once per session, the entry's `index.md`, and `.agents/reference/stages/plan.md` if the project has it: what this project's plan is distilled from, what else to read first, and the plan's template.
19
+ If writing the plan shows a hole in an earlier stage, stop and suggest `/wf-reopen <stage> <reason>` rather than deciding it here.
22
20
 
23
21
  ## Writing
24
22
 
@@ -39,11 +37,11 @@ summary: <one sentence>
39
37
  <The checks that must pass at the end.>
40
38
  ```
41
39
 
42
- The project's template, where it has one, says what else the plan holds and how a task names its
43
- check.
40
+ The project's template, where it has one, says what else the plan holds and how a task names its check.
44
41
 
45
42
  - Order the tasks so that each builds on finished ones, and what is built works after each.
46
43
  - A task says what to do, not how: the how is decided in an earlier stage or in the build.
47
44
 
48
- Commit each revision. When the plan is right, reply that `/wf-approve` starts the build. Never
49
- approve yourself.
45
+ Commit each revision.
46
+ When the plan is right, reply that `/wf-approve` starts the build.
47
+ Never approve yourself.
@@ -7,36 +7,35 @@ argument-hint: '[pages to start with, or what to change]'
7
7
 
8
8
  # /wf-publish: the pages
9
9
 
10
- The entry is built (or, for a decision, argued). Now the pages that say what {{project}} _is_ must
11
- say it. The archive discussed what might be; the pages tell what is.
10
+ The entry is built (or, for a decision, argued).
11
+ Now the pages that say what {{project}} _is_ must say it.
12
+ The archive discussed what might be; the pages tell what is.
12
13
 
13
14
  ## Before anything
14
15
 
15
- Run `bin/wf status --expect publish`. If it fails, stop and tell the user what it said.
16
+ Run `bin/wf status --expect publish`.
17
+ If it fails, stop and tell the user what it said.
16
18
 
17
- Read `.agents/reference/mesearch/authoring.md` and `.agents/reference/authoring.md` once per
18
- session, the entry's documents, and the code it added, and `.agents/reference/stages/publish.md`
19
- if the project has it: which pages an entry of each kind changes, and what else the publish lists.
20
- Read the pages that are affected (the tracks under `{{content}}/`, the landing page) before
21
- changing them.
19
+ Read `.agents/reference/mesearch/authoring.md` and `.agents/reference/authoring.md` once per session, the entry's documents, and the code it added, and `.agents/reference/stages/publish.md` if the project has it: which pages an entry of each kind changes, and what else the publish lists.
20
+ Read the pages that are affected (the tracks under `{{content}}/`, the landing page) before changing them.
22
21
 
23
22
  ## Writing
24
23
 
25
- - **The pages.** Add or rewrite the pages that describe what now exists, quoting the real code
26
- with `{path:start..end}` fences, and linking the math notes for the mathematics. A choice a reader
27
- would wonder about gets a short `> [!DECISION]` linking the entry that made it.
28
- - **Drop what is no longer true.** A page describes only what now is. What a revised entry built
29
- and this one replaced disappears from the pages; it stays in the archive.
30
- - **The entry's `index.md`.** Replace its opening paragraph with what the entry did, for a reader
31
- of the archive, and list every page it changed under `pages`, with whatever else the project's
32
- publish lists. `wf approve` refuses a changed page that is not listed, and a listed one the
33
- branch did not change.
34
- - **What it amends.** Where the entry moved or removed something a done entry's document refers to
35
- (a math note's equation, a page, a heading), change that reference in the done entry's document,
36
- and list it under `amends` in the entry's `index.md` (`workflow.md`, under "Amending a done
37
- entry"). Change nothing else there.
38
-
39
- Build the site (`cd site && pnpm build`) and fix every warning and broken link. Commit as you go.
40
-
41
- When the pages are right, run `bin/wf check` and reply that `/wf-approve` finishes the entry,
42
- after which the branch is ready to merge. Never approve yourself.
24
+ - **The pages.**
25
+ Add or rewrite the pages that describe what now exists, quoting the real code with `{path:start..end}` fences, and linking the math notes for the mathematics.
26
+ A choice a reader would wonder about gets a short `> [!DECISION]` linking the entry that made it.
27
+ - **Drop what is no longer true.**
28
+ A page describes only what now is.
29
+ What a revised entry built and this one replaced disappears from the pages; it stays in the archive.
30
+ - **The entry's `index.md`.**
31
+ Replace its opening paragraph with what the entry did, for a reader of the archive, and list every page it changed under `pages`, with whatever else the project's publish lists.
32
+ `wf approve` refuses a changed page that is not listed, and a listed one the branch did not change.
33
+ - **What it amends.**
34
+ Where the entry moved or removed something a done entry's document refers to (a math note's equation, a page, a heading), change that reference in the done entry's document, and list it under `amends` in the entry's `index.md` (`workflow.md`, under "Amending a done entry").
35
+ Change nothing else there.
36
+
37
+ Build the site (`cd site && pnpm build`) and fix every warning and broken link.
38
+ Commit as you go.
39
+
40
+ When the pages are right, run `bin/wf check` and reply that `/wf-approve` finishes the entry, after which the branch is ready to merge.
41
+ Never approve yourself.
@@ -9,14 +9,12 @@ argument-hint: '<stage> <reason>'
9
9
 
10
10
  ## Steps
11
11
 
12
- 1. Work out the stage and the reason from what the user wrote; ask for the reason if there is
13
- none. It is recorded in the entry's history, so make it one plain sentence about what was
14
- wrong.
15
- 2. Run `bin/wf reopen <stage> --reason "<reason>"`. If it refuses, tell the user what it said and
16
- stop.
17
- 3. In the reopened stage's document, add (or extend) a `## Revisions` section at its end with a
18
- dated paragraph: what is being changed, and why. Fill in what actually changed as the revision
19
- is made.
12
+ 1. Work out the stage and the reason from what the user wrote; ask for the reason if there is none.
13
+ It is recorded in the entry's history, so make it one plain sentence about what was wrong.
14
+ 2. Run `bin/wf reopen <stage> --reason "<reason>"`.
15
+ If it refuses, tell the user what it said and stop.
16
+ 3. In the reopened stage's document, add (or extend) a `## Revisions` section at its end with a dated paragraph: what is being changed, and why.
17
+ Fill in what actually changed as the revision is made.
20
18
  4. Commit `workflow.json` and the document ("Reopen the <stage> of <slug>: <reason>").
21
- 5. Reply with the reopened stage's skill. Every later stage will be approved again on the way
22
- forward.
19
+ 5. Reply with the reopened stage's skill.
20
+ Every later stage will be approved again on the way forward.
@@ -9,8 +9,8 @@ argument-hint: '<slug>'
9
9
 
10
10
  ## Steps
11
11
 
12
- 1. If the current branch is `main`, make a branch first (`git switch -c <slug>`), unless your
13
- environment names the branch to work on.
14
- 2. Run `bin/wf resume <slug>`. If it refuses, tell the user what it said and stop.
12
+ 1. If the current branch is `main`, make a branch first (`git switch -c <slug>`), unless your environment names the branch to work on.
13
+ 2. Run `bin/wf resume <slug>`.
14
+ If it refuses, tell the user what it said and stop.
15
15
  3. Commit `workflow.json` and `.workflow/active` ("Resume <slug>").
16
16
  4. Read the entry's documents, then reply with where it stands and the stage's skill.
@@ -9,19 +9,17 @@ argument-hint: '<slug> <{{kinds}}> [what it is about] [revises <slug>]'
9
9
 
10
10
  ## Steps
11
11
 
12
- 1. Work out the slug (lowercase words joined by hyphens, named after the idea), the kind, a title,
13
- and any entry it revises from what the user wrote. Ask if the kind is unclear. The kinds, as
14
- `bin/wf kinds` lists them:
12
+ 1. Work out the slug (lowercase words joined by hyphens, named after the idea), the kind, a title, and any entry it revises from what the user wrote.
13
+ Ask if the kind is unclear.
14
+ The kinds, as `bin/wf kinds` lists them:
15
15
 
16
16
  {{kinds-describe}}
17
17
 
18
- 2. If the current branch is `main`, make a branch for the entry first (`git switch -c <slug>`),
19
- unless your environment names the branch to work on.
20
- 3. Run `bin/wf start <slug> --kind <kind> --title "<Title>"`, adding `--revises <slug>,...` when
21
- it changes the story of finished entries. If it refuses, tell the user what it said and stop.
22
- 4. Replace the `[!TODO]` in `{{content}}/archive/<slug>/index.md` with a paragraph saying what the
23
- entry sets out to do and why, from what the user said. Ask for what is missing rather than
24
- inventing it.
18
+ 2. If the current branch is `main`, make a branch for the entry first (`git switch -c <slug>`), unless your environment names the branch to work on.
19
+ 3. Run `bin/wf start <slug> --kind <kind> --title "<Title>"`, adding `--revises <slug>,...` when it changes the story of finished entries.
20
+ If it refuses, tell the user what it said and stop.
21
+ 4. Replace the `[!TODO]` in `{{content}}/archive/<slug>/index.md` with a paragraph saying what the entry sets out to do and why, from what the user said.
22
+ Ask for what is missing rather than inventing it.
25
23
  5. Commit the entry folder and `.workflow/active` ("Start <slug>: <title>").
26
- 6. Reply with the first stage's skill (`bin/wf status` names it). Do not start that stage until
27
- the user invokes it.
24
+ 6. Reply with the first stage's skill (`bin/wf status` names it).
25
+ Do not start that stage until the user invokes it.
@@ -8,8 +8,5 @@ argument-hint: ''
8
8
  # /wf-status
9
9
 
10
10
  1. Run `bin/wf status`, and `bin/wf check` to see whether the branch keeps the rules.
11
- 2. Summarize: the entry and its kind, the stage, what has been approved and when (from
12
- `workflow.json`), the plan's progress if it has one, any problem `check` found, and the
13
- command that comes next.
14
- 3. With no active entry, list the entries in the archive with their stages, and say how one is
15
- started.
11
+ 2. Summarize: the entry and its kind, the stage, what has been approved and when (from `workflow.json`), the plan's progress if it has one, any problem `check` found, and the command that comes next.
12
+ 3. With no active entry, list the entries in the archive with their stages, and say how one is started.
@@ -7,26 +7,23 @@ argument-hint: '[what to write, answer or change]'
7
7
 
8
8
  # /wf-writeup: a decision
9
9
 
10
- A decision is a position the project takes, argued in prose until the user and the agent agree on
11
- it. It is then published into the pages that follow from it. Several small positions that stand or
12
- fall together may share one entry, each with its own `## ` section and its own `> [!TODO]`.
10
+ A decision is a position the project takes, argued in prose until the user and the agent agree on it.
11
+ It is then published into the pages that follow from it.
12
+ Several small positions that stand or fall together may share one entry, each with its own `## ` section and its own `> [!TODO]`.
13
13
 
14
14
  ## Before anything
15
15
 
16
- Run `bin/wf status --expect writeup`. If it fails, stop and tell the user what it said.
16
+ Run `bin/wf status --expect writeup`.
17
+ If it fails, stop and tell the user what it said.
17
18
 
18
- Read `.agents/reference/mesearch/workflow.md`, `.agents/reference/mesearch/authoring.md` and
19
- `.agents/reference/authoring.md` once per session, `.agents/reference/stages/writeup.md` if the
20
- project has it, the entry's `index.md`, and the current draft (`bin/wf path`), if any.
19
+ Read `.agents/reference/mesearch/workflow.md`, `.agents/reference/mesearch/authoring.md` and `.agents/reference/authoring.md` once per session, `.agents/reference/stages/writeup.md` if the project has it, the entry's `index.md`, and the current draft (`bin/wf path`), if any.
21
20
 
22
21
  ## Working with the user
23
22
 
24
- A decision is reached by asking. When the user asks for a decision to be worked out, interrogate
25
- before writing: what they want, what was built or tried before, what the facts it rests on
26
- actually say, and why. Offer alternatives where the user's choice looks weak, where an existing
27
- tool already does this, or where the goals and the design disagree, and say plainly which you
28
- would choose. Record the questions still open as `> [!TODO]` callouts in the draft, and work
29
- through them with the user.
23
+ A decision is reached by asking.
24
+ When the user asks for a decision to be worked out, interrogate before writing: what they want, what was built or tried before, what the facts it rests on actually say, and why.
25
+ Offer alternatives where the user's choice looks weak, where an existing tool already does this, or where the goals and the design disagree, and say plainly which you would choose.
26
+ Record the questions still open as `> [!TODO]` callouts in the draft, and work through them with the user.
30
27
 
31
28
  Each invocation is one revision of `{{content}}/archive/<slug>/writeup.md`:
32
29
 
@@ -53,9 +50,9 @@ What it makes easy, what it makes hard, and what it costs.
53
50
  What else was considered, and why it lost.
54
51
  ```
55
52
 
56
- A long decision (a charter, or several positions) may use its own sections instead, as long as it
57
- argues rather than describes. After a reopening, keep a `## Revisions` section saying what changed
58
- and why.
53
+ A long decision (a charter, or several positions) may use its own sections instead, as long as it argues rather than describes.
54
+ After a reopening, keep a `## Revisions` section saying what changed and why.
59
55
 
60
- Commit each revision. When nothing is open, reply that `/wf-approve` moves to publishing. Never
61
- approve yourself.
56
+ Commit each revision.
57
+ When nothing is open, reply that `/wf-approve` moves to publishing.
58
+ Never approve yourself.
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { page } from '$app/state';
3
- import type { NavSection } from '../nav';
3
+ import type { NavItem, NavSection } from '../nav';
4
4
 
5
5
  let { open = $bindable(false) }: { open?: boolean } = $props();
6
6
 
@@ -9,29 +9,56 @@
9
9
  // compared without it.
10
10
  const bare = (path: string) => path.replace(/\/+$/, '');
11
11
  const here = $derived(bare(page.url.pathname));
12
+ const under = (href: string) => here === bare(href) || here.startsWith(bare(href) + '/');
13
+
14
+ // A section folded away lists its items only while the reader is in it.
15
+ const shown = (section: NavSection) => !section.folded || under(section.href);
16
+ // An item with children unfolds while the reader is on one of them, or under its `within`.
17
+ const unfolded = (item: NavItem) =>
18
+ !!item.children &&
19
+ (item.children.some((child) => here === bare(child.href)) ||
20
+ (item.within !== undefined && under(item.within)));
12
21
  </script>
13
22
 
23
+ {#snippet link(item: NavItem, current: boolean)}
24
+ <a href={item.href} aria-current={current ? 'page' : undefined} onclick={() => (open = false)}
25
+ >{#if item.code}<code>{item.title}</code
26
+ >{:else}{item.title}{/if}{#if item.status && item.status != 'done'}
27
+ <span class="status-dot status-{item.status}" title={item.status}></span>{/if}</a
28
+ >
29
+ {/snippet}
30
+
14
31
  <nav id="sidebar" class="sidebar" class:open aria-label="Documentation">
15
32
  {#each sections as section (section.id)}
16
- <details open={section.items.length > 0}>
33
+ <details open={section.items.length > 0 && shown(section)}>
17
34
  <summary>
18
35
  <a href={section.href}>{section.title}</a>
19
36
  </summary>
20
- {#if section.items.length}
37
+ {#if section.items.length && shown(section)}
21
38
  <ol>
22
39
  {#each section.items as item (item.key)}
23
- <li class:nav-sub={item.sub}>
24
- <a
25
- href={item.href}
26
- aria-current={here === bare(item.href) ? 'page' : undefined}
27
- onclick={() => (open = false)}
28
- >{#if item.code}<code>{item.title}</code
29
- >{:else}{item.title}{/if}{#if item.status && item.status != 'done'}
30
- <span
31
- class="status-dot status-{item.status}"
32
- title={item.status}
33
- ></span>{/if}</a
34
- >
40
+ {@const unfold = unfolded(item)}
41
+ <li
42
+ class:nav-sub={item.sub}
43
+ class:nav-group={item.children}
44
+ class:unfolded={unfold}
45
+ >
46
+ <!-- A group's own link is the current page only when it is a document
47
+ of its own (an entry), not when it stands for its first child. -->
48
+ {@render link(
49
+ item,
50
+ here === bare(item.href) &&
51
+ !item.children?.some((child) => bare(child.href) === here),
52
+ )}
53
+ {#if unfold && item.children}
54
+ <ol>
55
+ {#each item.children as child (child.key)}
56
+ <li class="nav-child">
57
+ {@render link(child, here === bare(child.href))}
58
+ </li>
59
+ {/each}
60
+ </ol>
61
+ {/if}
35
62
  </li>
36
63
  {/each}
37
64
  </ol>
@@ -4,7 +4,8 @@
4
4
 
5
5
  let { id, eyebrow, blurb }: { id: string; eyebrow?: string; blurb: string } = $props();
6
6
  const section = $derived((page.data.nav as NavSection[]).find((s) => s.id == id)!);
7
- const first = $derived(section.items[0]);
7
+ // The first document to read: the first item, or its first child when it is a group.
8
+ const first = $derived(section.items[0]?.children?.[0] ?? section.items[0]);
8
9
  </script>
9
10
 
10
11
  <a class="card track-card" href={first && id != 'archive' ? first.href : section.href}>
package/app/lib/nav.ts CHANGED
@@ -1,19 +1,25 @@
1
1
  // The navigation every page shows: each track's pages, the math notes, and the archive's entries.
2
2
  // A site's `+layout.server.ts` builds it with `navigation()` and may add to it, as skoro lists
3
- // each crate's page under its page of the crates.
3
+ // each crate's page under its page of the crates. The math notes are listed by part where the
4
+ // mathematics has parts, each part linking to its first note and holding the rest; the archive
5
+ // lists its entries, each holding its documents, and is folded away outside the archive.
4
6
  import { cms } from '$cms';
5
- import { ARCHIVE, MATH, NAV, TRACKS } from '$site';
7
+ import { ARCHIVE, MATH, MATH_PARTS, NAV, TRACKS } from '$site';
6
8
 
7
9
  import { resolve } from '$app/paths';
8
10
  import { linkOf, type DocumentLink } from './documents';
9
11
 
10
12
  /**
11
13
  * A link in the navigation. `sub` indents it under the item before it, and `code` sets its title
12
- * in the monospace face, as for a crate's page.
14
+ * in the monospace face, as for a crate's page. An item with `children` (a part of the
15
+ * mathematics, an entry of the archive) is a group, which the sidebar unfolds only while the
16
+ * reader is on one of its children, or anywhere under `within`.
13
17
  */
14
18
  export type NavItem = Pick<DocumentLink, 'key' | 'title' | 'href' | 'status'> & {
15
19
  sub?: boolean;
16
20
  code?: boolean;
21
+ children?: NavItem[];
22
+ within?: string;
17
23
  };
18
24
 
19
25
  export interface NavSection {
@@ -22,6 +28,8 @@ export interface NavSection {
22
28
  short: string;
23
29
  href: string;
24
30
  items: NavItem[];
31
+ // Whether the sidebar lists the items only while the reader is under `href`.
32
+ folded?: boolean;
25
33
  }
26
34
 
27
35
  export interface NavigationOptions {
@@ -43,14 +51,38 @@ export function navigation(options: NavigationOptions = {}): NavSection[] {
43
51
  const math: NavSection = {
44
52
  ...MATH,
45
53
  href: resolve('/math'),
46
- items: cms.math.list().map(linkOf),
54
+ items: MATH_PARTS.length
55
+ ? MATH_PARTS.flatMap((part) => {
56
+ const notes = cms.math.list(part.id).map(linkOf);
57
+ const first = notes[0];
58
+ return first
59
+ ? [
60
+ {
61
+ key: `math-part/${part.id}`,
62
+ title: part.title,
63
+ href: first.href,
64
+ children: notes,
65
+ },
66
+ ]
67
+ : [];
68
+ })
69
+ : cms.math.list().map(linkOf),
47
70
  };
48
71
  const at = NAV.mathBefore ? tracks.findIndex((track) => track.id == NAV.mathBefore) : -1;
49
72
  if (at < 0) tracks.push(math);
50
73
  else tracks.splice(at, 0, math);
51
74
  return [
52
75
  ...tracks,
53
- { ...ARCHIVE, href: resolve('/archive'), items: cms.archive.list().map(linkOf) },
76
+ {
77
+ ...ARCHIVE,
78
+ href: resolve('/archive'),
79
+ folded: true,
80
+ items: cms.archive.list().map((entry) => {
81
+ const link = linkOf(entry);
82
+ const children = cms.archive.documents(entry.key).map(linkOf);
83
+ return children.length ? { ...link, children, within: link.href } : link;
84
+ }),
85
+ },
54
86
  ];
55
87
  }
56
88
 
@@ -213,6 +213,25 @@ main {
213
213
  }
214
214
  }
215
215
 
216
+ /* A group (a part of the mathematics, an entry of the archive) and, while it is unfolded, its
217
+ children beneath it. */
218
+ li.nav-group.unfolded > a {
219
+ color: var(--fg-1);
220
+ font-weight: 550;
221
+ }
222
+
223
+ li.nav-child a {
224
+ padding-left: calc(2 * var(--space-3));
225
+
226
+ &[aria-current='page'] {
227
+ padding-left: calc(2 * var(--space-3) - 1px);
228
+ }
229
+ }
230
+
231
+ ol ol {
232
+ margin-top: 0;
233
+ }
234
+
216
235
  /* A link listed under the one before it, as a crate's page under the page of the crates. */
217
236
  li.nav-sub a {
218
237
  padding-left: calc(2 * var(--space-3));
@@ -66,15 +66,18 @@ export function renderWorkflow(text, config) {
66
66
  if (pagesAt.length) {
67
67
  areas.push(`the pages (the rest of ${code(`${content}/`)}) at ${openedAt(pagesAt)}`);
68
68
  }
69
- let areaText = `${areas.join('; ')}. Without an active entry, code is closed and the rest is open for ` +
70
- 'housekeeping.';
71
- areaText = areaText.slice(0, 1).toUpperCase() + areaText.slice(1);
69
+ // One sentence to a line, at the indent of the list item the template puts them in.
70
+ const capitalized = (text) => text.slice(0, 1).toUpperCase() + text.slice(1);
71
+ const areaSentences = [
72
+ `${capitalized(areas.join('; '))}.`,
73
+ 'Without an active entry, code is closed and the rest is open for housekeeping.',
74
+ ];
72
75
  if (config.free?.length) {
73
76
  const free = config.describe?.free ?? config.free.map(code).join(', ');
74
- areaText +=
75
- ` ${free.slice(0, 1).toUpperCase()}${free.slice(1)} ${config.free.length > 1 ? 'are' : 'is'} ` +
76
- 'always open, so that a fact can be recorded the moment it is known.';
77
+ areaSentences.push(`${capitalized(free)} ${config.free.length > 1 ? 'are' : 'is'} always open, so that a ` +
78
+ 'fact can be recorded the moment it is known.');
77
79
  }
80
+ const areaText = areaSentences.join('\n ');
78
81
  const gates = ['a document that is uncommitted, empty, or still has a `> [!TODO]`'];
79
82
  for (const stage of stages) {
80
83
  const { sections = [], checklist } = config.stages[stage];
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/sync/render.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,GAAG,CAAC,MAAsB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,IAAI,cAAc,CAAC;AAC7E,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC;AAC7C,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AAEvF,eAAe;AACf,SAAS,MAAM,CAAC,KAAe;IAC3B,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC;QACnB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAClB,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAChE,CAAC;AAED,oEAAoE;AACpE,SAAS,KAAK,CAAC,IAAc,EAAE,IAAgB;IAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAChC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,MAAM,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O,EAAE,UAAU,CAAC,EAC9B,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACjB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAE,CAAC;QACrD,MAAM,QAAQ,GACV,QAAQ,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAC5E,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC,CAAC,CACL,CAAC;IAEF,OAAO,IAAI,CAAC,IAAI,EAAE;QACd,GAAG,MAAM,CAAC,MAAM,CAAC;QACjB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,SAAS;QACzB,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QAC7B,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;KAC5C,CAAC,CAAC;AACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mvarble/mesearch-workflow",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Documented development: the workflow engine a project's entries go through, the skills that drive it, and the documentation site its records are published on.",
5
5
  "license": "MIT",
6
6
  "author": "Matthew Varble <matthew@rodent.club>",
@@ -51,12 +51,12 @@
51
51
  "dependencies": {
52
52
  "@fontsource-variable/inter": "^5.2.5",
53
53
  "@fontsource/jetbrains-mono": "^5.2.5",
54
+ "@mvarble/mesearch-cms": "^0.4.1",
55
+ "@mvarble/mesearch-markdown": "^0.2.0",
56
+ "@mvarble/mesearch-ui": "^0.2.0",
54
57
  "katex": "^0.18.4",
55
58
  "mdsvex": "^0.12.7",
56
- "remark-math": "3.0.0",
57
- "@mvarble/mesearch-cms": "^0.4.0",
58
- "@mvarble/mesearch-markdown": "^0.2.0",
59
- "@mvarble/mesearch-ui": "^0.2.0"
59
+ "remark-math": "3.0.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@sveltejs/adapter-static": "^3.0.10",
@@ -1,7 +1,6 @@
1
1
  # Writing {{name}}'s documents
2
2
 
3
- This project's own conventions, over `.agents/reference/mesearch/authoring.md` and `markup.md`,
4
- which win where nothing here says otherwise.
3
+ This project's own conventions, over `.agents/reference/mesearch/authoring.md` and `markup.md`, which win where nothing here says otherwise.
5
4
 
6
5
  ## What the site is for
7
6
 
@@ -1,5 +1,4 @@
1
1
  # This project's stages
2
2
 
3
- A file here named after a stage (`plan.md`, `build.md`, `publish.md`, `writeup.md`) says what that
4
- stage asks of this project beyond what its skill says: what to read first, the template a document
5
- follows, how a task is checked, which pages a publish changes. The skill reads it when it is there.
3
+ A file here named after a stage (`plan.md`, `build.md`, `publish.md`, `writeup.md`) says what that stage asks of this project beyond what its skill says: what to read first, the template a document follows, how a task is checked, which pages a publish changes.
4
+ The skill reads it when it is there.
@@ -2,37 +2,31 @@
2
2
 
3
3
  ## How to work here
4
4
 
5
- **Conversation is the default.** Answer questions, explain things and sketch ideas in the reply:
6
- none of that needs a workflow, and none of it should start one.
5
+ **Conversation is the default.**
6
+ Answer questions, explain things and sketch ideas in the reply: none of that needs a workflow, and none of it should start one.
7
7
 
8
- **The development workflow runs only when the user invokes it**, through the `/wf-*` commands
9
- (`.agents/skills/wf-*`). Every change to the code goes through an entry. The procedure is in
10
- `.agents/reference/mesearch/workflow.md`, and `bin/wf kinds` lists the kinds of entry.
8
+ **The development workflow runs only when the user invokes it**, through the `/wf-*` commands (`.agents/skills/wf-*`).
9
+ Every change to the code goes through an entry.
10
+ The procedure is in `.agents/reference/mesearch/workflow.md`, and `bin/wf kinds` lists the kinds of entry.
11
11
 
12
12
  Rules that hold whether or not a command was invoked:
13
13
 
14
- - Never start, approve, reopen, abandon or resume an entry on your own judgment, and never run
15
- `bin/wf start|approve|reopen|abandon|resume` except inside the skill the user invoked for it.
16
- - Never do a stage's work outside its skill. Asked to write code with no entry at the build stage,
17
- say so and point to the command that would get there.
18
- - `bin/wf guard` runs before every edit in Claude Code (`.claude/settings.json`) and refuses one
19
- the stage does not allow. Do not work around a refusal; it is telling you which command the
20
- user would need to give.
14
+ - Never start, approve, reopen, abandon or resume an entry on your own judgment, and never run `bin/wf start|approve|reopen|abandon|resume` except inside the skill the user invoked for it.
15
+ - Never do a stage's work outside its skill.
16
+ Asked to write code with no entry at the build stage, say so and point to the command that would get there.
17
+ - `bin/wf guard` runs before every edit in Claude Code (`.claude/settings.json`) and refuses one the stage does not allow.
18
+ Do not work around a refusal; it is telling you which command the user would need to give.
21
19
  - When work at one stage shows an earlier stage wrong, stop and say so; the user may reopen it.
22
20
 
23
21
  ## Managed files
24
22
 
25
- `@mvarble/mesearch-workflow` owns the files `.workflow/managed.json` lists: `bin/wf` and
26
- `.workflow/engine/`, the `wf-*` skills it ships, `.agents/reference/mesearch/`, and the site's
27
- shared routes and components. `bin/wf guard` refuses an edit to one; a change to one is made in
28
- that package, and `pnpm exec mesearch-wf sync` in `site/` brings it here. What this project does
29
- differently goes in this file, in `.agents/reference/authoring.md`, in
30
- `.agents/reference/stages/<stage>.md`, and in skills of its own beside the managed ones.
23
+ `@mvarble/mesearch-workflow` owns the files `.workflow/managed.json` lists: `bin/wf` and `.workflow/engine/`, the `wf-*` skills it ships, `.agents/reference/mesearch/`, and the site's shared routes and components.
24
+ `bin/wf guard` refuses an edit to one; a change to one is made in that package, and `pnpm exec mesearch-wf sync` in `site/` brings it here.
25
+ What this project does differently goes in this file, in `.agents/reference/authoring.md`, in `.agents/reference/stages/<stage>.md`, and in skills of its own beside the managed ones.
31
26
 
32
27
  ## Writing documents
33
28
 
34
- Everything in `site/content/` is written as `.agents/reference/mesearch/authoring.md` and
35
- `markup.md` say, with this project's own conventions in `.agents/reference/authoring.md`.
29
+ Everything in `site/content/` is written as `.agents/reference/mesearch/authoring.md` and `markup.md` say, with this project's own conventions in `.agents/reference/authoring.md`.
36
30
 
37
31
  ## Checks
38
32