You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(spec): the example type-check gate now covers content/docs, not just skills/ (#3882)
check:skill-examples compiles the TypeScript in prose against the built spec, so
an example that stops compiling fails CI instead of quietly teaching code that no
longer works. It does its job — it caught the broken defineTool example in #3876.
But it only ever walked skills/:
skills/ 9 files with ts blocks, 9 compiled
content/docs/ 124 files with ts blocks, 0 compiled
The identical break in a docs page ships. Docs examples are copied verbatim by
humans and AI exactly like skill examples — the same shape as the stale-evidence
and orphan-proof warnings fixed in #3857 / #3868: a gate covering a fraction of
the surface it appears to cover reads as coverage.
The walker is now a SOURCE_ROOTS list, and this lands the first batch: 164 docs
blocks across 63 pages, taking the gate from 32 to 196 checked examples.
content/docs/references/ is excluded — build-docs.ts regenerates it from the
schemas, so it cannot drift independently.
THE MARKER IS NOW PER-FORMAT. MDX has no HTML comments: `<!-- os:check -->` in a
.mdx does not degrade, it fails the fumadocs build outright ("Unexpected
character `!`… to create a comment in MDX, use `{/* text */}`"). Found by building
the docs site after the first attempt broke 60+ pages; nothing in the type-check
gate would have said so, because block extraction is regex-level and never parses
MDX. skills/**/*.md keeps `<!-- os:check -->`; content/docs/**/*.mdx uses
`{/* os:check */}`. Both spellings are recognised for ORPHAN detection, so a
wrong-format marker fails loudly instead of silently checking nothing.
The batch was measured, not guessed: marking all 780 docs blocks and compiling
showed which are self-contained. One subtlety — a block that "passes" inside a
780-file program can be leaning on globals declared by OTHER blocks (a file with
no import/export is a global script), so the first pass's 564 "passing" blocks
collapsed to 164 once compiled as the real, smaller set. Converged by recompiling
and dropping newly-failing blocks until green.
The remaining blocks are mostly fragments, which the opt-in design anticipates.
Whether any are genuine rot is now answerable for the first time.
0 commit comments