feat: 迁移统一目录元数据契约 (#102)

## 中文

- 为 System Agent、34 个 Builtin Skill、28 个 Pointer/Collection 条目增加 catalog
sidecar
- 覆盖 147 个 collection child,并固定可证明的来源;无法证明的内容保持 listing-only/unknown
- 增加 strict Schema、validator、collection check 与 CI 完整性门禁

## English

- Add catalog metadata sidecars for the System Agent, 34 built-in
Skills, and 28 pointer/collection entries
- Cover 147 collection children while keeping unverifiable facts
listing-only or unknown
- Add strict schemas, validators, deterministic collection checks, and
CI completeness gates

## 验证 / Verification

- Catalog validator 17/17
- Collection generator 4/4
- 63 sidecars, 147 children, zero errors
This commit is contained in:
2026-08-31 04:10:49 -04:00
committed by GitHub
parent 40944ca1d3
commit a205ef20f0
80 changed files with 10734 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["pyyaml>=6.0"]
# dependencies = ["jsonschema>=4.23,<5", "pyyaml>=6.0"]
# ///
"""Unit tests for market validation policies."""

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["pyyaml>=6.0"]
# dependencies = ["jsonschema>=4.23,<5", "pyyaml>=6.0"]
# ///
"""Validate DesireCore market i18n state.
@@ -19,6 +19,7 @@ Checks:
10. Skill, Agent, and entry.json category references exist in categories.json.
11. entry.json pointers have the required marketplace fields, valid inline SVG icons, and safe source URLs.
12. Market Skills set `disable-model-invocation` to true or omit it; false is prohibited.
13. Every catalog-metadata.v1.json sidecar passes the strict schema and legacy consistency checks.
Exit codes:
0 = pass
@@ -45,6 +46,12 @@ from typing import Any, Iterable
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
CATALOG_SCRIPT_DIR = Path(__file__).resolve().parents[1] / "catalog"
if str(CATALOG_SCRIPT_DIR) not in sys.path:
sys.path.insert(0, str(CATALOG_SCRIPT_DIR))
from validate_catalog_metadata import validate_repository as validate_catalog_metadata_repository
try:
import yaml
except ImportError:
@@ -586,6 +593,15 @@ def main(argv: list[str]) -> int:
declared_locales, category_ids, manifest = validate_market_root(report)
validate_market_catalog(report, manifest, category_ids, online=args.online)
catalog_report = validate_catalog_metadata_repository(REPO_ROOT)
for issue in catalog_report.issues:
report.add(Issue(
issue.path,
issue.rule,
issue.message,
severity=issue.severity,
))
if args.paths:
targets = [Path(p).resolve() for p in args.paths]
else: