mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 17:39:24 +08:00
独立工具修订,不合并。对应失败草稿 #323 的前置修复:当前 `main` 上的审核器会把根目录名为 `licenses/` 的普通目录误判为损坏的 LICENSE 文件(“根许可或 Notice 不是普通文件”)。该目录在 #323 的旧 pin `79d2fc05405c76bc0a8f71b9c10355135da4747b` 和新 pin `87889b8729da8a02a4159bc7274c92be52464031` 上均存在,因此即使用当前审核器重放已准入旧 pin 也会失败。这不是上游缺失 LICENSE。根 LICENSE 本身是普通不变的 MIT 文件(blob `2d476d24fa5a9ae2ab35e5fd121494049eb2ee5d`)。 本 PR 的最小行为变化: - `root_evidence()` 跳过根上名为 LICENSE*/NOTICE*/COPYING* 的普通目录,不再把它们当成损坏许可文件。 - 这些根名上的符号链接、子模块或其他非普通文件,以及目录内的非普通文件,仍硬拦截。 - 根 LICENSE/NOTICE/COPYING **文件**的内容变化仍检测;这些文件被删除仍不可接受。 - `licenses/` 等许可目录被删除不可接受。 - 目录内第三方许可文本变化(含内容相同的重命名)不得被伪称为未变化;需在专项复核中提供新快照的 `acceptedRootLicenseDirectoryManifestSha256`(目录清单的规范 JSON 的 SHA-256)。该字段不削弱对根 LICENSE 文件删除的保护,也不能用来跳过符号链接/子模块拦截。 - 既有安装范围内 NOTICE 精确追加政策不退化。 已加回归测试:合法 MIT LICENSE + `licenses/` 目录在新旧 pin 上可通过;LICENSE 或目录内符号链接/非普通文件仍拒绝;LICENSE 内容变化仍检测;目录内第三方文本变化在无正确清单哈希时不能通过;目录删除不可接受;存在 `licenses/` 时,既有 NOTICE 精确追加仍可用。catalog/audit/collection 单测 107 passed(含 182 subtests),catalog 与 i18n validate 0 error。 #323 的正式快照 PR 将以本分支为 base 叠放,并清楚标明依赖。在本工具修订合入 `main` 之前,不要把基于 `main` 的快照 PR 声称可以复现已通过的审核。本 PR 本身不含 #323 快照,也不自行合并。
87 lines
4.8 KiB
JSON
87 lines
4.8 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
|
|
},
|
|
"acceptedScopedNotice": {
|
|
"type": "object",
|
|
"description": "Exact in-place additive NOTICE changes inside the install scope. LICENSE/COPYING, deletions, renames, new files, rewrites that drop existing bytes, globs, and root-level NOTICE (use acceptedRootEvidenceSha256) cannot be accepted here. fromRef/toRef must equal the audit's old and new snapshot SHAs, and files must be exactly the changed NOTICE paths with matching previous and new SHA-256 hashes.",
|
|
"additionalProperties": false,
|
|
"required": ["fromRef", "toRef", "files"],
|
|
"properties": {
|
|
"fromRef": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"toRef": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"files": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["path", "previousSha256", "sha256"],
|
|
"properties": {
|
|
"path": { "type": "string", "minLength": 1 },
|
|
"previousSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
"sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"acceptedRootLicenseDirectoryManifestSha256": {
|
|
"type": "object",
|
|
"description": "Map of a repo-root LICENSE*/NOTICE*/COPYING* directory name (for example licenses) to the SHA-256 of the canonical JSON manifest of regular files under that directory at the *new* snapshot (sorted path to file SHA-256). Required when those directory file sets change, including renames. This does not accept changes to, replacements of, or deletions of root LICENSE/NOTICE/COPYING files (deletions remain forbidden; file changes still use acceptedRootEvidenceSha256). Symlinks, submodules, and other non-regular files at those root names or inside the directory remain blocked.",
|
|
"additionalProperties": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": { "required": ["acceptedScopedNotice"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
},
|
|
{
|
|
"if": { "required": ["acceptedRootLicenseDirectoryManifestSha256"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
}
|
|
]
|
|
}
|