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
fix(spec): emit the "do not edit" banner on the generated category overviews (#14731)
`content/docs/references/**` is claimed by `manageDir(DOCS_ROOT, …)`, so
`flush()` deletes what it owns before rewriting — a hand edit to any page in
that tree is discarded by the next `gen:docs` run with no gate red and no
conflict, because `check:docs` re-derives the tree and then reports it current.
The banner is the only in-page signal a contributor gets before that happens.
200 of the tree's 214 pages carried it. The 14 that did not were the
per-category overviews: the §2.5 template built each page line by line and
never emitted the line §2 emits for every schema page. Ownership was never in
doubt, only the warning.
The banner string now lives in one place — `AUTO_GENERATED_BANNER` in
`lib/generated-output.ts`, the sink module whose `manageDir()` claim the banner
announces — and all three emission sites use it: §2 (schema pages), §2.5
(category overviews, new) and `lib/root-index.ts` (the root index, which
already carried its own identical copy of the literal). One spelling, so a
future reword cannot split the tree into two populations of page.
The 14 overviews are re-emitted by the generator, not hand-edited; the other
200 pages and the root index come out byte-identical, which `check:generated`
proves.
`scripts/references-banner.test.ts` asks the question of the TREE rather than
of a template: every `.mdx` under `content/docs/references/` carries the banner
in its first 25 lines, banner-less set empty, with a page-count floor and a
non-empty-banner guard so the walk cannot pass vacuously.
Claude-Session: https://claude.ai/code/session_017RbbUMnxkUnWhE4j94v8FE
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments