Repository navigation
fix(skill): NDR Alert Analysis Hub 更新永远 422(read-only shadow) / Hub update permanently blocked by duplicate skill - #781
Open
WenhuaXia wants to merge 1 commit into
Conversation
….0.0)同名冲突 问题 / Problem: Hub 页点击 NDR Alert Analysis「更新」永远 422: Skill 'ndr-alert-analysis' is read-only; installation cannot replace or shadow it 根因 / Root cause: PR AgentFlocks#775 (v2026.9.23) 把同一个 skill 打包进了两个位置: 1. .flocks/plugins/skills/ndr-alert-analysis/SKILL.md (380行 详细版) 2. .flocks/flockshub/plugins/skills/ndr-alert-analysis/ (29行 官方 hub 包 + manifest v1.0.0 + references/scripts/templates) discovery 只扫 (1) 所在的项目级路径,(2) 是 hub 安装源不在 discovery 里。 (1) 因 is_system_shipped 命中 → readonly → preserve_install_group 永久拦截。 hub 更新想装 (2) 到 ~/.flocks/plugins/skills/ 时,守卫在 write 前重新 _discover 找到 (1),判定为 readonly,拒绝影子化。 修复 / Fix: 删除 (1) 380行裸文件。 - (2) 是官方正式 hub 包(有 manifest / references / scripts / templates), 保留作为唯一来源,Hub 安装/更新恢复正常。 - 380行详细流程内容已固化备份到 ~/workspace/ndr-backup/, 需要时可作为 PR 反馈给上游合并进 (2) 的 SKILL.md。 验证 / Verified: 1. rm (1) 后 install_plugin('skill','ndr-alert-analysis',scope='global') → INSTALL OK, v1.0.0, installPath=~/.flocks/plugins/skills/ndr-alert-analysis 2. Skill._discover(): location=~/.flocks/plugins/skills/ndr-alert-analysis/SKILL.md source=user native=False readonly=False (可更新可编辑) content: 29行官方版, has references/scripts/templates 3. installed.json: skill:ndr-alert-analysis v1.0.0 source=bundled
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.
问题描述 / Bug Description
在 Hub 页面点击 NDR Alert Analysis「更新」,永远失败:
根因 / Root Cause
PR #775 (v2026.9.23) 把同一个 skill 打包进了两个位置:
.flocks/plugins/skills/ndr-alert-analysis/SKILL.md.flocks/flockshub/plugins/skills/ndr-alert-analysis/manifest.json(v1.0.0) +references/+scripts/+templates/,trust: officialSkill._discover()只扫描前者的路径(plugins/skills/),不扫描flockshub/(Hub 是安装源,不是发现源)。因此:is_system_shipped=True→is_readonly=Trueinstall_plugin→preserve_install_group写前守卫重新_discover→ 发现ndr-alert-analysis已存在且 readonly → 422修复 / Fix
删除 380 行裸文件,保留官方 Hub 包作为唯一来源。
git show dde8faa:.flocks/plugins/skills/ndr-alert-analysis/SKILL.md可找回)验证 / Verification
风险评估 / Risk Assessment
Low — 删除的是一个与官方 Hub 包同名的遗留裸文件。官方 Hub 包(29 行 + manifest)保留且已验证可正常安装。380 行版的完整内容在 git 历史中可恢复。