Skip to content

check-doc-snippet-types.mjs collects only .mdx under content/docs — 40 .md guides are uncovered with no UNGATED_DOCS entry, contradicting its own "covered by default" rule #5174

Description

@yinlianghui

Found while adding a tsx snippet to content/docs/guide/public-forms.md for objectui#5112 (PR #5173). Filed unassigned and NOT fixed there — #5112 is scoped to EmbeddableForm's thank-you redirect; this is a CI gate's scan surface.

What

scripts/check-doc-snippet-types.mjs states its coverage rule in its own docblock:

A document is covered unless it is named in UNGATED_DOCS with a reason.

and its fragment rule exists specifically so that a snippet is never skipped silently:

The rule for fragments: explicit marker, never a silent skip

But the collector picks documents by extension:

else if (entry.endsWith('.mdx')) out.push(relative(root, p).split(sep).join('/'));

Under content/docs that admits 143 .mdx and excludes 40 .md. None of the 40 appears in UNGATED_DOCS, so they are not "ungated with a reason" — they are invisible to the gate's own accounting, which is the silent skip the script is written to prevent. The summary line it prints (Scanned N document(s): … ungated — declared in this script) cannot mention them, so a reader has no signal that a third of the guide tree is unverified.

Measured

Of those 40 .md files, at least 20 hold ts/tsx fences today (count = fences opened with ```tsx/```ts/```typescript):

24 content/docs/guide/component-registry.md
14 content/docs/guide/theming.md
13 content/docs/guide/plugin-development.md
12 content/docs/guide/plugins.md
12 content/docs/guide/architecture.md
11 content/docs/guide/schema-rendering.md
11 content/docs/guide/building-crud-app.md
 9 content/docs/guide/troubleshooting.md
 9 content/docs/guide/layout.md
 8 content/docs/guide/schema-overview.md
 7 content/docs/rfcs/0001-clipboard-paste.md
 7 content/docs/guide/public-forms.md
 7 content/docs/guide/expressions.md
 6 content/docs/guide/data-source.md
 5 content/docs/guide/user-state-persistence.md
 5 content/docs/guide/notifications.md
 4 content/docs/guide/slotted-pages.md
 4 content/docs/guide/metadata-diagnostics.md
 3 content/docs/plugins/index.md
 3 content/docs/guide/quick-start.md

These are user-facing getting-started guides — the pages a reader copies from most — and they are exactly the class of document objectui#5160 found broken elsewhere (published READMEs importing symbols their packages do not export, 15 TS2305 against the built dist). READMEs are collected by this gate; the .md guides next to the .mdx ones are not.

Two readings, and why this is filed rather than fixed

  1. Oversight. The docblock's "covered unless named in UNGATED_DOCS" is the intended rule and the extension filter defeats it for 40 documents. Fix: collect .md too, then triage the resulting diagnostics — most will need FRAGMENT_MARKER (the .md marker spelling already exists in the script, which suggests .md was in scope at design time), some will be real defects, and any page whose snippets are genuinely uncompilable gets an UNGATED_DOCS entry with a reason.
  2. Deliberate v1 scoping. The gate landed very recently (.github/workflows/doc-snippet-types.yml is on main but not at c2dc477), and its author may have scoped the first cut to .mdx on purpose, planning .md as a follow-up.

I could not tell which from the code — the docblock argues for reading 1, the filter implements reading 2, and nothing in either says the other was considered. That is itself worth resolving: whichever is intended, the .md exclusion should be stated where the coverage rule is stated, so the next reader is not told "covered by default" by a script that covers by extension.

Turning the filter on is not a one-line change in practice — a first local look at public-forms.md alone shows fences that are deliberate prose fragments (a bare consent: { … } object literal), so the work is the triage pass, not the collector edit.

Reachability, honestly

Nothing a user hits at runtime — this is CI coverage, not product behaviour. Its cost is the defects it does not catch: a broken snippet in one of the 20 files above ships to the docs site and is found by a reader instead of by the gate, which is precisely the failure objectui#5160 documents on the surfaces the gate does cover.

Related: objectui#5106 (the same shape in a different gate — check-doc-component-types's scan surface stops at code fences), objectui#5160 (what uncovered doc snippets cost when they rot), objectui#4823 / #5138 (the gate's deferred second dimension).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions