Commit af01080
committed
feat(gate): give check-docs-section-name a real YAML parser arm
Widens the gate from a TS-fence-only rule to two arms over one corpus.
YAML fences are handed to the `yaml` package -- the same parser the docs
build resolves -- and judged on its AST, never on a regex.
The AST, not `toJS()`: a JS projection collapses duplicate keys, and
duplicate keys are the normal shape of a teaching fence that concatenates
two snippets. Judging the projection would have hidden 4 real nameless
sections behind the key that won.
Decides what #10830 deferred. `yaml` recovers from nearly everything, so
"did it throw" is not the question. A fence whose every error is SEMANTIC
(DUPLICATE_KEY -- a complete, unguessed tree) is JUDGED and counted as
recovered; a fence with any SYNTAX error is NOT judged, but is counted and
printed, because a finding drawn from a guessed tree is a fabricated
finding. That skip population is empty on this tree, so --self-test carries
it rather than the corpus.
Also corrects the docblock's stale census: 21-across-16 was true at
4019e16 and is not true now.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pk26oZ12t5N1hwGW1m1MgC1 parent f1c8d79 commit af01080
1 file changed
Lines changed: 462 additions & 42 deletions
0 commit comments