Commit e1f1502
authored
Docs site information architecture: sections, anchors, and site links (#8)
* Plan the docs site information architecture and the upstream debt
Records what PR #7 left open, so it stops living in a chat log.
Three items about how the published site is organised and linked:
- W-D1, sections in the docs. Done in sidebar.ts with categories over
existing doc IDs, not by moving files -- moving them would change every
published URL, break every relative cross-reference, and hit the positional
numbering trap CLAUDE.md warns about.
- W-D2, deep links to headings. Sequenced behind onBrokenAnchors: 'throw',
because anchors are currently validated by neither checker: onBrokenLinks
covers routes rather than fragments, and the gate skips site-absolute
targets outright. Adding anchors first would recreate the hole PR #6 and
PR #7 closed.
- W-D3, README links to the site rather than to GitHub. Flagged as the item
that expands scope: src/engine/ and docs.ps1 have no page to link to, so
this means authoring new content, and it is blocked on deciding whether
those pages should exist at all. The two companion-repo links legitimately
stay on GitHub.
Two pieces of upstream debt, both belonging in Docusaurus-Template rather
than here, following the precedent of #54 and #55 -- fix upstream, then
adopt. Nothing in build/ is locally modified; it is vendored verbatim, which
is what keeps Invoke-SetupDocs -Overwrite safe to re-run.
- W-D4, the gate's link-parsing gap: a target containing whitespace or ')'
cannot match its regex and is invisible to the check. Raised in review on
PR #6, verified, recorded in plans/02 -- and never actually filed upstream.
Confirmed not live here, so it is correctness work rather than an outage.
- W-D5, the vendored gate is 33 lines behind upstream, missing an anchor-slug
fix that matches GitHub's hyphenation and a root-resolution fallback.
Sequenced before W-D2, since it changes which slugs the gate expects and
this repository has em dashes in headings.
Ordering is stated at the end, with the reasoning for it. None of this is on
the MVP critical path; TODO.md W1 remains the next engine unit.
* Implement the docs site information architecture
Implements W-D1, W-D2, W-D3, and W-D5 from the plan added in the previous
commit, in the order that plan set out. W-D4 is upstream work and is filed
against Docusaurus-Template separately.
W-D5, first because it moves the goalposts for W-D2. The vendored gate was 33
lines behind upstream, missing an anchor-slug fix that hyphenates the way
GitHub does (one hyphen per space, not per run, so '## Phase 1 -- Fixes'
slugs with the doubled hyphen the removed em dash leaves) and a
root-resolution fallback. Every existing anchored link was checked against
both the old and new slug rules before syncing: none changed meaning, so this
landed without collateral. build/Test-Documentation.ps1 is byte-identical to
upstream again.
W-D2. onBrokenAnchors: 'throw' set first, then the anchors. Fragments were
the one link class nothing validated -- onBrokenLinks resolves routes, and
the gate skips site-absolute targets by design -- so adding anchors before
closing that would have reopened the hole PR #6 and PR #7 spent their time
on. Twelve README links now point at headings rather than whole pages, each
computed with the gate's own slug algorithm and checked against the real
heading first.
W-D1. Sections come from a manual sidebar naming doc ids, not from folders.
Grouping by folder would have moved files, and moving files changes every
published URL, breaks every relative cross-reference, and runs into the
positional numbering CLAUDE.md warns about. Orientation, Contracts,
Delivery, Working on It -- with 04-core before 03-story-graph-kind, which is
the reading order the specs assert. Every /docs/engine/<slug> URL is
unchanged. sidebar_position is removed from all eight pages rather than left
contradicting the explicit order, and 04-core's sentence claiming the sidebar
reads it was corrected.
W-D3. The three README links to code and tooling now have somewhere on the
site to point: guide/engine-package and guide/documentation-site, in their
own section because they are contributor-facing rather than specifications.
The two companion-repository links stay on the code host, which is correct --
they are other repositories. They overlap CLAUDE.md and agent.md only in
part and deliberately: those are agent-facing, stay unpublished, and are not
what you hand a contributor.
The /docs/ landing page is restructured to match the sidebar, and the
generated site root is regenerated from the updated README. CLAUDE.md and
agent.md no longer describe an autogenerated sidebar or sidebar_position
ordering, neither of which is true any more.
Validated locally, since pwsh and Docker are unavailable here: every sidebar
id resolves to a file, every relative link on the landing page resolves,
and all site-absolute links and anchors across the guide pages and the
generated root resolve to real pages and real headings.
* Fix the sidebar doc ids: Docusaurus strips numeric prefixes
Verify Documentation Build failed on the previous commit:
Invalid sidebar file at "sidebar.ts".
These sidebar document ids do not exist:
- engine/01-vision
- engine/02-architecture
- engine/03-story-graph-kind
- engine/04-core
Docusaurus's numberPrefixParser strips a leading numeric filename prefix when
deriving a doc id -- the same reason the prefix never appears in the URL. So
engine/01-vision.md is engine/vision. MVP, TODO, and OPEN-QUESTIONS carry no
prefix and resolved fine, which is exactly the four-versus-three split the
error showed.
My local check verified that docs/docs/<id>.md existed, which confirms a
filename rather than a doc id -- so it passed on ids the build then rejected.
Replaced with a check that derives ids the way Docusaurus does, strips the
prefix, and reports both directions: an id in the sidebar with no file, and a
file no sidebar entry references. The second matters as much, since a manual
sidebar makes an unlisted page invisible rather than merely misordered.
The file comment asserted the wrong rule outright -- "the numeric filename
prefixes stay" -- which is the assumption that produced the bug, so it is
corrected rather than left to mislead the next edit.
The build aborts on sidebar ids before it validates links, so
onBrokenAnchors: 'throw' and the twelve new anchored links are still
unexercised by CI.
* Correct three inaccurate claims in the new guide pages
Review found five items. Three are real, and all three are mistakes in prose
this PR added -- the guides asserted things about the repository that are not
true of it.
The Node floor. engine-package said Node 24 is "enforced by engines.node so a
local install and CI cannot drift apart". It is not: npm treats engines as
advisory unless engine-strict is set, and no .npmrc here sets it. Verified --
there is no .npmrc in the repository at all. A local install on Node 22 warns
and proceeds. Reworded to say what the declaration actually does: it states
the floor, CI selects it separately, and neither enforces it locally. Adding
engine-strict would make the original claim true and is worth considering,
but it changes what happens on a contributor's machine and does not belong in
a documentation change.
The generated-page count. documentation-site said "Two pages are not
[authored directly]" and then described the second as ordinary authored
content -- contradicting itself in consecutive bullets. There is exactly one
generated page: DocumentationRules.psd1 has a single GeneratedFiles entry,
docs/src/pages/index.md. Rewritten to say one, and to state plainly that the
/docs/ landing page sits next to it in the tree but is not generated and can
be edited freely, since that adjacency is what makes the mistake easy.
The link checks. documentation-site was headed "Two link checks, and they do
not overlap". They do: the gate resolves a #fragment against the target's
headings (its line 435), and Docusaurus checks anchors too, so a relative
anchored link inside docs/docs/ is covered by both. Replaced with what is
actually true -- complementary, overlapping in the middle -- and a table
splitting what only each one covers from what both do. The overlap is not
waste; the gaps at either end are the point, and the rewrite says which gap
opens if either check is relaxed.
agent.md checked for the same error and does not have it: it says "between
them everything is now gated", which is accurate.
All links and anchors re-validated after the edits: none broken. No README
change, so the generated site root is untouched.1 parent ee3872b commit e1f1502
18 files changed
Lines changed: 433 additions & 54 deletions
File tree
- build
- docs
- docs
- engine
- guide
- src/pages
- plans
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | | - | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | 87 | | |
85 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
79 | 102 | | |
80 | 103 | | |
81 | 104 | | |
| |||
240 | 263 | | |
241 | 264 | | |
242 | 265 | | |
243 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
244 | 273 | | |
245 | 274 | | |
246 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
0 commit comments