Require explicit recursive workspace lookup (#646) - #672
Draft
leynos wants to merge 1 commit into
Draft
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueWarning Your free Security trial is over. An organization admin can upgrade to Advanced for continuous pull request security review or dismiss this notice. Comment |
Contributor
Reviewer's GuideThis PR changes executable lookup to a PATH-only default and introduces an explicit Sequence diagram for explicit recursive workspace executable lookupsequenceDiagram
participant Caller
participant WhichResolver
participant Lookup
participant Workspace
Caller->>WhichResolver: resolve(command, options)
WhichResolver->>Lookup: PATH lookup
alt PATH match found
Lookup-->>WhichResolver: matches
else PATH miss
alt cwd_mode == WorkspaceRecursive
Lookup->>Workspace: search_workspace(env.cwd, command, options.all, workspace_skips)
Workspace-->>Lookup: discovered paths
Lookup-->>WhichResolver: matches or not_found
else other cwd_mode
Lookup-->>WhichResolver: not_found
end
end
WhichResolver-->>Caller: result
Flow diagram for PATH-only default and recursive opt-inflowchart TD
A["which or command_available"] --> B{"cwd_mode"}
B -->|auto| C["Search PATH only"]
B -->|always| D["Search workspace root, then PATH"]
B -->|never| E["Search non-empty PATH entries"]
B -->|workspace-recursive| F["Search PATH first"]
F --> G{"PATH miss?"}
G -->|yes| H["search_workspace"]
G -->|no| I["Return PATH match"]
C --> J["Missing command remains absent"]
D --> J
E --> J
H --> K["Return bounded workspace match or not_found"]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Keep the default `which` and `command_available` search domain limited to PATH, and require `cwd_mode="workspace-recursive"` before scanning checkout-controlled executables. Preserve the existing recursive walk behind that explicit mode, with its cache, skip-list, canonicalization, executable, and platform behaviour. Document the trust boundary and update the complete test and diagnostic coverage.
leynos
force-pushed
the
issue-646-require-explicit-opt-in-for-recursive-workspace-executable-resolution
branch
from
September 4, 2026 11:20
9852e7b to
c72a789
Compare
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
This branch makes recursive workspace executable discovery an explicit
cwd_mode='workspace-recursive'opt-in. Defaultwhichandcommand_availablenow search only PATH, preventing an empty or unset PATHfrom resolving a checkout-controlled helper.
Closes #646.
Review walkthrough
Validation
make check-fmt: passedmake lint: passedmake doc-coverage: passed (99.14%)make test: passed (2,800 nextest tests; 32 doctests passed, 6 ignored)References
Summary by Sourcery
Require explicit opt-in for recursive workspace executable discovery while making PATH-only lookup the secure default.
New Features:
cwd_mode="workspace-recursive"option for intentional recursive workspace executable discovery.Bug Fixes:
PATHvalues from implicitly resolving checkout-controlled executables.Enhancements:
whichandcommand_available.Documentation:
Tests:
Chores:
whichmessages for the new resolver behavior.