Skip to content

feat(windows): add complete Windows support to Bumblebee scanner - #30

Open
dimension-zero wants to merge 3 commits into
perplexityai:mainfrom
dimension-zero:main
Open

feat(windows): add complete Windows support to Bumblebee scanner#30
dimension-zero wants to merge 3 commits into
perplexityai:mainfrom
dimension-zero:main

Conversation

@dimension-zero

Copy link
Copy Markdown

Summary

Add comprehensive Windows compatibility to Bumblebee scanner. Windows builds now compile and run correctly on amd64 and arm64 architectures.

Changes

Platform Support

  • Windows drive root detection (C:, D:, etc.)
  • Windows user home patterns (C:\Users<name>)
  • Browser extensions: Chrome, Edge, Brave, Firefox on Windows
  • MCP config: Claude Desktop %APPDATA%\Claude path
  • System roots: Python and NuGet global package locations

Test Compatibility

  • Set USERPROFILE environment variable in tests (Windows uses USERPROFILE, not HOME)
  • Scanner tests: Support both / and \ path separators
  • All existing tests pass on Windows

Build & CI

  • GoReleaser: Windows binaries for amd64 and arm64
  • GitHub Actions: Test on windows-latest

Filesystem Walker

  • Windows-specific excludes: AppData\Local\Temp, AppData\Local\Microsoft, AppData\Local\Packages, AppData\LocalLow

Verification

  • ✅ All tests pass: go test ./... -race
  • ✅ Build succeeds: go build ./cmd/bumblebee
  • ✅ Selftest passes: selftest OK (3 findings)
  • ✅ Windows roots detected correctly on test machine

Testing

Tested on Windows 11 Pro with Go 1.25.

dimension-zero and others added 3 commits May 27, 2026 15:17
Add Windows compatibility across the entire scanning pipeline:

Core Platform Support:
- isBroadHomeRoot(): Detect Windows drive roots (C:\), C:\Users patterns
- Browser extensions: Chrome, Edge, Brave, Firefox paths for Windows
- MCP config: Add %APPDATA%\Claude for Claude Desktop on Windows
- System roots: Python and NuGet global package locations

