fix(spec): converge root docs meta.json onto the declared page list (#11482) - #12213
Merged
Merged
Conversation
…11482) build-docs.ts §3 built the root content/docs/references/meta.json (the sidebar's category list) by filtering on `categoryZodFiles` — the `.zod.ts` files found on disk — a third, independent enumeration of "the pages of this category", alongside §2's own meta.json and §2.5's card grid (both already keyed off `categoryMetaPages` per #11260). A category whose published pages all come from plain `.ts` files (the `misc` catch-all class — `security/misc` proves the shape) has zero `.zod.ts` files while still publishing a page. The old filter would drop such a category from the root sidebar even though it is fully generated and routed everywhere else. No category is in that state today (all 14 have `zodFiles.size > 0`), so this was latent and the regenerated root meta.json is byte-identical (verified: same sha256, empty git diff). §3 now reads `categoryMetaPages`, the same declared list §2.5 already reads, via an extracted `rootCategoryDirs` (scripts/lib/root-meta.ts) pinned with the all-`misc` fixture shape #11260 used for the card grid — the edge has no live instance in the repo, so only a unit test can assert it.
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11482
What
build-docs.ts§3 (// 3. Update root meta.json) built the ROOTcontent/docs/references/meta.json— the sidebar's top-level category list —by filtering on
categoryZodFiles(the.zod.tsfiles found on disk), athird, independent enumeration of "the pages of this category" alongside §2's
own
meta.jsonand §2.5's card grid (both already keyed offcategoryMetaPagesper #11260).A category whose published pages all come from plain
.tsfiles rather than.zod.tsones (themisccatch-all class —security/miscproves the shapeis real) has zero
.zod.tsfiles while still publishing a page, ameta.jsonand anindex.mdx. The old filter would drop such a categoryfrom the root sidebar even though §2 and §2.5 both fully generated it — a
folder complete on disk and unreachable from the nav.
§3 now reads
categoryMetaPages, the same declared list §2.5 already reads,via an extracted
rootCategoryDirs(scripts/lib/root-meta.ts) — one answerto "which categories exist," read three times, instead of three answers that
happened to agree today.
Measured — no live instance, byte-identical output
No category is in the latent state today (all 14 have
zodFiles.size > 0),so this was a latent defect with no observable effect. Verified directly:
pnpm --filter @objectstack/spec gen:docsbefore and after the fixproduces a
content/docs/references/meta.jsonwith the same sha256(
41bb8932b11061fbc0bd6168b4087c5528ac75d41359be72db8bfd21b3106eef) and anempty
git diffacrosscontent/docs/.pnpm --filter @objectstack/spec check:docspasses clean (229 generatedfiles in sync).
Because the edge this fixes has no live instance, it cannot be pinned from
generated output in either direction — the same reasoning #11260's
category-index.test.tsgives for the card-grid fix. The rule is pinneddirectly in
scripts/root-meta.test.tsagainst the extractedrootCategoryDirs, with the misc-shaped fixture that has no repo instance(an all-
misccategory with zero.zod.tsfiles), plus the empty/sort/real-14-category shapes.
Scope
packages/spec/scripts/build-docs.ts§3 only, its extractedscripts/lib/root-meta.ts, the pin (scripts/root-meta.test.ts), and achangeset. Not touched: #11601 (nested-item describe rendering — a different
defect class in the same file; that card is serialized behind this one and
was not addressed here).
Tests
All run scoped to
@objectstack/specunder the shared verify lock,HEAD
900d16b:pnpm --filter @objectstack/spec build— clean.pnpm --filter @objectstack/spec exec vitest run scripts/root-meta.test.ts scripts/category-index.test.ts scripts/root-index.test.ts— 3 files / 31 tests passed.pnpm --filter @objectstack/spec typecheck(tsc --noEmit+check:scripts-typecheck+check:test-typecheck) — clean.pnpm --filter @objectstack/spec check:docs— clean, byte-identical rootmeta.json(see Measured above).pnpm --filter @objectstack/spec exec vitest run(full package suite) — 427 test files passed (427), 11352 tests passed (11352).pnpm --filter @objectstack/spec run check:empty-state / check:liveness / check:strictness-ledger / check:variant-docs— all clean.npx eslint --no-inline-config --format jsonscoped to exactly the 3 changed TS files — 0 errors / 0 warnings across all 3; this repo's ESLint config enables no type-aware linting for any file (eslint.config.mjs, documented at itsQUERY_OPTIONS_TEST_GLOBScomment), so this 3-file scope cannot move judgment on any untouched file.node scripts/pm/dispatch-gates.mjsfor this diff:check:changeset-gate-self-tests,check:merge-driver,check:objectui-changeset,check:published-files,check:slot-lookup,check:test-source-alias,check:type-source-resolution,check-adr-0087-registration.mjs,check-changeset-no-major.mjs,check-empty-changeset.mjs,check-plugin-teardown-shape.mjs,docs-audit/check-affected-docs.mjs,docs-audit/check-drift-comment.mjs,release-rehearsal-clone.mjs --self-test— all clean.check:query-options-erasure,check:engine-double-contract,check:cross-package-test-inputs,check:where-matcher,check:type-check-coverage(structural) — all clean.check-dev-prereqs.mjs(full 78-packagepnpm buildprecondition) andcheck:type-check-debt --re-measure(same full-workspace-build precondition) — out of scope for a single scripts-layer file per the local-verification-scope discipline; CI's own build step covers both, and the new file is fully covered by the existingtsconfig.scripts.jsonprogram with 0 errors, so it cannot move either ledger.Generated by Claude Code
Generated by Claude Code