chore(content): add check:library-content audit for content posts - #8526
Merged
Merged
Conversation
…d customer posts Validates frontmatter against the strict ContentFrontmatterSchema, slug/folder parity, local ogImage existence, MDX compilation with remark-gfm, FAQ placement, and internal post links (including retired and moved slugs). Moves the library slug redirect maps into lib/library/retired-slugs.ts so next.config.ts and the audit share one source. Fixes two FAQ answers that rendered Markdown links as literal text.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
… rules Treat draft blog/library posts and customer stories missing from CUSTOMER_STORIES as unserved link targets, reserve only sibling folders that define a page or route, validate author profiles with AuthorSchema, check moved blog slug destinations, and reject ogImage paths that resolve outside public.
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was successfully deployed
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.
Summary
check:library-content(scripts/check-library-content.ts), picked up automatically bybun run check:audits. It validates everyapps/sim/content/{blog,library,customers}/<slug>/index.mdx, or a single post with--slug <section>/<slug>/--slug <slug>/ a bare<slug>for local agent runs. Each rule is exact, so nothing needs an override:frontmatter: gray-matter parses it and it passes the real strictContentFrontmatterSchema(imported, not duplicated), socanonicaland other unknown keys fail; every author id has a profile incontent/authors.slug:slugequals the folder name.og-image:ogImageis a local path to a file underapps/sim/public.mdx: the body compiles with@mdx-js/mdx+remark-gfm(the compilernext-mdx-remoteruns for the registry). The error line maps back to the line in the file.faq: noFAQ/FAQsheading in the body, and no Markdown link syntax inside a frontmatter FAQ question or answer (it renders as literal text).internal-link: everyhttps://www.sim.ai/<section>/<slug>link, and every relative/<section>/<slug>link target, resolves to an existing post folder. A retired library slug fails and names the surviving slug; a blog slug that moved to/libraryfails and names its new path. Asset paths (/library/<slug>/cover.jpg), static sub-routes (tags,authors,rss.xml, read from the app router tree), and fenced code are skipped. Apexhttps://sim.ailinks stay withcheck:site-urls.LIBRARY_MERGED_SLUGStarget still exists.LIBRARY_MOVED_BLOG_SLUGSandLIBRARY_MERGED_SLUGSfromnext.config.tsintoapps/sim/lib/library/retired-slugs.ts, so the redirects and the audit read the same map.library/ai-agent-vs-chatbotshowed[Sim](...)and[Chat interface](...)as literal Markdown. They now use plain text.@mdx-js/mdx@3.1.1to the root devDependencies. It is the version already in the lockfile, so the script no longer depends on a hoisted transitive package.Type of Change
Testing
bun run check:library-contentpasses on 80 posts in about 1s, and about 328 internal post links are validated.scripts/check-library-content.test.tswrites fixture posts to a temp dir and covers one failure mode per rule, with exact file lines. I removed each guard in turn (12 mutations) and every one turned the suite red.## FAQheading, retired/moved/typo links, an unclosed tag). The CLI reported all 9 problems with file:line and a fix hint, then the copy was removed.bun run lint,bun run check:audits(54 audits), andapps/simbun run type-checkall pass.Checklist
🤖 Generated with Claude Code