mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-12-05 21:19:28 +08:00
## 概述 / Summary
在**保留完整自动化审核门控**的前提下,为两类高频重复产生 Draft 的场景增加「可审计延续(Audited
Carry-Forward)」规则,减少无风险波动导致的重复草稿:
1.
**客户端根通知附带的可审计延续(`acceptedClientAttachedNotices.allowCarryForwardWhenUnchanged:
true`)**
- 适用于已验证客户端自动附带根 `LICENSE` 的条目(如
`last30days`、`addy-agent-skills`、`mattpocock-skills`)。
- **必须同时满足全部审核门控才会放行**:
1. 必须绑定已发布的正式客户端版本标签 `clientReleaseTag`(如 `v10.0.214`)及已核验的
`clientCommit` / `clientTree`;
2. 新快照的根 `LICENSE` 字节必须与 `noticeSha256` 逐字节一致,且 MIT 声明须完整通过 `mit_grant`;
3. 安装范围 `scopes` 集合完全未变;
4. 每个安装范围目录顶层在新快照中**未出现**同名 `LICENSE` / `NOTICE` / `COPYING` 冲突文件;
5. 依赖清单、frontmatter、文件预算、嵌套许可及合并前人工无扩张审核等所有其他门控全部照常执行。
2. **纯数据更新的许可例外可审计延续(`acceptedDataOnlyLicenseException`)**
- 适用于无独立 `LICENSE` 但每日自动刷新数据文件的条目(如 `follow-builders` 的 4 个 JSON feed
文件)。
- **必须同时满足全部审核门控才会放行**:
1. 必须显式声明 `evidencePath`、`evidenceSha256` 和精确的
`allowedDataPaths`(禁止通配符,禁止列入
`LICENSE`/`NOTICE`/`COPYING`/依赖清单/`SKILL.md`);
2. `evidencePath` 在旧/新快照间逐字节一致且匹配 `evidenceSha256`;
3. 旧/新快照安装范围内的**全部变更文件**必须严格落在 `allowedDataPaths`
内,任何脚本、`SKILL.md`、配置或新增文件变化立即阻断;
4. 默认开启 `requireValidJson: true`,要求每个变更数据文件在旧/新快照均能解析为合法 JSON
对象且**顶层字段集合完全一致**。
## 变更 / Changes
- `schemas/special-review.v1.schema.json`:向后兼容地新增
`allowCarryForwardWhenUnchanged` 与 `acceptedDataOnlyLicenseException`
- `scripts/catalog/audit_skill_update.py`:在
`accept_client_attached_notices` 增加带碰撞检测与 `clientReleaseTag`
强制校验的延续逻辑;新增 `accept_data_only_license_exception` 并在 `audit_snapshots`
挂钩
- `scripts/catalog/update_diagnostics.py`:接入
`accept_data_only_license_exception`,核验通过时将
`pin-bound-license-exception` 与安装内 `installed-project-notice` 记为
`info`,任何违规直接记为 `blocked`
- `docs/verified-update-automation.md`:补充两条可审计延续规则及其审核边界说明
- `scripts/catalog/test_audit_skill_update.py`:新增 2 组单测覆盖合法延续、缺
`clientReleaseTag` 拦截、顶层冲突通知拦截、JSON 字段结构变化拦截及越界代码变更拦截
## 验证 / Validation
- `uv run --quiet scripts/catalog/test_audit_skill_update.py`
- `uv run --quiet scripts/catalog/test_update_diagnostics.py`
- `uv run --quiet scripts/catalog/test_validate_catalog_metadata.py`
- `uv run --quiet scripts/catalog/validate_catalog_metadata.py
--require-complete`
- `uv run --quiet scripts/i18n/validate-i18n.py`
- `uv run --quiet scripts/i18n/translate.py --check`
- `git diff --check`
243 lines
14 KiB
JSON
243 lines
14 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}$" }
|
|
},
|
|
"acceptedClientAttachedNotices": {
|
|
"type": "object",
|
|
"description": "Bound install-readback evidence that a verified DesireCore client commit attached collection/repo-root LICENSE/NOTICE/COPYING files into each selected install copy. This is not a license exception and does not treat a root file seen at audit time, or a future client change, as delivery. sourceRef must equal the audit's new pin; clientCommit must be an already-verified attach implementation (not a descendant tip by default); noticeSha256 must equal the regular root notice file at that pin; scopes must be exactly the install paths with per-copy attached name/sourceName/sha256 matching that root notice. The acceptance does not automatically extend to a later pin.",
|
|
"additionalProperties": false,
|
|
"required": ["sourceRef", "clientCommit", "noticeRootPath", "noticeSha256", "scopes"],
|
|
"properties": {
|
|
"sourceRef": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"clientCommit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"clientTree": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"clientReleaseTag": {
|
|
"type": "string",
|
|
"description": "Optional shipped official DesireCore release tag (e.g. v10.0.214) verified to include clientCommit without unverified staging/install drift. Required when allowCarryForwardWhenUnchanged is true.",
|
|
"pattern": "^v\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"
|
|
},
|
|
"allowCarryForwardWhenUnchanged": {
|
|
"type": "boolean",
|
|
"description": "When true (requires clientReleaseTag), allows the verified client-attached notice proof to carry forward to newer pins ONLY when the root notice bytes at the new pin are byte-identical to noticeSha256, install scopes are unchanged, and no colliding top-level LICENSE/NOTICE/COPYING file exists in any install scope. All other audits still run in full."
|
|
},
|
|
"observedAt": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$" },
|
|
"noticeRootPath": { "type": "string", "minLength": 1 },
|
|
"noticeSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
"scopes": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["path", "attached"],
|
|
"properties": {
|
|
"path": { "type": "string", "minLength": 1 },
|
|
"contentDigest": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
"attached": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["name", "sourceName", "sha256"],
|
|
"properties": {
|
|
"name": { "type": "string", "minLength": 1 },
|
|
"sourceName": { "type": "string", "minLength": 1 },
|
|
"sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"acceptedDescriptionAndLocales": {
|
|
"type": "object",
|
|
"description": "Human review that market listing shortDesc/summary copy was updated to match a changed upstream SKILL.md description. Bound to the exact old and new pins and to each affected install path. Files must be exactly the description-changed scopes that already have locale copy. Each locale binds the reviewed shortDesc and its SHA-256, plus the previous listing text; the English/latin shortDesc must cover distinctive new-description terms, and zh-CN must be distinct CJK rather than a leftover English or old listing string. Catalog summary mirrors must match. This is not a generic exemption and does not automatically extend to a later pin.",
|
|
"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", "oldDescription", "newDescription", "newFrontmatterSha256", "locales"],
|
|
"properties": {
|
|
"path": { "type": "string" },
|
|
"oldDescription": { "type": "string", "minLength": 1 },
|
|
"newDescription": { "type": "string", "minLength": 1 },
|
|
"newFrontmatterSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
"locales": {
|
|
"type": "object",
|
|
"minProperties": 1,
|
|
"additionalProperties": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["shortDesc", "sha256", "previousShortDesc"],
|
|
"properties": {
|
|
"shortDesc": { "type": "string", "minLength": 1 },
|
|
"sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
"previousShortDesc": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"acceptedExactPinLicenseException": {
|
|
"type": "object",
|
|
"description": "Exact-pin human license exception for entries without a standalone LICENSE file (e.g. one-line README MIT declaration). Never inherited automatically across snapshots: fromRef/toRef must match the audited old and new pins, evidenceSha256 must match the file bytes at toRef, and reviewDoc must point to a repo-relative review document under docs/.",
|
|
"additionalProperties": false,
|
|
"required": ["fromRef", "toRef", "evidencePath", "evidenceSha256", "reviewDoc"],
|
|
"properties": {
|
|
"fromRef": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"toRef": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"evidencePath": { "type": "string", "minLength": 1 },
|
|
"evidenceSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
"reviewDoc": { "type": "string", "minLength": 1 }
|
|
}
|
|
},
|
|
"acceptedBehavioralSecurityReview": {
|
|
"type": "object",
|
|
"description": "Exact-pin read-only behavioral review for updates touching credentials, browser cookies/consent, authorization/network boundaries, or .skillignore inside the install scope. Bound to fromRef/toRef, a repo-relative reviewDoc under docs/, and the reviewedPaths list. Does not extend to later pins and is not a security certification or runtime acceptance.",
|
|
"additionalProperties": false,
|
|
"required": ["fromRef", "toRef", "reviewDoc", "reviewedPaths"],
|
|
"properties": {
|
|
"fromRef": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"toRef": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
|
|
"reviewDoc": { "type": "string", "minLength": 1 },
|
|
"reviewedPaths": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": { "type": "string", "minLength": 1 }
|
|
}
|
|
}
|
|
},
|
|
"acceptedDataOnlyLicenseException": {
|
|
"type": "object",
|
|
"description": "Audited carry-forward of a catalog-specific one-line license exception (e.g. README.md MIT declaration) ONLY for updates whose entire installed-scope diff is restricted to explicit allowedDataPaths. Every non-allowlisted file (including evidencePath, SKILL.md, scripts, manifests) must be byte-identical, and when requireValidJson is true (default) every changed data file must parse as a JSON object with an identical top-level key set.",
|
|
"additionalProperties": false,
|
|
"required": ["evidencePath", "evidenceSha256", "allowedDataPaths"],
|
|
"properties": {
|
|
"evidencePath": { "type": "string", "minLength": 1 },
|
|
"evidenceSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
|
|
"allowedDataPaths": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"uniqueItems": true,
|
|
"items": { "type": "string", "minLength": 1 }
|
|
},
|
|
"requireValidJson": { "type": "boolean", "default": true }
|
|
}
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": { "required": ["acceptedScopedNotice"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
},
|
|
{
|
|
"if": { "required": ["acceptedRootLicenseDirectoryManifestSha256"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
},
|
|
{
|
|
"if": { "required": ["acceptedClientAttachedNotices"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
},
|
|
{
|
|
"if": { "required": ["acceptedDescriptionAndLocales"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
},
|
|
{
|
|
"if": { "required": ["acceptedExactPinLicenseException"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
},
|
|
{
|
|
"if": { "required": ["acceptedBehavioralSecurityReview"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
},
|
|
{
|
|
"if": { "required": ["acceptedDataOnlyLicenseException"] },
|
|
"then": { "required": ["reviewedBy", "reviewedAt", "notes"] }
|
|
}
|
|
]
|
|
}
|