Skip to content

Commit 01c5032

Browse files
claude[bot]os-zhuangclaude
authored
feat(gates): parse every docs frontmatter block locally, not in next build (#10752)
Nothing under `scripts/` YAML-parsed `content/docs/**` frontmatter. The one gate that reads those pages line by line, `check:doc-anchors`, deliberately blanks the block, so the closest thing to a frontmatter reader was the thing that erases it. The only owner of "this frontmatter parses" was `Build Docs` — a full `next build` on a 30-minute-timeout runner that exists only in CI and is path-filtered besides. `scripts/check-doc-frontmatter.mjs` reads the corpus with the docs build's own extractor regex and the same `yaml` parser fumadocs resolves, and types the two keys `pageSchema` declares. Wired into lint.yml directly (root package.json is inside the #9465 fence), both legs. Closes #10493 Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt Co-authored-by: Claude <jack@objectstack.ai> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent e2bb237 commit 01c5032

2 files changed

Lines changed: 807 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,41 @@ jobs:
621621
- name: Doc/skill authoring guard
622622
run: pnpm check:doc-authoring
623623

624+
# Docs frontmatter parses (#10493). Nothing local YAML-parsed these pages.
625+
# The one gate that reads them line by line — `check:doc-anchors` below —
626+
# deliberately BLANKS the frontmatter block ("preserving line count"),
627+
# which is right for heading ids and left the closest thing to a
628+
# frontmatter reader as the thing that erases it. So "every page's
629+
# frontmatter parses" had exactly one owner: the `Build Docs` job in
630+
# ci.yml, a full `next build` on a 30-minute-timeout runner that exists
631+
# only in CI and is path-filtered besides. A page landed whose unquoted
632+
# `description` contained `apis: `, YAML read the colon-plus-space as the
633+
# start of a nested mapping, and that build was what said so.
634+
#
635+
# This reads the corpus with the docs build's OWN extractor regex and the
636+
# same `yaml` parser fumadocs resolves, and types the two keys
637+
# `pageSchema` declares (`title: z.string()` required,
638+
# `description: z.string().optional()` typed when present) — not a schema
639+
# of its own: the shape one character from the original defect PARSES and
640+
# yields an object, and only the type assertion sees it.
641+
#
642+
# Population is the WHOLE corpus, generated `references/**` included,
643+
# because that is what `Build Docs` parses; scoping to the hand-written
644+
# half would leave 214 of 403 pages carrying the gap this closes. Every
645+
# unread state is a refusal rather than a quiet pass — an absent root, a
646+
# tree resolving to zero pages, or a page that cannot be read all exit 1
647+
# naming what could not be read (#4690 / #7484).
648+
#
649+
# Invoked as `node` rather than through a `pnpm check:*` alias, same as
650+
# the aggregator-roster step below: that alias belongs in root
651+
# package.json, declared territory of the @changesets/cli v3 migration
652+
# lane (#9465) while it runs. Dependency-free filesystem read, sub-second
653+
# over the whole corpus.
654+
- name: Docs frontmatter parses
655+
run: |
656+
node scripts/check-doc-frontmatter.mjs --self-test
657+
node scripts/check-doc-frontmatter.mjs
658+
624659
# #7484 docs anchors: `lychee.toml` sets `include_fragments = "none"`, so
625660
# the `Check Documentation Links` job resolves a link's FILE and never its
626661
# `#anchor` — measured with the pinned lychee 0.24.2 under the CI argv, a

0 commit comments

Comments
 (0)