Repository navigation
fix(bind): dirHash 递归收集文件,技能目录含子目录不再抛 EISDIR - #64
Merged
Merged
Conversation
This was referenced Oct 12, 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.
变更
lib/domains/bind.mjs:dirHash改为递归收集文件,键用相对路径并以正斜杠归一、按字典序拼接后求 sha256;附注释说明旧实现为何假设扁平是错的。test/cli.test.mjs:新增「技能目录含子目录时哈希与绑定仍成立」用例,含三条反证(子目录内容参与指纹、同内容重绑哈希稳定、unbind递归删除)。影响
bind execute不再因技能目录里存在子目录(references/、templates/等)而抛EISDIR崩;sidecar 的哈希值算得更全(子目录内容进入指纹),因此首次重绑时托管技能目录的哈希会变——这是内容指纹的正常刷新,schema 与形态(64 位十六进制)不变。requiresCommands与cliVersion判定不受影响;cpSync的递归复制行为本就如此,本次只是让指纹与之同口径;bind plan的 blocked/entries 判定不变;宿主既有扁平技能目录的哈希不受影响(无子目录时集合等同)。shadow-dev-workflow的norms/pr-message.md里「规范/模板不得放skills/*/子目录」这条是基于本缺陷写的,需等含本修复的版本发布后由插件另立 change 撤除——本 PR 不代劳。dirHash,新用例会随之判红(正是它锁住的行为)。验证
dirHash临时换回旧实现跑新用例 →✖ bind: 技能目录含子目录时哈希与绑定仍成立,报错原文✗ EISDIR: EISDIR,bind executeexit 1。用例确实看得见缺陷。node --test --test-name-pattern bind test/cli.test.mjs→ 3 用例 3 绿 0 红,既有的bind copies managed skills with a sidecar…不回归。references/step-01.md内容重绑 → 哈希必须变;同内容连续重绑两次 → 哈希逐字相同;unbind后含子目录的技能目录不存在。windows/macos/ubuntu × node 20/22/24矩阵由本 PR 的test.yml判定。关联