From a580682383c9f77d6b5bb64e083eeedcc6fb4929 Mon Sep 17 00:00:00 2001 From: wangshun <96341168+xixi-box@users.noreply.github.com> Date: Fri, 4 Dec 2026 03:22:59 +0000 Subject: [PATCH] Add Checkwright to the community extension catalog Assisted-by: OpenCode (model: opencode-go/deepseek-v4.1-flash, autonomous) Signed-off-by: wangshun <96341168+xixi-box@users.noreply.github.com> --- extensions/catalog.community.json | 41 +++++++++- .../test_community_extension_catalog.py | 75 +++++++++++++++++++ 2 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 tests/contract/test_community_extension_catalog.py diff --git a/extensions/catalog.community.json b/extensions/catalog.community.json index 7e65c41d02..88a7c9ec86 100644 --- a/extensions/catalog.community.json +++ b/extensions/catalog.community.json @@ -1,6 +1,6 @@ { "schema_version": "1.0", - "updated_at": "2026-12-03T00:00:00Z", + "updated_at": "2026-12-04T00:00:00Z", "catalog_url": "https://raw.githubusercontent.com/github/spec-kit/main/extensions/catalog.community.json", "extensions": { "ado": { @@ -1510,6 +1510,45 @@ "created_at": "2026-03-22T00:00:00Z", "updated_at": "2026-03-22T00:00:00Z" }, + "checkwright": { + "name": "Checkwright", + "id": "checkwright", + "description": "Deterministic gates over your specs and code: broken links, dangling citations, unclosed fences, missing scripts and ticked tasks naming absent files fail CI; a pre-commit hook catches them early.", + "author": "Checkwright", + "version": "0.67.0", + "download_url": "https://github.com/checkwright/checkwright/releases/download/v0.67.0/checkwright-companion-0.67.0.zip", + "sha256": "fb8bda605cfdb2f5ff9937b0023af74ea80c64b823261fb303c094bb9aade68f", + "repository": "https://github.com/checkwright/checkwright", + "homepage": "https://checkwright.dev", + "documentation": "https://checkwright.dev/speckit.html", + "changelog": "https://github.com/checkwright/checkwright/releases/tag/v0.67.0", + "license": "Apache-2.0", + "category": "process", + "effect": "read-write", + "requires": { + "speckit_version": ">=1.4.5", + "tools": [ + { + "name": "git", + "required": true + } + ] + }, + "provides": { + "commands": 2, + "hooks": 1 + }, + "tags": [ + "quality", + "gates", + "docs" + ], + "verified": false, + "downloads": 0, + "stars": 0, + "created_at": "2026-12-04T00:00:00Z", + "updated_at": "2026-12-04T00:00:00Z" + }, "cleanup": { "name": "Cleanup Extension", "id": "cleanup", diff --git a/tests/contract/test_community_extension_catalog.py b/tests/contract/test_community_extension_catalog.py new file mode 100644 index 0000000000..e910ee4089 --- /dev/null +++ b/tests/contract/test_community_extension_catalog.py @@ -0,0 +1,75 @@ +"""Contract coverage for entries in the community extension catalog. + +The community catalog is consumed by ``specify extension add`` (via +``ExtensionCatalog``) and by the generated documentation. These tests load the +repository catalog through those real consumers so a missing or malformed +submission entry fails before release. +""" + +from __future__ import annotations + +import json +from pathlib import Path + +from specify_cli.extensions import CatalogEntry, ExtensionCatalog + +ROOT = Path(__file__).resolve().parents[2] +CATALOG_PATH = ROOT / "extensions" / "catalog.community.json" + + +def _community_payload() -> dict: + return json.loads(CATALOG_PATH.read_text(encoding="utf-8")) + + +def test_checkwright_is_discoverable_from_the_community_catalog(tmp_path, monkeypatch): + """A submitted extension must resolve through the same merged-catalog path + that ``specify extension add`` uses.""" + payload = _community_payload() + catalog = ExtensionCatalog(tmp_path) + source = CatalogEntry( + url=ExtensionCatalog.COMMUNITY_CATALOG_URL, + name="community", + priority=1, + install_allowed=True, + ) + monkeypatch.setattr(catalog, "get_active_catalogs", lambda: [source]) + monkeypatch.setattr( + catalog, + "_fetch_single_catalog", + lambda entry, force_refresh=False: payload, + ) + + info = catalog.get_extension_info("checkwright") + + assert info is not None + assert info["id"] == "checkwright" + assert info["name"] == "Checkwright" + assert info["version"] == "0.67.0" + assert info["download_url"] == ( + "https://github.com/checkwright/checkwright/releases/download/" + "v0.67.0/checkwright-companion-0.67.0.zip" + ) + assert info["sha256"] == ( + "fb8bda605cfdb2f5ff9937b0023af74ea80c64b823261fb303c094bb9aade68f" + ) + assert info["requires"] == { + "speckit_version": ">=1.4.5", + "tools": [{"name": "git", "required": True}], + } + assert info["provides"] == {"commands": 2, "hooks": 1} + assert info["tags"] == ["quality", "gates", "docs"] + + +def test_checkwright_entry_generates_community_documentation(tmp_path): + """The catalog entry must pass the documentation generator's validation.""" + from docs import generate_extensions as generator + + count = generator.generate(CATALOG_PATH, tmp_path) + + assert count == len(_community_payload()["extensions"]) + detail = (tmp_path / "community" / "extensions" / "checkwright.md").read_text( + encoding="utf-8" + ) + assert "Checkwright" in detail + assert "0.67.0" in detail + assert "2 commands, 1 hook" in detail