Repository navigation
Conversation
…on#31) scanCommands stripped ANY extension, so an entry that merely shared a tool's stem resolved as that tool. MEASURED: readdir sorts `just.1` (the man page) before `just.exe` in winget's portable package directory, and the first hit wins — the card's path column pointed at the man page. The decision layer followed: classifyToolState() falls back to `hasCommand` when winget does not own the package, so a machine that genuinely lacks the command but happens to carry a same-named doc/man page/directory is reported as `external` and never gets its install entry. Gate the scan on an executable-extension whitelist (.exe/.cmd/.bat/.com) while keeping extension-less entries resolving: Git for Windows ships its own executables that way (/usr/bin/make, fzf). Directory discrimination is deliberately left for a follow-up — it needs a stat/Dirent capability on io.readdir and would touch callers, so this stays a pure-function change with zero io contract drift. npm test: 237 pass / 0 fail (Windows 10.0.26200, Node 24.19.0). The new smoke case fails on the unfixed source (actual 'C:/pkg\\just.1', expected 'C:/pkg\\just.exe').
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.
按 #31 的评审口径实现,只做扩展名白名单这一步。
改动
src/toolchain.js:新增EXEC_EXTS = {.exe,.cmd,.bat,.com},扩展名不在白名单的条目直接跳过;无扩展名照旧命中(/usr/bin/make、fzf这类)。纯函数改动、零 io 变更 —— 没有给io.readdir加stat/Dirent,无扩展名目录的区分按你的意见留作后续。tests/smoke.mjs:新增「only executable extensions resolve」一例,锁三层(手册页/文档/目录不命中;无扩展名真可执行仍命中;just.1排在just.exe前时首个可执行命中者路径正确,另覆盖.EXE大小写)+ 判定层联动断言(扫不到 ⇒missing⇒isActionable为真)。CHANGELOG.md:新增## v0.40.2 — 2026-10-16条目(fix)。验证
npm test(Windows 10.0.26200 / Node 24.19.0):237 pass / 0 fail(基线 236 + 本用例 1)。actual: 'C:/pkg\just.1'、expected: 'C:/pkg\just.exe'—— 正是 issue 里手册页抢先命中的症状;修复后通过。这条用例不是「恒真」的。Casey.Just便携包目录里just.1与just.exe并存,字典序.1<.e(修复前已实测复现)。两点说明
v0.40.2,但没有动package.json/dsh.plugin.json的version—— 发版节奏归你们;若打算并进 0.41.0,改个标题即可。package-lock.json里 5 个依赖的resolved指向registry.npmmirror.com。npm 12 把这类 URL 规格视为remote并默认拒绝(EALLOWREMOTE,allow-remote = "none"),所以在这种 npm 上npm ci会直接失败。我本地只是把这 5 条临时改回registry.npmjs.org(integrity 不变)才跑起套件,改动没有进提交(git status只含上列三个文件)。CI 目前无恙(Node 22/24 自带的 npm 没有这道闸),但值得知道。目录区分那一步(无扩展名目录 vs 无扩展名可执行文件)等你们定了
io的形状,我可以接着做。