Repository navigation
Commit 3f3c906
authored
test(docs): fail when a subsystem doc names a repo path that does not exist (#2910)
Fixes #2906
`core/test/check-doc-paths.test.js` judged inline-code repo paths on the
two root READMEs only, so `docs/**` was never read: on 2026-11-11 ten
backticked paths across four subsystem docs still named files #2830 had
moved into `plugins/project/` (#2895), and a reader who followed one
landed on a missing file while the suite stayed green. #2897 repointed
those ten but added no guard, so the same rot can land again silently.
This adds `docTreeMisses()`, which scans `docs/**/*.md` and reports a
backticked token as a miss only when it opens with `core/`, `plugins/`
or `patches/` and ends in a code or document extension — the narrow rule
that found exactly those ten misses on the tree and nothing else, so no
allowlist is needed (#1403). A second, constructed case pins the four
shapes that are *not* repo-path claims (package-relative
`scripts/check-arch-docs.mjs`, tool/branch names `plugins/list` and
`dev/bench.sh`, another repository's `docs/FACE_ROOMS.md`, an example
traversal `decisions/../outside.md`), keeps fenced blocks out, and
requires one genuine miss (`plugins/project/src/project-board.js` in the
synthetic tree) to be reported.
### Red first
The tree is green once #2897 landed, so the red is a mutation: with
`docs/subsystems/core-host.md:241` put back to the old
`core/src/host/project-board.js`, the real-tree case fails on exactly
that line —
```
docs/subsystems/core-host.md:241: core/src/host/project-board.js
```
Restored, 4/4 pass twice.
### What I ran
- `core/test/check-doc-paths.test.js` alone: 4/4 green twice; once with
the mutation above, red on `core-host.md:241`.
- The same scan over the tree at this tip: 42 documents, 0 misses.
- `node scripts/ds-bot-patches.mjs generate` then `check` — `ok 10
patches apply cleanly in order`, `ok core/ equals ds-bot/ +
patches/ds-bot/`; the mirror
`patches/ds-bot/files/test/check-doc-paths.test.js` is the only
generated entry.
- `TZ=UTC npm run verify` — green (`EXIT=0`).
- `node core/scripts/check-arch-docs.mjs` with
`ARCH_DOCS_BASE=f9ce2a48141fbf5ae0e49e6f9f9feb37eba65fa6` — `arch-docs:
OK (3 changed file(s))` on the committed tree.
- `node .github/scripts/changelog.mjs check` — `27 fragment(s) in
changelog.d/ are well formed`.
Not run: `smoke` — it cannot start in this checkout (`EROFS` symlinking
the pnpm store into `.dsh-test-smoke`), so it is skipped rather than
counted green.
No `core/client.js` and no `*.patch` file is touched: the only generated
entry is the updated test mirror, which the `core/ equals ds-bot/ +
patches/` check requires.
Owner: Dev-1
Reviewer: Birfy
Written-by: Dev-1
Bot: Dev-1
Claim-Id: e010e841df044e14ad628dd863fd9b8d
Risk tier: T1 (`core/test/**`, `patches/**`, `changelog.d/**`)
Base: `f9ce2a48141fbf5ae0e49e6f9f9feb37eba65fa6` (live `main` at push
time)
Verified commit: `85598ef21a4771ac98ef79861e4390664b69cf01` (tree
`ff244f11fd06e5d542ffbd5b03be89d5dc06d3c5`), pushed head is generated
from that tree by the push path
## Checkpoint
<!-- flybot:checkpoint -->
```json
{
"pr": 2910,
"claim": "Dev-1",
"issue": 2906,
"summary": "The repo-path guard now reads docs/**/*.md: a backticked core/, plugins/ or patches/ path ending in a code or document extension that does not exist fails the suite, so a subsystem doc that keeps naming a moved file is caught. The narrow rule finds zero misses on today's tree and exactly the ten #2897 fixed; a constructed case keeps package-relative, tool/branch, cross-repository and example tokens out and reports one real miss. Mutation of one doc path back to its old value is the red.",
"files": [
"core/test/check-doc-paths.test.js",
"changelog.d/2906-doc-tree-paths.changed.md",
"patches/ds-bot/files/test/check-doc-paths.test.js"
],
"checks": {
"ran": "the test file alone twice green, once with the mutation red; docs scan over the tree; ds-bot-patches generate+check; TZ=UTC npm run verify; arch-docs; changelog check",
"result": "green",
"at": "85598ef21a4771ac98ef79861e4390664b69cf01"
},
"next": "none — ready for review"
}
```
<!-- /flybot:checkpoint -->1 parent 84a7868 commit 3f3c906
3 files changed
Lines changed: 141 additions & 2 deletions
File tree
- changelog.d
- core/test
- patches/ds-bot/files/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
51 | 94 | | |
52 | 95 | | |
53 | 96 | | |
| |||
71 | 114 | | |
72 | 115 | | |
73 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
51 | 94 | | |
52 | 95 | | |
53 | 96 | | |
| |||
71 | 114 | | |
72 | 115 | | |
73 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
0 commit comments