mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 19:59:25 +08:00
为 `special-review` v1 增加两个可选接受字段,使 Class C 专项复核能在**精确匹配**时接受合集成员变化和根目录 LICENSE/NOTICE/COPYING 变化。这不是无条件绕过硬门槛:哈希或路径集合不对、不完整,审计仍然失败。 本 PR **只改审计工具、schema 和单元测试**,不更新任何技能 pin,也不把失败草稿标成 Ready。 ## 新字段 - `acceptedRootEvidenceSha256`:根目录 LICENSE/NOTICE/COPYING 路径 → 新快照文件字节的 SHA-256。当根证据有变化时,该映射必须**恰好等于**新增或变更路径及其新哈希。删除这些文件仍一律阻止,即使复核记录省略了被删路径。`excludePaths` 仍不能用来隐藏许可、Notice 或依赖清单。若声明的 `licenseEvidencePath` / `noticePath` / `license.evidencePath` 同时变化,也必须被同一接受哈希覆盖,否则该检查仍失败。安装范围内的许可/Notice 变化仍是硬门槛,本次不加豁免。 - `acceptedCollectionPaths`:必须恰好等于新快照 `discover_children` 的成员路径集合。接受后用发现结果作为审核树、预算和后续检查的路径,并据此重建 `entry.children` 与 sidecar `spec.collection.children`(写入 id、path,以及 frontmatter 归一化后的 version)。新成员必须同时提供 `acceptedFrontmatterSha256`,且**不会自动编造翻译**。已有成员的 frontmatter 规则和版本回退保护保持不变。没有该字段时,新增成员仍会以「合集成员」被阻止。 ## 本地验证 在当前 `origin/main`(`d463565237fab79b9e6eb5e944246a4e14dd625e`)上: - `scripts/catalog/test_audit_skill_update.py`:22/22 - `scripts/catalog/test_validate_catalog_metadata.py`:62/62 - `scripts/catalog/test_propose_upstream_updates.py`:9/9 本 PR 不代表运行或安全认证,也不自动合并。
48 lines
2.5 KiB
JSON
48 lines
2.5 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft-07/schema#",
|
|
"$id": "https://desirecore.local/schemas/special-review.v1.schema.json",
|
|
"title": "Market Class C special review record",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["schemaVersion"],
|
|
"properties": {
|
|
"schemaVersion": { "const": 1 },
|
|
"reviewedBy": { "type": "string", "minLength": 1 },
|
|
"reviewedAt": { "type": "string", "minLength": 1 },
|
|
"notes": { "type": "string" },
|
|
"excludePaths": {
|
|
"type": "array",
|
|
"description": "Repo-relative paths or globs omitted from the audit tree walk only. Must not include LICENSE/NOTICE/COPYING or dependency manifests. The DesireCore installer does not honor this field until the client contract admits it.",
|
|
"items": { "type": "string", "minLength": 1 },
|
|
"uniqueItems": true
|
|
},
|
|
"budgetExemptPaths": {
|
|
"type": "array",
|
|
"description": "Repo-relative paths that remain in the audit manifest and must still be regular files, but may exceed MAX_FILE_BYTES. Prefer this for runtime data that must stay installed.",
|
|
"items": { "type": "string", "minLength": 1 },
|
|
"uniqueItems": true
|
|
},
|
|
"acceptedDependencyIdentities": {
|
|
"type": "object",
|
|
"description": "Map of dependency path to the identity key of the *new* snapshot: package.json is the SHA-256 of the manifest with version removed; other manifests use the git blob SHA.",
|
|
"additionalProperties": { "type": "string", "pattern": "^([a-f0-9]{40}|[a-f0-9]{64})$" }
|
|
},
|
|
"acceptedFrontmatterSha256": {
|
|
"type": "object",
|
|
"description": "Map of install path (empty string for a repo-root skill) to SHA-256 of stable_frontmatter(new SKILL.md).",
|
|
"additionalProperties": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
|
|
},
|
|
"acceptedRootEvidenceSha256": {
|
|
"type": "object",
|
|
"description": "Map of repo-root LICENSE/NOTICE/COPYING path to SHA-256 of the *new* snapshot file bytes. When root evidence changes, this map must exactly equal the added or changed paths; deletions of LICENSE/NOTICE/COPYING are never accepted.",
|
|
"additionalProperties": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
|
|
},
|
|
"acceptedCollectionPaths": {
|
|
"type": "array",
|
|
"description": "Exact set of new collection membership install paths when discovered children differ from the old entry. Must equal the discovered path set. Newly added members also require acceptedFrontmatterSha256 for that path.",
|
|
"items": { "type": "string", "minLength": 1 },
|
|
"uniqueItems": true
|
|
}
|
|
}
|
|
}
|