Repository navigation
fix: redact home-directory paths from machine-readable outputs - #425
Merged
Merged
Conversation
Scan JSON, SARIF, Markdown, HTML, and JUnit now write paths relative to the scan root, or ~/… when a path sits under a home directory outside that root. vg build --json and vg doctor --json follow the same rule. Terminal text is unchanged. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
A path inside the scan or build root is written relative to that root. A path under the same home but outside the root is written as `../…`. Any other `/Users/<user>/` or `/home/<user>/` prefix is removed, and the result does not use `~/`. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
vibgrate-team
marked this pull request as ready for review
October 9, 2026 13:36
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
Default JSON, SARIF and report output could contain absolute home-directory paths (
/Users/<user>/…,/home/<user>/…). Those paths leak usernames and make the same project produce different output on different machines.Machine-readable output now rewrites them with a shared helper,
src/core-open/utils/portable-path.ts:src/main.ts).../other/lib.ts./Users/<user>/or/home/<user>/prefix.homeare left unchanged.The rewrite runs when scan results,
vg report, and graph JSON, report and HTML are written. Terminal text is unchanged and there's no new flag.test/portable-output-paths.test.tsplants/home/…and/Users/…fixture paths, checks they don't appear in JSON, SARIF or report output, and checks that identical inputs stay byte-identical.Related issues
Closes #282
Checklist
pnpm testpassespnpm lintis cleanpnpm typecheckis cleanHow to verify
pnpm test pnpm lint pnpm typecheck