fix(utils): honor executable lookup overrides - #3696
Merged
Conversation
Yeachan-Heo
approved these changes
Aug 1, 2026
Yeachan-Heo
left a comment
Owner
There was a problem hiding this comment.
Signed: Yeachan-Heo / fresh-context hostile review
GJC verdict: APPROVE exact head caf2edf.
Admission and scope:
- @sj0618 is an external CONTRIBUTOR; the PR is non-draft, clean, one commit, and exactly one commit ahead of dev base 0cc1536.
- Scope is limited to packages/utils/src/which.ts, its focused regression test, and packages/utils/CHANGELOG.md (+40/-5). No overlap with the retired #3622 notifications lane.
- This is the direct successor to #3656. The prior stale-base disposition found no P0/P1; the successor is correctly rebased and preserves the prior blocker resolution.
Hostile review:
- Explicit PATH is passed through to Bun.which and suppresses Darwin Xcode fallback, preventing escape from a caller-constrained lookup path.
- Explicit empty PATH remains distinct from omission.
- cwd and PATH receive separate cache-key namespaces, preventing the prior collision class while leaving relative lookup delegated to Bun.
- The new regression covers PATH override, empty PATH, relative lookup, cache separation, and no Xcode fallback.
- No new subprocess, filesystem, or credential surface was introduced. The changelog accurately records the user-facing behavior.
Evidence:
- Exact-head CI: 21 terminal checks, 16 success, 5 policy skips, 0 failures, 0 non-terminal.
- Isolated exact-head
bun test packages/utils/test/which.test.ts: 1 pass, 0 fail. - Exact-head
bun --cwd=packages/utils run check: Biome clean and TypeScript check completed successfully. - Full isolated package suite was not used as acceptance evidence because the temp snapshot was installed with
--ignore-scripts; unrelated native-shell tests then lacked the native addon. The required focused test and package check are green, and hosted CI is fully terminal-green.
No merge or mutation lane opened.
5 tasks
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
PATHandcwdoptions through macOS executable discovery.PATHinto hard-coded Xcode fallback directories.Why
On macOS,
$whichignored lookup overrides and could return an executable outside an explicitly constrainedPATH. Cache keys could also collide whencwdandPATHcontained the same string.This supersedes #3656. The owner review on that PR found no P0/P1 and marked the implementation MERGE_READY with all 16 checks green; it was closed only because another PR merged first and made its exact sequential base stale. This successor is rebased directly onto current
dev@0cc1536db0705154c5f0454e0b62694f29427a7a.Testing
bun test packages/utils/test/which.test.ts— 1 passbun test packages/utils/test— 252 pass, 0 failbun --cwd=packages/utils run checkgit diff --check upstream/dev...HEADGJC verdict
dev