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
This commit is contained in:
mashagua authored and GitHub committed 2026-12-05 00:00:25 +08:00
1 parent 5e1f704405
commit 3d036b7972
7 files changed
+177 -17

No files matched your search

+23
View File
@@ -429,6 +429,28 @@
},
"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"],
@@ -445,6 +467,7 @@
},
"branding": { "$ref": "#/$defs/branding" },
"compliance": { "$ref": "#/$defs/compliance" },
"temporaryUnknownLicenseException": { "$ref": "#/$defs/temporaryUnknownLicenseException" },
"listingMaintainer": { "$ref": "#/$defs/maintainer" },
"upstreamMaintainer": { "$ref": "#/$defs/maintainer" }
},
@@ -1043,6 +1043,81 @@ class CatalogMetadataValidatorTests(unittest.TestCase):
self.assertTrue(any("known reviewedAt" in message for message in evidence))
self.assertTrue(any("compliance" in message for message in evidence))
def test_accepts_pin_bound_temporary_unknown_license_waiver_with_warning(self) -> None:
entry = json.loads(self.entry_path.read_text(encoding="utf-8"))
entry["stewardship"] = "pointer"
entry["license"] = "not-declared"
entry["redistribution"] = "source-pointer-only"
self.entry_path.write_text(json.dumps(entry, indent=2), encoding="utf-8")
pin = "a" * 40
def mutate(payload):
payload["timestamps"]["reviewedAt"] = {"state": "known", "value": "2026-12-04", "precision": "day"}
payload["provenance"]["content"]["ref"] = pin
payload["governance"] = {
"stewardship": "pointer",
"availability": "installable",
"license": unknown(),
"redistribution": "source-pointer-only",
"temporaryUnknownLicenseException": {
"reviewedRef": pin,
"reviewedAt": "2026-12-04",
"reviewedBy": "mashagua",
"reason": "Upstream has not declared a license yet; temporary source-pointer waiver with notice.",
"upstreamEndorsed": False,
},
}
self.rewrite_sidecar(mutate)
report = self.validate()
self.assertFalse(report.has_errors, report.issues)
self.assertTrue(any(issue.rule == "temporary-unknown-license" and issue.severity == "warning" for issue in report.issues))
def test_rejects_invalid_temporary_unknown_license_waiver_combinations(self) -> None:
entry = json.loads(self.entry_path.read_text(encoding="utf-8"))
entry["stewardship"] = "pointer"
entry["license"] = "not-declared"
entry["redistribution"] = "source-pointer-only"
self.entry_path.write_text(json.dumps(entry, indent=2), encoding="utf-8")
pin = "a" * 40
base_waiver = {
"reviewedRef": pin,
"reviewedAt": "2026-12-04",
"reviewedBy": "mashagua",
"reason": "Temporary source-pointer waiver.",
"upstreamEndorsed": False,
}
cases = [
# mismatched reviewedRef
lambda p: p["governance"]["temporaryUnknownLicenseException"].update(reviewedRef="b" * 40),
# mismatched reviewedAt
lambda p: p["governance"]["temporaryUnknownLicenseException"].update(reviewedAt="2026-12-03"),
# non-source-pointer-only redistribution
lambda p: p["governance"].update(redistribution="allowed"),
# stale waiver left after license becomes known
lambda p: p["governance"].update(license={"state": "known", "value": "MIT", "evidencePath": "LICENSE"}),
]
for idx, tweak in enumerate(cases):
def mutate(payload, tweak=tweak):
payload["timestamps"]["reviewedAt"] = {"state": "known", "value": "2026-12-04", "precision": "day"}
payload["provenance"]["content"]["ref"] = pin
payload["governance"] = {
"stewardship": "pointer",
"availability": "installable",
"license": unknown(),
"redistribution": "source-pointer-only",
"temporaryUnknownLicenseException": dict(base_waiver),
}
tweak(payload)
self.rewrite_sidecar(mutate)
report = self.validate()
with self.subTest(case=idx):
self.assertTrue(report.has_errors, f"case {idx} should fail")
self.assertTrue(any(issue.rule == "installable-evidence" for issue in report.issues))
def test_allows_builtin_installation_with_stable_incomplete_governance_warnings(self) -> None:
self.entry_path.unlink()
skill_path = self.entry_path.with_name("SKILL.md")
+51 -5
View File
@@ -904,11 +904,26 @@ def validate_sidecar(
governance = sidecar.get("governance")
provenance = sidecar.get("provenance")
timestamps = sidecar.get("timestamps")
if isinstance(governance, dict) and isinstance(governance.get("temporaryUnknownLicenseException"), dict):
license_fact_check = governance.get("license")
if isinstance(license_fact_check, dict) and license_fact_check.get("state") == "known":
report.add(
rel,
"installable-evidence",
"temporaryUnknownLicenseException must be removed once license.state is known",
)
if governance.get("availability") != "installable":
report.add(
rel,
"installable-evidence",
"temporaryUnknownLicenseException is only valid when governance.availability is installable",
)
if isinstance(governance, dict) and governance.get("availability") == "installable":
content = provenance.get("content") if isinstance(provenance, dict) else None
license_fact = governance.get("license")
reviewed_at = timestamps.get("reviewedAt") if isinstance(timestamps, dict) else None
compliance = governance.get("compliance")
unknown_waiver = governance.get("temporaryUnknownLicenseException")
maintainer = governance.get("listingMaintainer")
# Builtin Skills are already delivered by the trusted Market bootstrap.
@@ -957,16 +972,47 @@ def validate_sidecar(
if not _content_is_immutable(content):
report.add(rel, "installable-evidence", "installable content must have an immutable ref or SHA-256 digest")
if not isinstance(license_fact, dict) or license_fact.get("state") != "known":
report.add(rel, "installable-evidence", "installable content must have a known license")
if _known_timestamp_value(reviewed_at) is None:
report.add(rel, "installable-evidence", "installable content must have a known reviewedAt timestamp")
if not isinstance(compliance, dict):
report.add(rel, "installable-evidence", "installable content must include compliance evidence")
else:
content_ref = None
if isinstance(content, dict):
content_ref = content.get("ref") or content.get("sha256")
using_unknown_waiver = (
isinstance(license_fact, dict)
and license_fact.get("state") == "unknown"
and isinstance(unknown_waiver, dict)
)
if using_unknown_waiver:
if governance.get("redistribution") != "source-pointer-only":
report.add(
rel,
"installable-evidence",
"temporaryUnknownLicenseException requires governance.redistribution to be source-pointer-only",
)
if content_ref is not None and unknown_waiver.get("reviewedRef") != content_ref:
report.add(
rel,
"installable-evidence",
"temporaryUnknownLicenseException.reviewedRef must match the immutable content ref/digest",
)
if unknown_waiver.get("reviewedAt") != _known_timestamp_value(reviewed_at):
report.add(
rel,
"installable-evidence",
"temporaryUnknownLicenseException.reviewedAt must equal timestamps.reviewedAt",
)
report.add(
rel,
"temporary-unknown-license",
f"installable under temporary unknown-license waiver ({unknown_waiver.get('reason')})",
severity="warning",
)
return
if not isinstance(license_fact, dict) or license_fact.get("state") != "known":
report.add(rel, "installable-evidence", "installable content must have a known license")
if not isinstance(compliance, dict):
report.add(rel, "installable-evidence", "installable content must include compliance evidence")
else:
if content_ref is not None and compliance.get("reviewedRef") != content_ref:
report.add(rel, "installable-evidence", "compliance.reviewedRef must match the immutable content ref/digest")
if compliance.get("reviewedAt") != _known_timestamp_value(reviewed_at):
+13 -4
View File
@@ -10,11 +10,11 @@
"i18n": {
"en-US": {
"name": "LumaRescue",
"summary": "AI bad-photo rescue skill — reshapes light, applies master-level composition, restores damage and enhances aesthetics while preserving subject identity and factual content, for Codex/Doubao desktop"
"summary": "AI bad-photo rescue skill — reshapes light, applies master-level composition, restores damage and enhances aesthetics while preserving subject identity and factual content, for Codex/Doubao desktop. Note: No open-source license declared upstream yet; installed via source pointer only—please verify usage terms yourself."
},
"zh-CN": {
"name": "LumaRescue 废片拯救",
"summary": "AI 废片拯救技能:在保留主体身份与事实内容的前提下,通过光影重塑、大师级构图、照片修复与审美增强把普通照片修成惊艳成片,适配 Codex/豆包桌面版"
"summary": "AI 废片拯救技能:在保留主体身份与事实内容的前提下,通过光影重塑、大师级构图、照片修复与审美增强把普通照片修成惊艳成片,适配 Codex/豆包桌面版。注:暂未声明开源许可证,仅作源链接安装,请自行确认使用条款。"
}
},
"category": "creative",
@@ -38,7 +38,9 @@
"state": "unknown"
},
"reviewedAt": {
"state": "unknown"
"state": "known",
"value": "2026-12-04",
"precision": "day"
},
"upstreamObservedAt": {
"state": "known",
@@ -55,7 +57,7 @@
},
"governance": {
"stewardship": "pointer",
"availability": "listing-only",
"availability": "installable",
"license": {
"state": "unknown"
},
@@ -64,6 +66,13 @@
"name": "justlovemaki",
"url": "https://github.com/justlovemaki/LumaRescue",
"verified": false
},
"temporaryUnknownLicenseException": {
"reviewedRef": "14cd76cea24e825e079fa2dfa5c5322002d6dc4e",
"reviewedAt": "2026-12-04",
"reviewedBy": "mashagua",
"reason": "Upstream repository does not declare an open-source license yet; temporarily enabled as source-pointer-only installable at pinned ref 14cd76cea24e with explicit user-facing notice in zh-CN/en-US summaries.",
"upstreamEndorsed": false
}
},
"compatibility": {
+2 -2
View File
@@ -12,11 +12,11 @@
"i18n": {
"zh-CN": {
"name": "LumaRescue 废片拯救",
"shortDesc": "AI 废片拯救技能:在保留主体身份与事实内容的前提下,通过光影重塑、大师级构图、照片修复与审美增强把普通照片修成惊艳成片,适配 Codex/豆包桌面版"
"shortDesc": "AI 废片拯救技能:在保留主体身份与事实内容的前提下,通过光影重塑、大师级构图、照片修复与审美增强把普通照片修成惊艳成片,适配 Codex/豆包桌面版。注:暂未声明开源许可证,仅作源链接安装,请自行确认使用条款。"
},
"en-US": {
"name": "LumaRescue",
"shortDesc": "AI bad-photo rescue skill — reshapes light, applies master-level composition, restores damage and enhances aesthetics while preserving subject identity and factual content, for Codex/Doubao desktop"
"shortDesc": "AI bad-photo rescue skill — reshapes light, applies master-level composition, restores damage and enhances aesthetics while preserving subject identity and factual content, for Codex/Doubao desktop. Note: No open-source license declared upstream yet; installed via source pointer only—please verify usage terms yourself."
}
},
"maintainer": {
@@ -10,11 +10,11 @@
"i18n": {
"en-US": {
"name": "Meituan Paotui Client",
"summary": "Meituan Paotui ordering assistant for pickup-delivery, errands and shopping, with address search and two-step cost confirmation. Requires a Meituan account and the upstream authorization tool; real orders and delivery charges require user confirmation."
"summary": "Meituan Paotui ordering assistant for pickup-delivery, errands and shopping, with address search and two-step cost confirmation. Requires a Meituan account and the upstream authorization tool; real orders and delivery charges require user confirmation. Note: No open-source license declared upstream yet; installed via source pointer only—please verify usage terms yourself."
},
"zh-CN": {
"name": "美团跑腿下单助手",
"summary": "美团跑腿下单助手:帮取送、帮忙(取号/搬装)、帮买全流程下单,含地址搜索与两步费用确认。需美团账号与上游授权工具;真实订单和配送费用须由用户确认。"
"summary": "美团跑腿下单助手:帮取送、帮忙(取号/搬装)、帮买全流程下单,含地址搜索与两步费用确认。需美团账号与上游授权工具;真实订单和配送费用须由用户确认。注:暂未声明开源许可证,仅作源链接安装,请自行确认使用条款。"
}
},
"category": "business",
@@ -36,7 +36,7 @@
},
"reviewedAt": {
"state": "known",
"value": "2026-10-05",
"value": "2026-12-04",
"precision": "day"
},
"upstreamObservedAt": {
@@ -54,7 +54,7 @@
},
"governance": {
"stewardship": "pointer",
"availability": "listing-only",
"availability": "installable",
"license": {
"state": "unknown"
},
@@ -63,6 +63,13 @@
"name": "meituan",
"url": "https://github.com/meituan/MT-Paotui-For-Client",
"verified": false
},
"temporaryUnknownLicenseException": {
"reviewedRef": "05ead232ae2b94b9b55b2a1e126e039a1cb6db00",
"reviewedAt": "2026-12-04",
"reviewedBy": "mashagua",
"reason": "Upstream repository does not declare an open-source license yet; temporarily enabled as source-pointer-only installable at pinned ref 05ead232ae2b with explicit user-facing notice in zh-CN/en-US summaries.",
"upstreamEndorsed": false
}
},
"compatibility": {
+2 -2
View File
@@ -9,11 +9,11 @@
"i18n": {
"zh-CN": {
"name": "美团跑腿下单助手",
"shortDesc": "美团跑腿下单助手:帮取送、帮忙(取号/搬装)、帮买全流程下单,含地址搜索与两步费用确认。需美团账号与上游授权工具;真实订单和配送费用须由用户确认。"
"shortDesc": "美团跑腿下单助手:帮取送、帮忙(取号/搬装)、帮买全流程下单,含地址搜索与两步费用确认。需美团账号与上游授权工具;真实订单和配送费用须由用户确认。注:暂未声明开源许可证,仅作源链接安装,请自行确认使用条款。"
},
"en-US": {
"name": "Meituan Paotui Client",
"shortDesc": "Meituan Paotui ordering assistant for pickup-delivery, errands and shopping, with address search and two-step cost confirmation. Requires a Meituan account and the upstream authorization tool; real orders and delivery charges require user confirmation."
"shortDesc": "Meituan Paotui ordering assistant for pickup-delivery, errands and shopping, with address search and two-step cost confirmation. Requires a Meituan account and the upstream authorization tool; real orders and delivery charges require user confirmation. Note: No open-source license declared upstream yet; installed via source pointer only—please verify usage terms yourself."
}
},
"maintainer": {