Commit d516483
fix(spec): give the client-SDK surface a page-scoped docs root so SDK pages can opt into check:skill-examples (#12339)
* fix(spec): give the client-SDK surface a page-scoped docs root
`check:skill-examples` resolves modules per SURFACE, and a root was always a
whole subtree — so "which packages may this page import?" was a property of the
tree a page lives in. `content/docs/**` resolves against `@objectstack/spec`
alone, and spec does not depend on `@objectstack/client`, so a marker on any
docs fence importing the SDK red with TS2307 on correct code. Two pages
recorded that in prose and left their SDK blocks deliberately unmarked.
`SourceRoot.pages` makes a root a page SET rather than a tree, so the two SDK
pages join the client-SDK surface that already resolves those packages for its
19 TSDoc blocks — no new resolution environment and no new extraction code.
The scoped root's `pages` and the broad root's `excludePages` read one shared
constant, and two guards prove the partition every run: no file may be scanned
by two surfaces, and every scoped page must exist.
Opts in the four fences that are self-contained (Quick Start, the
`createFilter()` chain and the React Hooks block on the SDK page; the
`services.data` example on the data-service page). The remaining nine are
continuation fragments that read Quick Start's `client` and stay unmarked; both
pages' notes now record the measurement rather than the old constraint.
* fix(spec): the scoped-page guard must skip a root whose dir is absent
`assertScopedPagesExist()` asserted SDK_DOCS_PAGES unconditionally, but this
script is run against repo-SHAPED sandbox trees as well as the repo: the #7181
dist-freshness pins build one that seeds skills/, packages/spec/src and the two
client packages and has no content/docs at all. There the guard reported both
SDK pages missing and — being an assert that runs before everything else —
spoke ahead of the three verdicts those tests pin, hijacking a positive
control, a staleness refusal and an orphan-marker finding alike.
`sourceFiles()` already skips a root whose `dir` does not exist. The defect was
two predicates disagreeing about whether a root is present in this checkout at
all, the same shape as the two fence closers (#11690) and the two
fence-ownership notions (#11355) this file has already collapsed. The guard now
restates that one rule.
The rename protection is untouched: content/docs always exists in a real
checkout, so a page renamed inside it is still judged and still reds. Pinned in
both directions, with a control — an absent dir is silent in BOTH predicates,
while the identical page list under a dir that DOES exist is still flagged, so
the exemption is the dir and not a predicate gone quiet.
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent e3430a2 commit d516483
3 files changed
Lines changed: 483 additions & 45 deletions
File tree
- content/docs
- api
- kernel/runtime-services
- packages/spec/scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 | | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| 68 | + | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| |||
513 | 519 | | |
514 | 520 | | |
515 | 521 | | |
| 522 | + | |
516 | 523 | | |
517 | 524 | | |
518 | 525 | | |
| |||
669 | 676 | | |
670 | 677 | | |
671 | 678 | | |
| 679 | + | |
672 | 680 | | |
673 | 681 | | |
674 | 682 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
0 commit comments