Files
market/schemas/catalog-metadata.v1.schema.json
T
mashagua 3d036b7972 feat(catalog): 新增临时未知许可显式豁免机制并将 lumarescue / mt-paotui-for-client 设为可安装 (#445)
为上游暂未声明开源许可证的纯源链接(`source-pointer-only`)条目增加绑定固定快照的显式临时豁免机制,并将
`skills/lumarescue` 与 `skills/mt-paotui-for-client` 恢复为
`installable`,同时在中英文简介中明确向用户提示许可证状态。

### 改动说明
1. **`schemas/catalog-metadata.v1.schema.json`**:
- 在 `governance` 下新增可选字段 `temporaryUnknownLicenseException`(必填
`reviewedRef`、`reviewedAt`、`reviewedBy`、`reason`、`upstreamEndorsed`)。
2. **`scripts/catalog/validate_catalog_metadata.py`**:
   - 默认仍严格拦截无已知许可证的 `installable` 外部 pointer 条目(不降低原有门禁)。
   - 仅当同时满足以下条件时放行并输出可见告警 `temporary-unknown-license`:
     - 显式填写 `governance.temporaryUnknownLicenseException`;
- `governance.redistribution ==
"source-pointer-only"`(仅限直接源链接,不用于再分发/内嵌包);
     - `reviewedRef` 精确匹配不可变 `provenance.content.ref` / `sha256`;
     - `reviewedAt` 匹配 `timestamps.reviewedAt`。
- 一旦上游补充许可证(`license.state == "known"`),残留的
`temporaryUnknownLicenseException` 会直接报错提醒移除。
3. **`scripts/catalog/test_validate_catalog_metadata.py`**:
- 新增有效豁免 + 告警测试,以及 pin 不一致、日期不一致、非 `source-pointer-only`、已存在已知许可时残留豁免等 4
类拦截单测。
4. **`skills/lumarescue` & `skills/mt-paotui-for-client`**:
- 将 `availability` 改为 `installable`,绑定当前固定 commit 的
`temporaryUnknownLicenseException`;
- 在 `entry.json` 与 `catalog-metadata.v1.json`
的中英文简介中同步标注:「暂未声明开源许可证,仅作源链接安装,请自行确认使用条款。」

### 本地验证
- `uv run --offline --quiet
scripts/catalog/test_validate_catalog_metadata.py` — 64 passed
- `uv run --offline --quiet
scripts/catalog/test_propose_upstream_updates.py` — 19 passed
- `uv run --offline --quiet scripts/catalog/test_audit_skill_update.py`
— 50 passed
- `uv run --offline --quiet scripts/catalog/validate_catalog_metadata.py
--require-complete` — 0 errors(两项均正确输出 `temporary-unknown-license` 告警)
- `uv run --offline --quiet scripts/i18n/validate-i18n.py` &
`translate.py --check` & `git diff --check` — passed
2026-12-05 00:00:25 +08:00

657 lines
20 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://desirecore.com/schemas/market/catalog-metadata.v1.schema.json",
"title": "DesireCore Market catalog metadata sidecar v1",
"description": "Strict source-owned metadata stored next to one legacy Market Agent, Team or Skill. The trusted catalog source ID, catalog commit, catalog path and catalog trust are injected by DesireCore and are intentionally prohibited here.",
"type": "object",
"required": [
"schemaVersion",
"identity",
"presentation",
"release",
"timestamps",
"provenance",
"governance",
"compatibility",
"spec"
],
"properties": {
"$schema": {
"type": "string",
"const": "../../schemas/catalog-metadata.v1.schema.json",
"description": "Relative schema reference from agents/<id>/, teams/<id>/ or skills/<id>/."
},
"schemaVersion": {
"type": "integer",
"const": 1,
"description": "Sidecar contract version. This is not the legacy Market manifest version."
},
"identity": {
"$ref": "#/$defs/identity"
},
"presentation": {
"$ref": "#/$defs/presentation"
},
"release": {
"$ref": "#/$defs/release"
},
"timestamps": {
"$ref": "#/$defs/timestamps"
},
"provenance": {
"$ref": "#/$defs/provenance"
},
"governance": {
"$ref": "#/$defs/governance"
},
"compatibility": {
"$ref": "#/$defs/compatibility"
},
"spec": {
"oneOf": [
{ "$ref": "#/$defs/agentSpec" },
{ "$ref": "#/$defs/teamSpec" },
{ "$ref": "#/$defs/skillSpec" }
]
}
},
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"identity": {
"properties": { "kind": { "const": "agent" } },
"required": ["kind"]
}
}
},
"then": {
"properties": {
"spec": { "$ref": "#/$defs/agentSpec" }
}
}
},
{
"if": {
"properties": {
"identity": {
"properties": { "kind": { "const": "team" } },
"required": ["kind"]
}
}
},
"then": {
"properties": {
"spec": { "$ref": "#/$defs/teamSpec" }
}
}
},
{
"if": {
"properties": {
"identity": {
"properties": { "kind": { "const": "skill" } },
"required": ["kind"]
}
}
},
"then": {
"properties": {
"spec": { "$ref": "#/$defs/skillSpec" }
}
}
},
{
"if": {
"properties": {
"spec": {
"properties": {
"kind": { "const": "agent" },
"installPolicy": { "const": "system" }
},
"required": ["kind", "installPolicy"]
}
},
"required": ["spec"]
},
"then": {
"properties": {
"spec": {
"properties": { "updatePolicy": { "const": "repository" } },
"required": ["updatePolicy"]
},
"governance": {
"properties": { "availability": { "const": "listing-only" } },
"required": ["availability"]
},
"release": {
"properties": { "state": { "const": "unknown" } },
"required": ["state"]
}
}
}
},
{
"if": {
"properties": {
"spec": {
"properties": {
"kind": { "const": "agent" },
"installPolicy": { "const": "market" }
},
"required": ["kind", "installPolicy"]
}
},
"required": ["spec"]
},
"then": {
"properties": {
"spec": {
"properties": { "updatePolicy": { "const": "market" } },
"required": ["updatePolicy"]
}
}
}
}
],
"$defs": {
"slug": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^(?!-)(?!.*--)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"
},
"safeRelativePath": {
"type": "string",
"minLength": 1,
"pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$"
},
"identity": {
"type": "object",
"description": "Source-local identity. catalogSourceId is injected by the trusted synchronizer and must not appear in the sidecar.",
"required": ["kind", "id"],
"properties": {
"kind": {
"type": "string",
"enum": ["agent", "team", "skill"]
},
"id": {
"$ref": "#/$defs/slug"
},
"parentId": {
"$ref": "#/$defs/slug"
}
},
"additionalProperties": false
},
"localizedPresentation": {
"type": "object",
"required": ["name", "summary"],
"properties": {
"name": { "type": "string", "minLength": 1, "maxLength": 200 },
"summary": { "type": "string", "minLength": 1, "maxLength": 1024 },
"description": { "type": "string", "minLength": 1 }
},
"additionalProperties": false
},
"presentation": {
"type": "object",
"required": ["defaultLocale", "i18n", "tags"],
"properties": {
"defaultLocale": {
"type": "string",
"pattern": "^[a-z]{2,3}(?:-[A-Z]{2})?$"
},
"i18n": {
"type": "object",
"minProperties": 1,
"patternProperties": {
"^[a-z]{2,3}(?:-[A-Z]{2})?$": {
"$ref": "#/$defs/localizedPresentation"
}
},
"additionalProperties": false
},
"icon": {
"type": "object",
"required": ["kind", "value"],
"properties": {
"kind": { "enum": ["emoji", "letter", "asset", "url"] },
"value": { "type": "string", "minLength": 1, "maxLength": 2048 }
},
"additionalProperties": false
},
"category": { "$ref": "#/$defs/slug" },
"tags": {
"type": "array",
"items": { "type": "string", "minLength": 1, "maxLength": 120 },
"uniqueItems": true
}
},
"additionalProperties": false
},
"unknownRelease": {
"type": "object",
"required": ["state"],
"properties": { "state": { "const": "unknown" } },
"additionalProperties": false
},
"knownRelease": {
"type": "object",
"required": ["state", "version", "versionScheme"],
"properties": {
"state": { "const": "known" },
"version": { "type": "string", "minLength": 1, "maxLength": 160 },
"versionScheme": {
"type": "string",
"enum": ["semver", "calver", "opaque"]
},
"changelog": {
"type": "array",
"maxItems": 100,
"items": { "type": "string", "minLength": 1, "maxLength": 2000 }
}
},
"additionalProperties": false,
"allOf": [
{
"if": { "properties": { "versionScheme": { "const": "semver" } } },
"then": {
"properties": {
"version": {
"pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$"
}
}
}
},
{
"if": { "properties": { "versionScheme": { "const": "calver" } } },
"then": {
"properties": {
"version": { "pattern": "^\\d{4}(?:[.-]\\d{1,2}){1,2}(?:[.-][0-9A-Za-z]+)*$" }
}
}
}
]
},
"release": {
"description": "A collection parent may explicitly use unknown; versions are never synthesized from children.",
"oneOf": [
{ "$ref": "#/$defs/unknownRelease" },
{ "$ref": "#/$defs/knownRelease" }
]
},
"unknownTimestamp": {
"type": "object",
"required": ["state"],
"properties": { "state": { "const": "unknown" } },
"additionalProperties": false
},
"knownDayTimestamp": {
"type": "object",
"required": ["state", "value", "precision"],
"properties": {
"state": { "const": "known" },
"value": {
"type": "string",
"format": "date",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"precision": { "const": "day" }
},
"additionalProperties": false
},
"knownSecondTimestamp": {
"type": "object",
"required": ["state", "value", "precision"],
"properties": {
"state": { "const": "known" },
"value": {
"type": "string",
"format": "date-time",
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z$"
},
"precision": { "const": "second" }
},
"additionalProperties": false
},
"timestamp": {
"oneOf": [
{ "$ref": "#/$defs/unknownTimestamp" },
{ "$ref": "#/$defs/knownDayTimestamp" },
{ "$ref": "#/$defs/knownSecondTimestamp" }
]
},
"timestamps": {
"type": "object",
"description": "Catalog modification, content publication, governance review and upstream observation are separate facts. syncedAt is runtime-only and prohibited.",
"required": [
"catalogUpdatedAt",
"releasePublishedAt",
"reviewedAt",
"upstreamObservedAt"
],
"properties": {
"catalogUpdatedAt": { "$ref": "#/$defs/timestamp" },
"releasePublishedAt": { "$ref": "#/$defs/timestamp" },
"reviewedAt": { "$ref": "#/$defs/timestamp" },
"upstreamObservedAt": { "$ref": "#/$defs/timestamp" }
},
"additionalProperties": false
},
"contentProvenance": {
"type": "object",
"required": ["kind", "url"],
"properties": {
"kind": {
"type": "string",
"enum": ["git", "web", "zip", "release", "package", "container"]
},
"url": { "type": "string", "format": "uri", "pattern": "^https://" },
"path": { "$ref": "#/$defs/safeRelativePath" },
"ref": { "type": "string", "minLength": 1, "maxLength": 256 },
"sha256": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" }
},
"additionalProperties": false
},
"provenance": {
"type": "object",
"description": "Only content provenance is source-owned. Catalog provenance and trust are injected by the synchronizer.",
"properties": {
"content": { "$ref": "#/$defs/contentProvenance" }
},
"additionalProperties": false
},
"maintainer": {
"type": "object",
"required": ["name"],
"properties": {
"name": { "type": "string", "minLength": 1 },
"url": { "type": "string", "format": "uri" },
"verified": { "type": "boolean" }
},
"additionalProperties": false
},
"unknownLicense": {
"type": "object",
"required": ["state"],
"properties": { "state": { "const": "unknown" } },
"additionalProperties": false
},
"knownLicense": {
"type": "object",
"required": ["state", "value"],
"properties": {
"state": { "const": "known" },
"value": { "type": "string", "minLength": 1 },
"evidencePath": { "$ref": "#/$defs/safeRelativePath" }
},
"additionalProperties": false
},
"license": {
"oneOf": [
{ "$ref": "#/$defs/unknownLicense" },
{ "$ref": "#/$defs/knownLicense" }
]
},
"branding": {
"type": "object",
"required": ["relationship", "nameUsage", "logoStatus"],
"properties": {
"relationship": { "enum": ["official", "partner", "independent-listing"] },
"nameUsage": { "enum": ["owned", "licensed", "nominative"] },
"logoStatus": {
"enum": ["not-used", "license-covered", "trademark-policy-allowed", "permission-obtained"]
}
},
"additionalProperties": false
},
"compliance": {
"type": "object",
"required": ["licenseEvidencePath", "reviewedRef", "reviewedAt", "reviewedBy", "upstreamEndorsed"],
"properties": {
"licenseEvidencePath": { "$ref": "#/$defs/safeRelativePath" },
"noticePath": { "$ref": "#/$defs/safeRelativePath" },
"reviewedRef": { "type": "string", "minLength": 1 },
"reviewedAt": {
"type": "string",
"oneOf": [
{ "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
{
"format": "date-time",
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z$"
}
]
},
"reviewedBy": { "type": "string", "minLength": 1 },
"upstreamEndorsed": { "type": "boolean" }
},
"additionalProperties": false
},
"temporaryUnknownLicenseException": {
"type": "object",
"description": "Explicit, pin-bound temporary waiver allowing a source-pointer-only entry whose upstream declares no license yet to be installable while surfacing a visible warning and user-facing notice.",
"required": ["reviewedRef", "reviewedAt", "reviewedBy", "reason", "upstreamEndorsed"],
"properties": {
"reviewedRef": { "type": "string", "minLength": 1 },
"reviewedAt": {
"type": "string",
"oneOf": [
{ "format": "date", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
{
"format": "date-time",
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z$"
}
]
},
"reviewedBy": { "type": "string", "minLength": 1 },
"reason": { "type": "string", "minLength": 1, "maxLength": 500 },
"upstreamEndorsed": { "type": "boolean" }
},
"additionalProperties": false
},
"governance": {
"type": "object",
"required": ["availability", "license", "redistribution"],
"properties": {
"stewardship": {
"enum": ["official", "partner", "community", "pointer"]
},
"availability": {
"enum": ["listing-only", "installable"]
},
"license": { "$ref": "#/$defs/license" },
"redistribution": {
"enum": ["allowed", "source-pointer-only", "verify-package-terms"]
},
"branding": { "$ref": "#/$defs/branding" },
"compliance": { "$ref": "#/$defs/compliance" },
"temporaryUnknownLicenseException": { "$ref": "#/$defs/temporaryUnknownLicenseException" },
"listingMaintainer": { "$ref": "#/$defs/maintainer" },
"upstreamMaintainer": { "$ref": "#/$defs/maintainer" }
},
"additionalProperties": false
},
"platforms": {
"oneOf": [
{
"type": "object",
"required": ["state"],
"properties": { "state": { "const": "unknown" } },
"additionalProperties": false
},
{
"type": "object",
"required": ["state"],
"properties": { "state": { "const": "all" } },
"additionalProperties": false
},
{
"type": "object",
"required": ["state", "values"],
"properties": {
"state": { "const": "known" },
"values": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "enum": ["macos", "windows", "linux", "web", "ios", "android"] }
}
},
"additionalProperties": false
}
]
},
"requirement": {
"type": "object",
"required": ["kind", "value"],
"properties": {
"kind": { "enum": ["runtime", "hardware", "permission", "connection"] },
"value": { "type": "string", "minLength": 1, "maxLength": 500 }
},
"additionalProperties": false
},
"compatibility": {
"type": "object",
"required": ["platforms"],
"properties": {
"platforms": { "$ref": "#/$defs/platforms" },
"requiredClientVersion": {
"type": "string",
"pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$"
},
"compatibleAgents": {
"type": "array",
"items": { "$ref": "#/$defs/slug" },
"uniqueItems": true
},
"requirements": {
"type": "array",
"items": { "$ref": "#/$defs/requirement" },
"uniqueItems": true
}
},
"additionalProperties": false
},
"agentSpec": {
"type": "object",
"required": ["kind"],
"properties": {
"kind": { "const": "agent" },
"installPolicy": { "enum": ["market", "system"] },
"updatePolicy": { "enum": ["market", "repository"] },
"persona": {
"type": "object",
"required": ["role", "traits"],
"properties": {
"role": { "type": "string", "minLength": 1 },
"traits": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
}
},
"additionalProperties": false
}
},
"dependencies": {
"installPolicy": ["updatePolicy"],
"updatePolicy": ["installPolicy"]
},
"additionalProperties": false
},
"teamSpec": {
"type": "object",
"description": "Team facts owned by the listing. A Team is always a fork pointer: installation forks the team repository and updates are a git pull, so a Team never declares installPolicy or updatePolicy. Every field here is presentation metadata that may drift from the forked repository; membership, permissions and capability resolution must read the forked team.json and members.json instead.",
"required": ["kind"],
"properties": {
"kind": { "const": "team" },
"supervisorName": { "type": "string", "minLength": 1, "maxLength": 200 },
"supervisorAgentId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[A-Za-z0-9_-]+$"
},
"memberCount": {
"type": "integer",
"minimum": 1,
"description": "Total member count including the supervisor."
},
"memberNames": {
"type": "array",
"maxItems": 32,
"items": { "type": "string", "minLength": 1, "maxLength": 200 }
},
"requiredSkills": {
"type": "array",
"maxItems": 128,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1, "maxLength": 160 }
}
},
"additionalProperties": false
},
"collectionChild": {
"type": "object",
"required": ["identity", "path", "presentation", "release"],
"properties": {
"identity": {
"type": "object",
"required": ["kind", "id", "parentId"],
"properties": {
"kind": { "const": "skill" },
"id": { "$ref": "#/$defs/slug" },
"parentId": { "$ref": "#/$defs/slug" }
},
"additionalProperties": false
},
"path": { "$ref": "#/$defs/safeRelativePath" },
"presentation": { "$ref": "#/$defs/presentation" },
"release": { "$ref": "#/$defs/release" }
},
"additionalProperties": false
},
"collection": {
"type": "object",
"required": ["role", "childCount", "children"],
"properties": {
"role": { "const": "parent" },
"childCount": { "type": "integer", "minimum": 1 },
"children": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#/$defs/collectionChild" }
}
},
"additionalProperties": false
},
"skillSpec": {
"type": "object",
"required": ["kind"],
"properties": {
"kind": { "const": "skill" },
"riskLevel": { "enum": ["low", "medium", "high", "critical"] },
"skillType": { "enum": ["procedural", "declarative", "hybrid"] },
"requires": {
"type": "object",
"required": ["tools", "connections"],
"properties": {
"tools": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
},
"connections": {
"type": "array",
"items": { "type": "string", "minLength": 1 }
}
},
"additionalProperties": false
},
"collection": { "$ref": "#/$defs/collection" }
},
"additionalProperties": false
}
}
}