fix(mcp): wire sema_pull + flip sema_mint to opt-out (0.2.2)#33
Closed
hwesterb wants to merge 4 commits intochore/0.2.1-post-release-cleanupfrom
Closed
fix(mcp): wire sema_pull + flip sema_mint to opt-out (0.2.2)#33hwesterb wants to merge 4 commits intochore/0.2.1-post-release-cleanupfrom
hwesterb wants to merge 4 commits intochore/0.2.1-post-release-cleanupfrom
Conversation
0.2.0's CHANGELOG, SKILL, and tests all claimed `sema_pull` was an MCP tool and `sema_mint` was exposed by default, but the server module still only registered `sema_mint` behind `SEMA_ALLOW_MINT=true` and had no `sema_pull` at all. This release lands the code that matches the claims. - Add `_sema_pull` MCP tool (wrapper over `cli.main.update_db`), exposed by default. Hide with `SEMA_DISABLE_PULL=true`. - Flip `_sema_mint` registration: exposed by default. Hide with `SEMA_DISABLE_MINT=true`. The old `SEMA_ALLOW_MINT` gate is removed entirely (no legacy honour). - Refactor `update_db()` to return a structured dict instead of a bare bool. CLI callers read `result["success"]` for the exit code; the MCP tool serializes the whole dict. Stats include `added`, `updated`, `skipped`, `cascaded_user`, `superseded_removed`, `superseded_kept_orphan`, `upstream_removed`, `vocabulary_root_before`, `vocabulary_root_after`, and `dry_run`/`error` when applicable. - Register `src/sema/mcp/tests/` in `pytest` testpaths so the 6 tests for pull / mint registration + structured output now run in the default suite (all passing). - Drop the stale "legacy SEMA_ALLOW_MINT" mention from SKILL and the old conditional-registration test class that asserted the opt-in behaviour. 237/237 pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Add header referencing Keep a Changelog and SemVer specs. - Add `[Unreleased]` section at the top (per-spec accumulator for the next release). - Use standard `### Added / ### Changed / ### Removed` subsections in the 0.2.1 and 0.2.2 entries. - Normalize release headers to `## [X.Y.Z] - YYYY-MM-DD` (ISO 8601 date, hyphen separator). Fix the stale `[Unreleased] — 0.2.0 — …` header on the 0.2.0 section — it shipped, it's no longer unreleased. The 0.2.0 body is left as-is (already shipped); only its header was touched. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tomatically Release-surface files drift silently: the MCP Registry entry in server.json was still on 0.1.4 even though PyPI had shipped 0.2.0, and the description claimed 453 patterns when the DB had 452. We've been catching these by hand, one file at a time, every release — easy to forget one. - `scripts/sync_release_metadata.py` — single source of truth is `pyproject.toml` (version) and `data/taxonomy.db` (pattern count). Fixes drift in `.claude-plugin/plugin.json` and `server.json` in place. Idempotent. `--check` mode exits 1 on drift for CI. - Wired into `.pre-commit-config.yaml` as the `sync-release-metadata` hook. Fires when `pyproject.toml`, `data/taxonomy.db`, `.claude-plugin/plugin.json`, or `server.json` is staged, auto-fixes drift, and re-stages the corrected files so the commit goes through clean. Now we literally can't forget. - Ran it once as part of this commit: `server.json` 0.1.4 → 0.2.2, pattern count 453 → 452 in the description. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Runs from main, single command, gated by pre-flight checks and confirmation prompts. Wraps the four manual steps we've been doing by hand after each version-bump merge: 1. git tag vX.Y.Z + push 2. gh release create (triggers publish.yml → PyPI via trusted publish) 3. mcp-publisher publish server.json (MCP Registry) 4. print verification URLs Version comes from pyproject.toml (single source of truth). Release notes body is auto-extracted from the matching CHANGELOG.md section. Supports --dry-run for a preview and --yes for non-interactive use. CONTRIBUTING.md gets a new "Cutting a release" section so the flow is discoverable without reading the script. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
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
0.2.0's CHANGELOG, SKILL, and test file all claimed
sema_pullwas exposed as an MCP tool andsema_mintwas on by default, but the server module had neither —sema_mintwas still behindSEMA_ALLOW_MINT=true, and there was nosema_pullimplementation at all. This PR lands the code that matches the claims.What changed
_sema_pullMCP tool — thin wrapper overcli.main.update_db. Returns structured JSON (success,added,updated,skipped,cascaded_user,superseded_removed,superseded_kept_orphan,upstream_removed,vocabulary_root_before,vocabulary_root_after, plusdry_run/errorwhen applicable) so callers act on outcomes programmatically instead of parsing the human log. Exposed by default; hide withSEMA_DISABLE_PULL=true._sema_mintflipped to opt-out. Exposed by default; hide withSEMA_DISABLE_MINT=true. The oldSEMA_ALLOW_MINT=truegate is gone — no legacy honour.update_db()now returns a dict instead of a bare bool. CLI callers readresult["success"]; MCP serializes the whole thing.src/sema/mcp/tests/is now inpytesttestpaths. The 6 tests for pull / mint registration and structured output now run in the default suite.test_mint_tool.py.Test plan
pytest— 237/237 pass (was 6 failures before this PR)ruff+ruff-formatcleanchangelog-gatepasses (CHANGELOG updated alongside version bump)sema_pullappears in MCP tool listings in a fresh client sessionNotes
chore/0.2.1-post-release-cleanup(chore: 0.2.1 post-release plumbing #32). GitHub will retarget tomainautomatically when that merges.🤖 Generated with Claude Code