Validate and canonicalize generated toolkit routes#1065
Draft
jottakka wants to merge 2 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jul 16, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8fb9dfe. Configure here.
jottakka
marked this pull request as draft
July 16, 2026 18:22
Use one safe slug contract across route discovery, integration cards, and the sitemap so invalid or duplicate entries cannot publish broken links. Co-authored-by: Cursor <cursoragent@cursor.com>
jottakka
force-pushed
the
split/validate-toolkit-doc-routes
branch
from
July 16, 2026 20:18
8fb9dfe to
35ecefc
Compare
Keep a malformed index entry from changing the source of the entire route set, and prevent redirecting fallback-category URLs from entering the sitemap. Co-authored-by: Cursor <cursoragent@cursor.com>
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
Test plan
pnpm testNote
Medium Risk
Changes affect SEO surfaces (sitemap, canonical paths) and which integration pages/routes exist; invalid catalog entries are dropped rather than linked, which is intentional but could hide data issues until tests fail.
Overview
Toolkit slugs are validated before they become URLs:
getToolkitSlugcan returnnull, rejects unsafedocsLinkpath segments (e.g. encoded slashes,__proto__), and only accepts slugs matching a safe pattern. Integration links, canonical paths, static params, and slug-based data lookup skip or error when no valid slug exists instead of emitting bad routes.One shared route list drives the integrations index, static generation, and sitemap:
listToolkitRoutesreturns routes sorted by category then slug; the sitemap merges those toolkit URLs with authoredpage.mdxpaths and deduplicates by URL.Stricter
index.jsonparsing rejects malformed toolkit index entries instead of casting loosely typed JSON.Reviewed by Cursor Bugbot for commit 8fb9dfe. Bugbot is set up for automated code reviews on this repo. Configure here.