fix(scripts): scan only committable files for leaks - #185
Merged
Merged
Conversation
Both leak scanners walked the raw filesystem with hand-rolled skip lists, so an ignored tooling export under prompt-exports/ carrying a home path turned the local repository check red. List files through git instead: tracked plus untracked-but-unignored, minus nested repositories and files deleted from the working tree. Shipped bytes stay covered by the release builder's own archive scan.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #185 +/- ##
==========================================
+ Coverage 66.97% 67.04% +0.07%
==========================================
Files 35 36 +1
Lines 9659 9680 +21
==========================================
+ Hits 6469 6490 +21
Misses 3190 3190
🚀 New features to boost your workflow:
|
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
Both leak scanners walked the raw filesystem with hand-rolled skip lists, so an ignored RepoPrompt export under
prompt-exports/(globally gitignored) carrying a home path turned the localbun run checkred today while CI was green. The scanners' contract is what a commit could carry — the workflow comments already describe them as reading tracked text — so they now list files through git:scripts/repository-files.ts:git ls-files -z --cached --others --exclude-standardminus--deleted; nested repositories (which git reports as onedir/entry, e.g..qualification/oh-my-pi/in the ARM64 job) are skipped.walk()and skip lists; exemptions and extension filters are unchanged.build-release.tsalready runsfindCapabilityLeaksover every archive member, so no longer scanning ignoredapps/web/distoutput loses nothing.Validation
scripts/repository-files.test.ts: tempgit initwith a committed file, a file deleted from the working tree only, an untracked file, a.gitignore-excluded directory and pattern, and a nested repository — exactly.gitignore,new-untracked.ts,tracked.mdare listed.prompt-exports/…:58: absolute home path; the new one passes. An untracked probe file with a home path still fails the new scanner (exit 1, correct path reported).bun run checkon the branch: repository check, typecheck, build, 610/610 tests, both scans pass.Security and privacy impact
docs/SECURITY.mdand ADRs: no trust boundary changed.Compatibility
Not applicable; repository tooling only.
Documentation