fix(marketplace): validate server.json schema, not just version - #427
Conversation
Addresses a general-principle gap the neighboring session's 422 exposed. Verified, not assumed, before writing anything: - server.json AT TAG v4.17.2 (curl raw.githubusercontent.com/cdeust/ Cortex/v4.17.2/server.json, JSON-parsed, len() on the actual field) is 95 chars — already compliant. The tag is NOT blocked; the earlier claim that it carries a 113-char description was checked against the primary source and found wrong (that value exists only on `main`, in a commit 159b432/#349 that landed AFTER v4.17.2 was tagged and was never in any tag). PENDING_REGISTRY's "resolves on the next tag" NOTICE was already accurate. - The 100-char limit itself: fetched https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json directly, read definitions.ServerDetail.properties.description -> maxLength: 100, minLength: 1 (also required at the top level). Not copied from the neighboring session's report. General fix: check_marketplace_pins.py validated server.json's VERSION against the registry but never its SCHEMA — a file with the exactly right version can still 422 at publish time over an unrelated field. New check_server_json_schema (offline, no network) validates description length against the schema-derived bounds above, wired into check_registry_surface so it runs whenever server.json exists (not gated on having a registry `name`, unlike the version check — a schema violation matters independent of whether this repo publishes to the registry). New failure classes: SERVER_JSON_DESCRIPTION_TOO_LONG, SERVER_JSON_DESCRIPTION_TOO_SHORT. This closes the general case, not just the one incident: it checks whatever server.json is on the ref this gate runs against (PR branch or main) — the tree a FUTURE tag will be cut from, which is the only tree an offline pre-tag check can affect. An already-tagged historical commit is immutable regardless of what any check finds now. 9 new tests including a direct replay of the neighboring incident's 144-char description (asserts SERVER_JSON_DESCRIPTION_TOO_LONG fires) and a non-fixture assertion against this repo's own real, committed server.json. tests_py/scripts/ 778 passed (was 771), 5 skipped. check_marketplace_pins.py exits 0 live; check_craftsmanship.py --base origin/main clean; ruff/pyright clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
ZETETIC-REVIEW: APPROVE RésuméLe fix est réel et correctement sourcé. J'ai refetché le schéma canonique en direct, rejoué l'incident historique contre le vrai fichier de v0.9.1, vérifié la longueur réelle de Move 0 — Ledger reconciliation et seen-defect check
Stakes (Move 7)Medium — script de tooling CI qui gate les releases (pin-verification gate), pas de code auth/billing/crypto, pas de migration DB, PR de 138 lignes nettes, fichier 1. Les bornes sont-elles sourcées et exactes — et pourquoi seulement
|
Context
#419 (this repo's marketplace-pin-gate hardening) was merged by the maintainer at
db082acdwhile I was still addressing a follow-up review comment — a general-principle gap the neighboringai-architect-mcp-codebasesession's live registry 422 exposed. That last commit (a783f3d2) never made it into the merge; this PR carries it forward, cherry-picked cleanly onto currentmain, since #419 is now closed/merged and cannot take more commits.What this closes
check_marketplace_pins.pyvalidated server.json's version against the registry but never its schema — a file with the exactly-correct version can still 422 at publish time over an unrelated field (this is exactly what happened toai-architect-mcp-codebasev0.9.1: a 144-char description against the registry's 100-char cap).Verified, not assumed, before writing anything:
curl raw.githubusercontent.com/cdeust/Cortex/v4.17.2/server.json, JSON-parsed,len()on the actual field) is 95 chars — already compliant. The claim relayed to me that the tag carries a 113-char description was checked against the primary source and found wrong: that value exists only onmain, in a commit (159b432d/docs: present Cortex as a cross-platform memory MCP #349) that landed after v4.17.2 was tagged and was never in any tag. The existingPENDING_REGISTRYNOTICE ("resolves on the next tag") was already accurate.https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.jsondirectly, readdefinitions.ServerDetail.properties.description→maxLength: 100,minLength: 1(both fields alsorequiredat the top level). Not copied from a report of it.Fix
New
check_server_json_schema(offline, no network) validates description length against the schema-derived bounds above, wired intocheck_registry_surfaceso it runs wheneverserver.jsonexists — not gated on having a registryname, unlike the version check, since a schema violation matters independent of whether a repo publishes to the registry. New failure classes:SERVER_JSON_DESCRIPTION_TOO_LONG,SERVER_JSON_DESCRIPTION_TOO_SHORT.This closes the general case, not just the one incident: it checks whatever
server.jsonis on the ref this gate runs against (PR branch ormain) — the tree a future tag will be cut from, which is the only tree an offline pre-tag check can affect. An already-tagged historical commit is immutable regardless of what any check finds now.Test plan
SERVER_JSON_DESCRIPTION_TOO_LONGfires) and a non-fixture assertion against this repo's own real, committedserver.json.tests_py/scripts/— 787 passed, 5 skipped (full suite, this branch).python3 scripts/check_marketplace_pins.pyexits 0 live.check_craftsmanship.py --base origin/mainclean.ruff check/ruff format --checkclean repo-wide.pyright0 diagnostics on every touched file.Generated with Claude Code
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com