mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-07 07:39:22 +08:00
fix(catalog): 修正上游更新诊断中不影响安装内容的误报 (#455)
修正上游更新审核诊断中 4 处**不影响安装内容**的误报。每处只缩小到真正影响安装的范围,或者让诊断层认可已有的专项复核记录,不新增笼统豁免,也不提高任何预算。 ## 修改内容 | 类型 | 模块或功能 | 本次修改 | | --- | --- | --- | | 修复 | 诊断文件树(R1) | 单路径安装(有 `source.path`、没有 `children`)只列安装子树、根目录一层文件、声明的许可/NOTICE 证据路径和 `.claude-plugin`/`.codex-plugin` 清单;整库安装和合集仍列完整仓库,2 万文件上限不变 | | 修复 | `frontmatter-parse`(R2) | 旧 pin 就已无法解析、且不在任何登记/发现成员范围内的 SKILL.md 降为 `info`;新增的或成员内的仍然 `blocked`;证据中加 `insideMemberScope` | | 修复 | `authorization-config-network-review`(R3) | 诊断层认可 `acceptedBehavioralSecurityReview`:绑定当前旧/新 pin 且 `reviewedPaths` 覆盖全部敏感路径时降为 `info`;缺路径时列出 `unreviewedPaths`,pin 不对时给出 `behavioralReviewError`,两种情况都保持 `manual_review` | | 修复 | `protected_audit_path`(R5) | 图片扩展名(png/jpg/jpeg/webp/svg/gif/ico/bmp/avif)不再当作许可证据,`license.svg` 这类图标可以放进 `excludePaths` 目录;LICENSE/NOTICE/COPYING 文本和依赖清单仍受保护 | | 新增 | 测试 | 新增 10 个单测,覆盖每条规则的放行和仍然阻断两种情况 | | 更新 | 文档 | `docs/verified-update-automation.md` 新增 "Diagnostic scope boundaries" 小节 | ## 修改前后 | 场景 | 修改前 | 修复后 | | --- | --- | --- | | openclaw 系列(notion / nano-pdf / apple-reminders,安装路径各 1 个目录,仓库约 6.8 万文件) | 永远 `independent-static-diagnostics: not_checked`(`diagnostic tree exceeds budget`),这项无法修复 | 诊断能跑完;真实快照下剩下的阻断是 `installed-project-notice`(技能目录里没有 LICENSE,需要客户端附加通知的回读证据) | | larksuite-cli(上游 `scripts/skill-format-check/tests/bad-skill-*` 是故意写坏的测试夹具) | `frontmatter-parse: blocked` ×2,任何专项复核都清不掉 | `info`;真实快照下剩下的是 25 个子技能的 `installed-project-notice` | | last30days(`chrome_cookies.py`、`cookie_extract.py`、`env.py`、`http.py`、`permission_preflight.py` 有变化) | 就算有绑定精确 pin 的行为复核,仍然 `manual_review` | 复核覆盖全部 5 个路径时为 `info`;没有复核时仍是 `manual_review`(已用真实快照验证两种情况) | | ppt-master(`tabler-outline/license.svg`、`license-off.svg` 图标) | `excludePaths` 不能写整个 icons 目录,只能拼 4 条 glob 绕开(见 #453) | 可以直接写 `skills/ppt-master/templates/icons`(真实快照模拟通过) | **这次没改的**:根 `NOTICE` 的交付规则(`installed-notice-delivery`)。我核对了已核验客户端实现 desirecore#6429(`85fba4ab`)的 `market-source.ts`,它只附加 `governance.license.evidencePath` 这一个文件,不会附加单独的根 NOTICE。所以用"客户端附加"来清这一项会与事实不符。blog-repurpose / blog-chart / impeccable / rea-video 要么等客户端支持附加 NOTICE,要么等上游把 NOTICE 放进技能目录。 ## 影响范围 | 文件 | 行号 | 改动 | | --- | --- | --- | | `scripts/catalog/update_diagnostics.py` | 38-39 | 引入 `accept_behavioral_security_review` | | `scripts/catalog/update_diagnostics.py` | 49-73 | R1:单路径安装的有界文件列表 | | `scripts/catalog/update_diagnostics.py` | 247-259 | R2:成员范围外的旧畸形 SKILL.md | | `scripts/catalog/update_diagnostics.py` | 348-368 | R3:行为复核覆盖判定与证据字段 | | `scripts/catalog/audit_skill_update.py` | 164-172 | R5:图片扩展名不受许可保护 | | `scripts/catalog/test_update_diagnostics.py`(测试) | 523-615 | R1/R2/R3 共 9 个测试 | | `scripts/catalog/test_audit_skill_update.py`(测试) | 209-224 | R5 测试(含 excludePaths 整目录审核通过) | | `docs/verified-update-automation.md` | 177-209 | 规则说明 | ## 验证 | 检查项或场景 | 预期结果 | 实际结果 | 证据 | | --- | --- | --- | --- | | `pytest scripts/catalog/test_update_diagnostics.py` | 全部通过 | 52 passed(新增 9) | commit `a9937c9` | | `test_audit_skill_update.py` / `test_validate_catalog_metadata.py` / `test_collection_generator.py` / `test_check_upstream_health.py` / `test_propose_upstream_updates.py` / `test_review_workflow.py` | 全部通过 | 全部 OK / exit 0 | 本地 | | `pytest scripts/catalog/test_tracked_updates.py` | 全部通过 | 64 passed | 本地 | | 真实快照:openclaw `6ddf5a61→bd5b024b`、larksuite-cli `c5fbf1a5→71f8b946`、last30days `7c2e1c2b→f9dadcaf`、ppt-master `63a03673→bb48b2b1` | 误报消失,真实门槛仍在 | 如"修改前后"表所述 | 本地审核器 | | `validate_catalog_metadata.py --require-complete` / `validate-i18n.py` | 0 error | 0 error,105 warning(main 原有) | 本地 | | CI | 全部通过 | 等待中 | 本 PR checks | 这是审核规则改动,需要维护者复核。请勿自动合并。 Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
28ac761ff9
commit
8e016a484f
5 files changed
+203
-11
No files matched your search
@@ -174,6 +174,39 @@ now encoded in `schemas/special-review.v1.schema.json` and
|
||||
bound to the exact `fromRef`→`toRef` pair and `reviewedPaths` in `special-review.v1.json`.
|
||||
This remains a read-only review boundary, not a security certification or runtime acceptance.
|
||||
|
||||
### Diagnostic scope boundaries (false-positive fixes, no new exemptions)
|
||||
|
||||
`scripts/catalog/update_diagnostics.py` keeps every fail-closed gate, but no longer
|
||||
blocks on facts that cannot affect the installed payload:
|
||||
|
||||
1. **Single-path installs list only what they read.** When an entry has a
|
||||
`source.path` and no `children`, diagnostics list the selected subtree, root-level
|
||||
files, declared license/notice evidence paths and `.claude-plugin`/`.codex-plugin`
|
||||
manifests instead of the whole repository. A monorepo with more than 20,000
|
||||
unrelated files (for example `openclaw/openclaw`) therefore reaches its real gates
|
||||
instead of stopping at `independent-static-diagnostics: not_checked`. Whole-tree
|
||||
and collection installs still list the complete tree.
|
||||
2. **Historic malformed fixtures outside every member scope are informational.**
|
||||
`frontmatter-parse` stays `blocked` for a newly added or in-member unparseable
|
||||
`SKILL.md`. Only a file that was already unparseable at the old pin and lies
|
||||
outside every declared/discovered member scope (such as an upstream test fixture
|
||||
that is malformed on purpose) is reported as `info`, with `insideMemberScope: false`.
|
||||
3. **`acceptedBehavioralSecurityReview` is honored by diagnostics.** A valid review
|
||||
bound to the exact `fromRef`→`toRef` whose `reviewedPaths` cover every changed
|
||||
authorization/credential/configuration/network path turns
|
||||
`authorization-config-network-review` into `info`. Missing paths are listed in
|
||||
`unreviewedPaths` and keep the row `manual_review`; an invalid or other-pin review
|
||||
is reported in `behavioralReviewError`.
|
||||
4. **Images named after a license are not license evidence.** `protected_audit_path`
|
||||
ignores image extensions (`.png`, `.jpg`, `.jpeg`, `.webp`, `.svg`, `.gif`, `.ico`,
|
||||
`.bmp`, `.avif`), so an icon such as `license.svg` can sit inside an `excludePaths`
|
||||
directory. `LICENSE*`/`NOTICE*`/`COPYING*` text files and dependency manifests stay
|
||||
protected.
|
||||
|
||||
Root `NOTICE` delivery is unchanged: the verified client implementations attach only the
|
||||
catalog license evidence file, so a client-attach review cannot clear
|
||||
`installed-notice-delivery` for a separate root `NOTICE`.
|
||||
|
||||
### Audited carry-forward rules (reducing repetitive Drafts without skipping checks)
|
||||
|
||||
To prevent routine updates from repeatedly falling back to Draft when the underlying
|
||||
|
||||
Reference in new issue
Block a user