descrip length check and fix

This commit is contained in:
jason
2026-06-23 07:18:23 -05:00
parent d34fbf7626
commit 5529771ec8
5 changed files with 20 additions and 2 deletions
+10 -1
View File
@@ -41,6 +41,8 @@ EXCLUDE_DIRS = {"__pycache__", ".git"}
EXCLUDE_NAMES = {".DS_Store"} EXCLUDE_NAMES = {".DS_Store"}
EXCLUDE_SUFFIXES = {".pyc", ".pyo"} EXCLUDE_SUFFIXES = {".pyc", ".pyo"}
FIXED_DATE = (2026, 1, 1, 0, 0, 0) # stable timestamp for reproducible archives FIXED_DATE = (2026, 1, 1, 0, 0, 0) # stable timestamp for reproducible archives
MAX_DESCRIPTION = 500 # plugin-marketplace cap: plugin.json "description" must be UNDER this
# (it has silently regressed past the limit before — fail the build now)
_KEY_RE = re.compile(r'(DEFAULT_KEY\s*=\s*")([0-9a-fA-F]{16,})(")') _KEY_RE = re.compile(r'(DEFAULT_KEY\s*=\s*")([0-9a-fA-F]{16,})(")')
@@ -102,7 +104,14 @@ def main(argv: list[str] | None = None) -> int:
return 1 return 1
manifest_path = SRC / ".claude-plugin" / "plugin.json" manifest_path = SRC / ".claude-plugin" / "plugin.json"
version = json.loads(manifest_path.read_text(encoding="utf-8"))["version"] manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
version = manifest["version"]
desc = manifest.get("description", "")
if len(desc) >= MAX_DESCRIPTION:
print(f"build: plugin description is {len(desc)} chars — must be under "
f"{MAX_DESCRIPTION} (marketplace cap). Trim \"description\" in {MANIFEST}.",
file=sys.stderr)
return 1
files = included_files() files = included_files()
arcnames = {p.relative_to(SRC).as_posix() for p in files} arcnames = {p.relative_to(SRC).as_posix() for p in files}
if MANIFEST not in arcnames: if MANIFEST not in arcnames:
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
{ {
"name": "echo-memory", "name": "echo-memory",
"version": "1.2.0", "version": "1.2.0",
"description": "Persistent memory via the ECHO Obsidian vault over the Obsidian Local REST API. Cross-platform Python client (connection-pooled, with concurrent full-vault reads): one-call capture/resolve/recall/link over an entity index, hybrid BM25 + graph recall, auto-linking, an offline write-ahead queue + read cache, lock-guarded concurrency, and session-reflection capture, plus a linter-enforced routing manifest and /echo-load|save|recall|triage|health|sweep|reflect|doctor commands. Crosslinks notes across Claude/CoWork sessions.", "description": "Persistent memory via the ECHO Obsidian vault over the Obsidian Local REST API. A cross-platform, connection-pooled Python client: one-call capture/resolve/recall/link over an entity index, hybrid BM25 + graph recall, auto-linking, an offline write-ahead queue, and lock-guarded concurrency. Linter-enforced routing manifest plus /echo-load|save|recall|triage|health|sweep|reflect|doctor commands. Crosslinks notes across Claude and CoWork sessions.",
"author": { "author": {
"name": "Jason" "name": "Jason"
}, },
@@ -61,6 +61,15 @@ def test_read_many_tolerates_unreadable_file_as_none() -> None:
echo.get_text = orig echo.get_text = orig
def test_plugin_description_under_500_chars() -> None:
# Marketplace cap — the description has silently regressed past it before (a 525-char
# relapse + an earlier "fix description length" commit). build.py fails the build on this;
# this guards it in CI so it's caught before packaging.
manifest = Path(__file__).resolve().parents[3] / ".claude-plugin" / "plugin.json"
desc = json.loads(manifest.read_text(encoding="utf-8")).get("description", "")
assert 0 < len(desc) < 500, f"plugin description is {len(desc)} chars (must be under 500)"
def test_stem_extracts_literal_directory_prefix() -> None: def test_stem_extracts_literal_directory_prefix() -> None:
assert check_routing.stem(r"^projects/active/[^/]+\.md$") == "projects/active/" assert check_routing.stem(r"^projects/active/[^/]+\.md$") == "projects/active/"
assert check_routing.stem(r"^areas/(business|personal)/[^/]+\.md$") == "areas/" assert check_routing.stem(r"^areas/(business|personal)/[^/]+\.md$") == "areas/"