fix: add support for detecting Apple Command Line Tools stubs in executors and detectors#71
Merged
Merged
Conversation
…utors and detectors
There was a problem hiding this comment.
Pull request overview
This PR adds macOS-specific protection to avoid invoking Apple Command Line Tools (CLT) “install prompt” shims (notably under /usr/bin/) during Python-related detection/scanning, preventing disruptive GUI prompts on machines without CLT installed.
Changes:
- Extends the
executor.Executorinterface withIsAppleCLTStub(ctx, binPath)and implements it inReal,Mock, andUserAwareExecutor. - Updates Python detectors/scanners to skip
/usr/bin/CLT shim binaries when CLT is not installed, and adds targeted unit tests. - Includes minor gofmt/alignment-only edits in several files.
Reviewed changes
Copilot reviewed 9 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/model/model.go | Formatting/alignment-only struct field changes. |
| internal/executor/executor.go | Adds IsAppleCLTStub to the interface and implements CLT presence probing + caching in Real. |
| internal/executor/user_aware.go | Forwards IsAppleCLTStub to the wrapped executor. |
| internal/executor/mock.go | Adds CLT-installed flag + IsAppleCLTStub behavior to the mock. |
| internal/executor/mock_test.go | Adds unit tests covering mock CLT-stub detection behavior. |
| internal/detector/pythonscan.go | Skips invoking Apple CLT shim binaries during global Python scanning. |
| internal/detector/pythonscan_test.go | Adds tests ensuring stub binaries are skipped without CLT and scanned with CLT. |
| internal/detector/pythonpm.go | Skips invoking Apple CLT shim binaries for Python PM detection and pip package listing. |
| internal/detector/pythonpm_test.go | Adds tests for skipping stubs on darwin without CLT + ensuring behavior on darwin with CLT and on linux. |
| internal/detector/brew.go | Formatting/alignment-only struct field changes. |
| internal/detector/aicli.go | Comment formatting adjustments. |
| internal/detector/aicli_test.go | Minor spacing/alignment in test table. |
| internal/detector/agent.go | Minor spacing/alignment in struct definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ashishkurmi
approved these changes
May 13, 2026
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.
What does this PR do?
Type of change
Testing
./stepsecurity-dev-machine-guard --verbose./stepsecurity-dev-machine-guard --json | python3 -m json.toolmake lintmake testRelated Issues