Skip to content

Fix reference sync, slugs, and linting issues (CX-3425)#13

Open
jesseyowell wants to merge 16 commits into
mainfrom
jesse/cx-3425-misc-cli-issues-around-reference-sync-slugs-and-linting
Open

Fix reference sync, slugs, and linting issues (CX-3425)#13
jesseyowell wants to merge 16 commits into
mainfrom
jesse/cx-3425-misc-cli-issues-around-reference-sync-slugs-and-linting

Conversation

@jesseyowell

@jesseyowell jesseyowell commented Jun 18, 2026

Copy link
Copy Markdown

Fixes the follow-up issues from CX-3425.

Update: main removed the numbering.js validator entirely (the -N auto-renamer) to fix a duplicate-pages bug. This branch has merged that change and drops CX-3425 item 2 (the -1 renamer + redirect file) accordingly — the auto-rename approach is gone, so its redirect enhancement no longer applies. Item 2 should be revisited as a redirect-only approach in a follow-up, coordinated with @minhthanhdang. The remaining four items are unaffected.

What changed

  1. Reference pages are OAS-owned. oas:sync no longer writes or updates title/excerpt on api-backed reference pages (generated pages carry only api.file + api.operationId); the frontmatter linter no longer requires title on reference pages that declare api.file; and the title/excerpt "out of sync" checks were removed. This clears the must have required property 'title' and Out of sync: title…/excerpt… false positives. Existing title/excerpt are left untouched (non-destructive).
  2. Cross-section duplicate slugs allowed. Duplicate-slug detection is now scoped per top-level section, so the same slug in docs/ and reference/ is no longer flagged.
  3. Unknown components are warnings. Components not built-in or in local custom_blocks/ (e.g. <ClosedBeta> global/Enterprise blocks) are now warnings, not errors, so they don't fail CI.
  4. Stale _order.yaml entries flagged. Entries listed in _order.yaml with no matching file/folder — and index entries — are now flagged (warning) and removable with --fix, across docs/, reference/, recipes/, and custom_pages/. (Implemented as a single per-directory pass that diffs the on-disk slug set against the _order.yaml entries.)

(Dropped: item 2, the -1 renamer/redirects — see the update note above.)

Tests

Adds a node:test suite under test/ (the repo previously had none): 17 tests, all passing (npm test). Covers each changed validator plus edge cases (cross-section duplicates allowed, unknown component is a warning, --fix add/remove paths, a folder entry with no markdown children is not flagged stale).

End-to-end verification

Ran lint on the Lightcast reference project (~1,111 reference pages) with main vs. this branch:

Rule / severity Before After
frontmatter required-title errors 327 0 ✅ item 1
oas-reference "Out of sync" title/excerpt 723 0 ✅ item 1
duplicates cross-section false positives 3 1 ✅ item 2 (now item numbering shifted)
ordering stale _order.yaml entries 0 2 (newly caught) ✅ item 4
Total errors 339 10

~1,050 false-positive findings eliminated on reference content that OAS now owns. The 10 remaining errors are 1 real within-reference/ duplicate + 9 real broken links — genuine pre-existing issues, not regressions, so lint still correctly exits 1. Verification was read-only; no --fix against the cloned data.

Notes

  • The docs: commits are the design spec and implementation plan under docs/superpowers/ — planning artifacts, not product code.
  • Version bumped to 0.0.29.
  • Includes a merge of main (which removed the numbering.js validator).

🤖 Generated with Claude Code

Jesse Yowell and others added 3 commits June 18, 2026 09:07
The reference title/excerpt update path was removed in CX-3425, leaving
changes.updated permanently empty. Remove it from the changes object,
the syncOas JSDoc, and the oas:sync run() summary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pass

Replace the two-pass design (files-derived 'missing from order' + a second
filesystem walk for stale entries) with one walk per content dir that diffs
the on-disk slug set against the _order.yaml entries: missing = onDisk -
ordered, stale = ordered - onDisk. Removes findOrderFiles, entryExists, and
the dirContents/seenOrderFiles bookkeeping. Behavior unchanged; adds a test
that a folder entry with no markdown children is not flagged stale.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…i-issues-around-reference-sync-slugs-and-linting

# Conflicts:
#	src/validators/numbering.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant