Skip to content

Commit ec303fe

Browse files
committed
docs(changeset): prose example gate covers content/docs
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ajwvrmd1hDC9RBofYBhGuR
1 parent f0bea00 commit ec303fe

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
"@objectstack/spec": patch
3+
---
4+
5+
feat(spec): the example type-check gate now covers `content/docs`, not just `skills/`
6+
7+
`check:skill-examples` compiles the TypeScript in prose against the built spec, so
8+
an example that stops compiling fails CI instead of quietly teaching code that no
9+
longer works. It does its job — it caught the broken `defineTool` example when
10+
`tool.requiresConfirmation` was removed (#3715).
11+
12+
But it only ever walked `skills/`:
13+
14+
| Tree | files with `ts` blocks | compiled |
15+
|---|---|---|
16+
| `skills/` | 9 | **9** |
17+
| `content/docs/` (hand-written) | 124 | **0** |
18+
19+
The identical break in a docs page would have shipped. Docs examples are copied
20+
verbatim by humans and AI exactly like skill examples, so a gate covering a
21+
fraction of the surface it appears to cover reads as coverage — the same shape as
22+
the stale-evidence and orphan-proof warnings fixed in #3857 / #3868.
23+
24+
The walker is now a `SOURCE_ROOTS` list, and this lands the first batch: **164
25+
docs blocks across 63 pages, taking the gate from 32 to 196 checked examples**.
26+
`content/docs/references/` is excluded — `build-docs.ts` regenerates it from the
27+
schemas, so it cannot drift independently of its source.
28+
29+
**The marker is now per-format.** MDX has no HTML comments: `<!-- os:check -->` in
30+
a `.mdx` fails the fumadocs build outright — *"Unexpected character `!`… to create
31+
a comment in MDX, use `{/* text */}`"*. Caught by building the docs site, after
32+
the first attempt broke 60+ pages. `skills/**/*.md` keeps `<!-- os:check -->`;
33+
`content/docs/**/*.mdx` uses `{/* os:check */}`. Both spellings are recognised for
34+
**orphan** detection, so a wrong-format marker fails loudly rather than silently
35+
checking nothing — the existing guard's philosophy, extended to the new failure
36+
mode this change introduces.
37+
38+
The batch was measured rather than guessed: marking all 780 docs blocks and
39+
compiling showed which are self-contained. One subtlety worth recording — a block
40+
that "passes" inside a 780-file program can be leaning on globals declared by
41+
*other* blocks (a file with no import/export is a global script), so the set was
42+
converged by recompiling and dropping newly-failing blocks until green. 164 stand
43+
on their own.
44+
45+
The remaining blocks are mostly fragments (a `columns: [...]` subtree), which the
46+
gate's opt-in design already anticipates. Whether any are genuine rot is worth a
47+
follow-up now that the machinery reaches them.

0 commit comments

Comments
 (0)