Test & Walk Fixes:
- Set USERPROFILE env var in tests (HOME override doesn't work on Windows)
- Scanner tests: Support both / and \ path separators in assertions
- Walk excludes: Add AppData directories (Temp, Microsoft, Packages, LocalLow)

Build & CI:
- GoReleaser: Build Windows binaries for amd64 and arm64 architectures
- CI: Test on windows-latest in addition to macOS and Linux

All tests pass on Windows. Build succeeds with CGO_ENABLED=0.
Selftest verifies: 'selftest OK (3 findings)'
Action versions (checkout v6, setup-go v6) are already ahead of
checklist targets — left untouched.

Co-authored-by: dimension-zero <info@ditech.ai>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Niicolaa pushed a commit to Niicolaa/bumblebee that referenced this pull request Aug 4, 2026
Adds Windows to the supported endpoint set so baseline/project scans
discover MCP configs (%APPDATA%\Claude, Continue), Chromium-family
extensions (Chrome/Edge/Brave/Chromium/Vivaldi/Arc under
%LOCALAPPDATA%), and Firefox-family profiles (%APPDATA%\Mozilla\...).
isBroadHomeRoot now recognises Windows drive roots and bare
<drive>:\Users[\<name>] homes. Endpoint UID stays empty on Windows
rather than emitting "-1" when user.Current fails. setHomeDir test
helper sets HOME/USERPROFILE/APPDATA/LOCALAPPDATA together so existing
home-based tests run on all three platforms. CI matrix gains
windows-latest and goreleaser builds windows amd64/arm64 zip archives.

Tracks perplexityai#2; implemented from scratch rather than
adopting any of the open upstream PRs (#4, perplexityai#16, perplexityai#30).
Niicolaa pushed a commit to Niicolaa/bumblebee that referenced this pull request Aug 4, 2026
Audited the earlier Windows work against the four upstream attempts
(#3, #4, perplexityai#16, perplexityai#30) and found five things it got wrong or missed. Two of
them would have made CI red on the windows-latest runner that the same
change added to the matrix.

CI-breaking:

  - The selftest step had no `shell: bash`. windows-latest defaults to
    PowerShell, where invoking the extensionless build output does not
    work as it does in a POSIX shell. The gofmt step already pinned
    bash; this one did not.
  - scanner_test.go asserted on literal "/proj/" and "/dup/" substrings
    of source_file, which is a native path. TestEndToEndScan could only
    have passed on Unix.

Correctness:

  - npm and pnpm derived project_path by slash-joining segments after
    an internal filepath.ToSlash, so a Windows record carried
    C:/src/app instead of C:\src\app. This is upstream issue #1
    ("Windows package records should preserve native project paths");
    PR #3 was closed with the note that it would be folded into the
    broader Windows work, and it then was not. Both now convert back
    with filepath.FromSlash, with regression tests.
  - DefaultExcludes had no Windows entries, so a deep sweep of
    %USERPROFILE% descended into AppData/Local/{Temp,Microsoft,Packages}
    and AppData/LocalLow — the Windows analogue of the macOS Library
    subtrees already excluded there.
  - systemRoots returned nil on Windows, missing machine-wide Python
    under %ProgramFiles%\PythonNN\Lib\site-packages; per-user Python
    under %LOCALAPPDATA%\Programs\Python\* was missing too.

Also corrects an over-reach in the preceding ecosystem commit: it added
~/.m2/repository and ~/.gradle/caches as baseline roots, but both are in
walk.DefaultExcludes precisely because they are high-cost dependency
caches, and opening every cached JAR on a 6-hourly profile is exactly
what that exclusion exists to prevent. Those, plus the Pub/Hex/Conan/
Swift caches (which hold no file this scanner parses), are dropped from
baseline; all remain reachable via --root or a deep sweep.

To make the retained ~/.nuget/packages root earn its walk, adds a
.nuspec parser for the global packages folder — installed-state
evidence for NuGet, the analogue of RubyGems' installed *.gemspec. The
per-version directory shape is required so an authoring .nuspec in a
source tree, whose <version> is often a $token$, is not read as an
install.
Niicolaa pushed a commit to Niicolaa/bumblebee that referenced this pull request Aug 4, 2026
Follow-up to the initial Windows support, from reviewing the earlier
upstream Windows attempts (#3, #4, perplexityai#16, perplexityai#30). Two of these would have
made CI red on the windows-latest runner the previous commit added.

CI-breaking:

  - The selftest step had no `shell: bash`. windows-latest defaults to
    PowerShell, where invoking the extensionless build output does not
    work as it does in a POSIX shell. The gofmt step already pinned
    bash; this one did not.
  - scanner_test.go asserted on literal "/proj/" and "/dup/" substrings
    of source_file, which is a native path, so TestEndToEndScan could
    only have passed on Unix. Now normalized before matching.

Correctness:

  - npm and pnpm derived project_path by slash-joining segments after an
    internal filepath.ToSlash, so a Windows record carried C:/src/app
    instead of C:\src\app. This is issue #1 ("Windows package records
    should preserve native project paths"); PR #3 was closed with the
    note that it would be folded into the broader Windows work, and it
    then was not. Both now convert back with filepath.FromSlash, with
    regression tests.
  - DefaultExcludes had no Windows entries, so a deep sweep of
    %USERPROFILE% descended into AppData/Local/{Temp,Microsoft,Packages}
    and AppData/LocalLow — the Windows analogue of the macOS Library
    subtrees already excluded there.
  - systemRoots returned nil on Windows, missing machine-wide Python
    under %ProgramFiles%\PythonNN\Lib\site-packages, and per-user Python
    under %LOCALAPPDATA%\Programs\Python\* was missing as well.
Niicolaa pushed a commit to Niicolaa/bumblebee that referenced this pull request Aug 4, 2026
Adds Windows to the supported endpoint set so baseline/project scans
discover MCP configs (%APPDATA%\Claude, Continue), Chromium-family
extensions (Chrome/Edge/Brave/Chromium/Vivaldi/Arc under
%LOCALAPPDATA%), and Firefox-family profiles (%APPDATA%\Mozilla\...).
isBroadHomeRoot now recognises Windows drive roots and bare
<drive>:\Users[\<name>] homes. Endpoint UID stays empty on Windows
rather than emitting "-1" when user.Current fails. setHomeDir test
helper sets HOME/USERPROFILE/APPDATA/LOCALAPPDATA together so existing
home-based tests run on all three platforms. CI matrix gains
windows-latest and goreleaser builds windows amd64/arm64 zip archives.

Tracks perplexityai#2; implemented from scratch rather than
adopting any of the open upstream PRs (#4, perplexityai#16, perplexityai#30).
Niicolaa pushed a commit to Niicolaa/bumblebee that referenced this pull request Aug 4, 2026
Follow-up to the initial Windows support, from reviewing the earlier
upstream Windows attempts (#3, #4, perplexityai#16, perplexityai#30). Two of these would have
made CI red on the windows-latest runner the previous commit added.

CI-breaking:

  - The selftest step had no `shell: bash`. windows-latest defaults to
    PowerShell, where invoking the extensionless build output does not
    work as it does in a POSIX shell. The gofmt step already pinned
    bash; this one did not.
  - scanner_test.go asserted on literal "/proj/" and "/dup/" substrings
    of source_file, which is a native path, so TestEndToEndScan could
    only have passed on Unix. Now normalized before matching.

Correctness:

  - npm and pnpm derived project_path by slash-joining segments after an
    internal filepath.ToSlash, so a Windows record carried C:/src/app
    instead of C:\src\app. This is issue #1 ("Windows package records
    should preserve native project paths"); PR #3 was closed with the
    note that it would be folded into the broader Windows work, and it
    then was not. Both now convert back with filepath.FromSlash, with
    regression tests.
  - DefaultExcludes had no Windows entries, so a deep sweep of
    %USERPROFILE% descended into AppData/Local/{Temp,Microsoft,Packages}
    and AppData/LocalLow — the Windows analogue of the macOS Library
    subtrees already excluded there.
  - systemRoots returned nil on Windows, missing machine-wide Python
    under %ProgramFiles%\PythonNN\Lib\site-packages, and per-user Python
    under %LOCALAPPDATA%\Programs\Python\* was missing as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant