Write toolkit generator output safely#1077
Draft
jottakka wants to merge 4 commits into
Draft
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jottakka
marked this pull request as draft
July 17, 2026 03:44
Contributor
Author
|
bugbot run |
|
Current version of PR was reviewed by /review-bugbot on Jul 17, 00:49 GMT-3. It flagged 0 findings. Bugbot on commit |
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
bugbot run |
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
bugbot run |
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 264ca42. Configure here.
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
--overwrite-outputfrom deleting the repository root, home directory, or outside-repository pathsTest plan
pnpm exec tsc --noEmit --project toolkit-docs-generator/tsconfig.jsonpnpm exec vitest run --root toolkit-docs-generatorNote
Medium Risk
Changes default output location and overwrite safety rules, which can surprise existing workflows; filesystem deletion guards reduce catastrophic misuse risk.
Overview
Hardens toolkit docs generation so writes and
--overwrite-outputare less likely to corrupt data or delete the wrong paths.JSON output: Toolkit IDs are validated before any file is written (safe filename pattern,
indexreserved, case-insensitive collisions blocked). Per-toolkit andindex.jsonwrites use atomic replace (temp file + rename).index.jsontoolkit entries are sorted deterministically by normalized ID.CLI / paths: Default
-ooutput moves totoolkit-docs-generator/data/toolkitsvia sharedresolveDefaultOutputDir. Clearing output delegates toclearSafeOutputDir, which refuses dangerous targets (repo root, generator package root, home, and relative paths outside the repo).Tests: Coverage for unsafe IDs, collisions, index sorting, safe clear behavior, and default output resolution.
Reviewed by Cursor Bugbot for commit 264ca42. Bugbot is set up for automated code reviews on this repo. Configure here.