fix(catalog): 校验技能指针的客户端契约,撤回 REA 的单段版本 / validate skill pointers against the client contract (#239)

客户端按 `marketSkillEntrySchema` 校验 `entry.json`,`latestVersion` 只接受 `x.y` 或 `x.y.z`,
不通过的条目在索引时被跳过。#227 写入的上游修订号 `50` 让所有客户端都看不到
reverse-engineer-anything,而 manifest 仍计入它。

- reverse-engineer-anything 恢复为 `release: unknown` 且不声明 `latestVersion`;固定提交与合规审查不变。
- video-use 去掉指针无法声明的 `skillType`,此前客户端一直拒绝这份 sidecar。
- 校验器用导出的客户端 Schema 校验技能指针,并按客户端判据双向比较 sidecar 事实。

Clients skip any `entry.json` whose `latestVersion` is not `x.y` or `x.y.z`, so the upstream
revision `50` from #227 hid reverse-engineer-anything from every client. This restores the shape
reviewed in #212, drops a `skillType` from video-use that made clients reject its sidecar, and makes
the validator enforce the client contract for skill pointers and compare sidecar facts both ways.

验证 / Validation: `validate_catalog_metadata.py --require-complete` 0 errors;真实 MarketSync
与校验器在 43 类变异下判定一致;索引 145 技能、9 Agent、2 团队,0 个 sidecar 被拒。
This commit is contained in:
yige authored and GitHub committed 2026-10-31 16:34:32 +08:00
1 parent 952ade3ace
commit 7189d91395
10 files changed
+592 -81

No files matched your search

+4 -2
View File
@@ -99,7 +99,7 @@ Use the schemas and existing listings as implementation references. A shortened
### Static catalog facts
Catalog counts are file-derived, not usage statistics. Do not author views, downloads, ratings, Stars, install counts, or runtime health. Missing publisher evidence remains unknown. A listed release is not a live latest-version query. Preserve the upstream release identifier; do not invent a three-part version to fill a missing fact. New team localization fields and two-part pointer versions must wait until the matching client contract is released before being published to the shared catalog. Regenerate bootstrap archives through the client repository's synchronization tools, never by editing ZIP contents manually.
Catalog counts are file-derived, not usage statistics. Do not author views, downloads, ratings, Stars, install counts, or runtime health. Missing publisher evidence remains unknown. A listed release is not a live latest-version query. Preserve the upstream release identifier; do not invent a three-part version to fill a missing fact. New team localization fields and two-part pointer versions must wait until the matching client contract is released before being published to the shared catalog. Until then, an upstream identifier the released contract does not admit, such as a bare revision number `50`, stays out of `latestVersion` and `release`: keep the release unknown rather than reshaping the identifier. Regenerate bootstrap archives through the client repository's synchronization tools, never by editing ZIP contents manually.
### Local skills
@@ -115,6 +115,8 @@ The `retired` list identifies former built-in skills that clients may retire at
An external skill uses `skills/<id>/entry.json` to describe its upstream source, presentation, maintainer, category, license, and redistribution terms. Skill listings require an inline SVG `icon`. Supported source kinds are `git`, `web`, and `zip`; external listings count toward `manifest.stats.totalSkills` but do not belong in the built-in skill index.
The raw pointer must pass the [exported skill client schema](schemas/market-skill-entry.client.schema.json) before sidecar validation. A client skips any entry that fails it, so the listing disappears for its users while the manifest still counts it. `latestVersion` accepts numeric `x.y` or `x.y.z` and maps to `release.version`; the sidecar's `versionScheme` must be the one the client derives from that value, which is `opaque` for `x.y`. The sidecar must also agree with the pointer on `category`, `tags`, `riskLevel`, and `requiredClientVersion`, and cannot add `skillType` or `compatibleAgents`, which a pointer does not declare. On any difference the client rejects the whole sidecar and the listing becomes listing-only.
A collection groups multiple upstream skills under one listing, with a declared `children` inventory for discovery. Keep the children's metadata in the parent's sidecar. Each child has its own `skill + parentId + id` identity and release fact; never infer a child's version from its parent, whose version may be unknown.
See the [Lark Suite CLI entry](skills/larksuite-cli/entry.json) and [sidecar](skills/larksuite-cli/catalog-metadata.v1.json). The [collection generator](scripts/gen-collection-children.py) derives children from upstream `SKILL.md` files; its `--check` mode verifies reproducible, pinned collections without rewriting entries.
@@ -161,7 +163,7 @@ The [catalog metadata schema](schemas/catalog-metadata.v1.schema.json) covers pr
- **Evidence paths follow the content.** `license.evidencePath`, `compliance.licenseEvidencePath`, and `compliance.noticePath` are relative to the item directory for vendored content, and the files must exist. For pointers they refer to the upstream snapshot; offline validation cannot fetch that evidence and warns about claims against unpinned sources.
- **Unknown is a valid fact.** Use explicit `known` / `unknown` states. A known day uses `YYYY-MM-DD` with `precision: "day"`; a known second uses an RFC 3339 UTC timestamp ending in `Z` with `precision: "second"`. Never fill an unknown release or catalog timestamp with the current date, clone time, or synchronization time.
The agent and team client schemas are generated compatibility snapshots. Their `$comment` records the upstream source commit and blob. Refresh them from the corresponding TypeScript exports when compatibility changes; do not weaken them or substitute sidecar-only validation.
The agent, skill, and team client schemas are generated compatibility snapshots. Their `$comment` records the upstream source commit and blob. Refresh them from the corresponding TypeScript exports when compatibility changes; do not weaken them or substitute sidecar-only validation.
## Localization