Repository navigation
fix(catalog): 校验技能指针的客户端契约,撤回 REA 的单段版本 / validate skill pointers against the client contract - #239
Merged
Merged
Conversation
…inst the client contract and withdraw the REA bare revision 客户端按 `marketSkillEntrySchema` 校验 `skills/<id>/entry.json`,`latestVersion` 只接受 `x.y` 或 `x.y.z`,不通过的条目在索引时被跳过。#227 把上游修订号 `50` 写入 `latestVersion`,所有客户端都看不到 reverse-engineer-anything,而 `manifest.stats.totalSkills` 仍计入它。 - reverse-engineer-anything 恢复为 `release: unknown` 且不声明 `latestVersion`, 即 #212 审查时的形态;固定提交与合规审查不变。 - 校验器用导出的客户端 Schema 校验技能指针,并补上客户端在 Schema 之外的合集规则 与 `entry.id` 目录一致性。 - 技能指针此前读的是不存在的 `version` 字段,`release` 对照从未生效,现改读 `latestVersion`;同时按客户端判据比较 `versionScheme`,并拒绝只有 sidecar 声明版本的情况。 Clients validate `skills/<id>/entry.json` against `marketSkillEntrySchema`, whose `latestVersion` admits only `x.y` or `x.y.z`, and skip any entry that fails while indexing. #227 recorded upstream revision `50` there, so every client lost reverse-engineer-anything while the manifest still counted it. This restores the shape reviewed in #212 and makes the catalog validator enforce the client contract for skill pointers, including the `release` comparison that never ran for them.
…acts both ways like the client and fix video-use 差分对比真实 MarketSync 与校验器后发现:客户端双向比较 `category`、`tags`、 `requiredClientVersion`、`riskLevel`、`skillType`、`compatibleAgents` 和 `provenance.content`,差异会拒绝整份 sidecar,条目退化为 listing-only;校验器 只做了单向比较或没有比较。video-use 正是这样:sidecar 声明的 `skillType` 指针无法声明,sidecar 一直被客户端拒绝,校验器却报 0 错误。 校验器补齐这些比较,覆盖技能指针、内置技能和 Agent;Team 的 sidecar 客户端不读取, 保持原规则。video-use 去掉 `skillType`。 A differential run of the real MarketSync against this validator showed the client compares these facts in both directions and rejects the whole sidecar on any difference, while the validator compared them one way or not at all. video-use was a live case: its sidecar declared a `skillType` no pointer can declare. The validator now compares them for skill pointers, built-in skills and Agents, and video-use drops the field.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述 / Summary
reverse-engineer-anything标为installable,但所有客户端都在索引时丢弃它:客户端索引 144 个技能,manifest.stats.totalSkills是 145。本 PR 恢复这个条目,并让目录校验器按客户端契约校验技能指针,让这类问题在目录评审时报错。reverse-engineer-anythingis listed asinstallable, yet every client drops it while indexing: 144 skills indexed against a declared 145. This PR restores the listing and makes the catalog validator enforce the client contract for skill pointers, so the same mistake now fails at review.根因 / Root cause
marketSkillEntrySchema校验entry.json,latestVersion只接受x.y或x.y.z,不通过就跳过整个条目。fix: 同步上游健康巡检 #213 两轮已审查的市场引用 #227 按上游metadata.version写入了"50"。version字段,所以release与latestVersion的对照对技能指针从未生效。Clients validate
entry.jsonagainstmarketSkillEntrySchema, whoselatestVersionadmits onlyx.yorx.y.z, and skip the whole entry otherwise; #227 recorded the upstreammetadata.versionvalue"50". The validator checked only Agent and Team pointers against client schemas. For skill pointers it also read a nonexistentversionfield, so comparingreleasewithlatestVersionnever ran.修法与理由 / Fix and rationale
条目恢复为
release: unknown且不声明latestVersion,即 #212 审查时的形态。固定提交和合规审查不变。README.md已要求新版本格式“先发布兼容客户端,再进入目录”。放宽 Schema 只对升级后的客户端有效,已发布的客户端仍会丢这个条目;改目录则在下次市场同步后对所有客户端生效。客户端测试也明确拒绝单段版本1。50.0或50.0.0。 这能通过校验,但上游从未发布过这个版本,违反“保留上游标识、不捏造版本”的规则。release: unknown的条目相同。这里也不损失更新能力:客户端对单段版本的compareSemver("50", "51")返回相等,所以latestVersion本来也推不动这个条目的更新。The listing returns to
release: unknownwith nolatestVersion, the shape reviewed in #212; the pin and compliance review are unchanged.README.mdalready requires a compatible client release before a new version format enters the catalog. Widening the schema helps only upgraded clients, whereas a catalog fix reaches every client on its next market sync. A client test also explicitly rejects the bare version1.50.0or50.0.0. Either would pass validation, but upstream never published such a version, which breaks the rule to preserve upstream identifiers rather than invent them.release: unknown. No update capability is lost:compareSemver("50", "51")compares equal in the client, solatestVersioncould not drive updates for this listing anyway.校验器变更 / Validator changes
schemas/market-skill-entry.client.schema.json,从v10.0.195的marketSkillEntrySchema导出;技能指针不通过时报skill-entry-schema。children与source.path互斥、子技能 ID 不重复、entry.id与目录名一致。latestVersion,合集父条目的版本按客户端语义忽略。release按客户端判据双向比较:只有 sidecar 声明版本,或versionScheme与客户端推导结果不同,都报错。客户端遇到这两种情况会拒绝整个 sidecar,条目退化为listing-only。category、tags、requiredClientVersion、riskLevel、skillType、compatibleAgents、provenance.content同样改为双向比较,覆盖技能指针、内置技能和 Agent。Team 的 sidecar 客户端不读取,保持原规则。差分验证时还发现
video-use:sidecar 声明了指针无法声明的skillType,一直被客户端拒绝,校验器却报 0 错误。本 PR 去掉这个字段。条目本来就是listing-only,用户可见的安装状态不变。schemas/market-skill-entry.client.schema.json, exported frommarketSkillEntrySchemaatv10.0.195; a failing skill pointer reportsskill-entry-schema.childrenandsource.pathare mutually exclusive, child IDs are unique, andentry.idequals the directory slug.latestVersion, and a collection parent's own version is ignored as in the client.releaseis compared in both directions by the client's rules: a version declared only in the sidecar, or aversionSchemeother than the one the client derives, is an error. The client rejects the whole sidecar in both cases, which downgrades the listing tolisting-only.category,tags,requiredClientVersion,riskLevel,skillType,compatibleAgentsandprovenance.contentare now compared both ways too, for skill pointers, built-in skills and Agents. Clients do not read Team sidecars, so Team rules are unchanged.The differential run also found
video-use: its sidecar declared askillTypeno pointer can declare, so the client always rejected it while the validator reported 0 errors. This PR removes the field. The listing was alreadylisting-only, so its installability does not change.验证 / Validation
修条目前,校验器只报
reverse-engineer-anything(2 条skill-entry-schema),其余条目没有新增错误。修复后validate_catalog_metadata.py --require-complete:0 errors,publishableSkills=145。用客户端
validateMarketSkillEntry/Agent/Team扫描全部指针(技能 104、Agent 7、团队 2):修复前丢 1 个,修复后 0 个。差分验证:对同一份目录施加 43 类变异,真实
MarketSync与校验器的判定全部一致(第一个提交之后仍有 16 类不一致,由第二个提交补齐)。未变异的本分支:索引 145 技能、9 Agent、2 团队,0 个 sidecar 被拒。独立实例冷启动(伪 HOME、出站守卫、拦截 git 网络命令):当前
dev种子列表 144、详情not found;本分支种子列表 145,详情返回installable、可获取,日志不再有校验失败。test_validate_catalog_metadata.py(62 例,新增用例先确认失败)、test_collection_generator.py、test_check_upstream_health.py、test_validate_i18n.py、validate-i18n.py(0 errors)、translate.py --check通过。主仓
market-i18n-real-repo.test.ts指向本分支:22/22 通过,日志不再有校验失败。未运行: 私有敏感词零结果扫描,本机没有清单。已人工自查差异、提交信息、分支名和本文,只含公开上游信息与通用描述。
Before the listing fix, the validator reported only
reverse-engineer-anything(twoskill-entry-schemaerrors) and no new error elsewhere. After it,validate_catalog_metadata.py --require-completereports 0 errors withpublishableSkills=145.Scanning every pointer (104 skills, 7 Agents, 2 Teams) with the client's
validateMarketSkillEntry/Agent/Team: one dropped before, none after.Differential run: 43 mutation classes applied to one catalog, with full agreement between the real
MarketSyncand the validator (16 classes still disagreed after the first commit; the second closes them). This branch unmutated indexes 145 skills, 9 Agents and 2 Teams with 0 sidecars rejected.Cold start of an isolated instance (fake HOME, egress guard, git network commands blocked): the current
devseed lists 144 and detail returnsnot found; a seed from this branch lists 145, and detail returns the listing asinstallableand acquirable, with the validation-failure log line gone.test_validate_catalog_metadata.py(62 tests, with the new cases first confirmed failing),test_collection_generator.py,test_check_upstream_health.py,test_validate_i18n.py,validate-i18n.py(0 errors) andtranslate.py --checkpass.The client's
market-i18n-real-repo.test.tsagainst this branch: 22/22 pass, and the validation-failure log line is gone.Not run: the private sensitive-token scan, as the list is not available here. The diff, commit message, branch name and this text were reviewed by hand and contain only public upstream facts and generic descriptions.
合并后在主仓同步
market.zip。market.zipis synced in the client repository after this merges.