semver-gate
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
semver-gate
Catch breaking Python AST shifts, PEP 562 lazy-import gaps, __slots__ mock breaks, C-ABI drops, and leaked .whl files before PyPI publish.
Minor Python releases often break callers silently through reordered arguments, removed __getattr__ loaders, missing py.typed markers, or leaked .env files inside wheels. semver-gate combines a zero-dependency Python AST and archive auditor with a #![forbid(unsafe_code)] Rust scanner (semver-gate-rs). It also includes a 7-Law Release FSM, a Classic TDD witness emitter, and an 8-tool Stdio MCP server.
Before and After
RAW DIFF (BLOCKED · SG_PARAM_REMOVED + SG_SLOTS_NO_DICT + SG_PEP561_MISSING):
- def fetch(url: str, timeout: int = 10) -> str --> def fetch(url: str) -> str
- class Client added __slots__ = ("timeout",) without "__dict__"
- wheel omits py.typed markerVERIFIED RELEASE (PASS · knot="sg-..." · 7/7 Release FSM Laws):
- Added optional keyword-only parameters with defaults (SG_SAFE_ADDITION)
- Kept "__dict__" inside __slots__ or class-level patch parity
- Included py.typed and verified zero zip-slip or secret leaksRelated MCP server: diff-sentinel
Six Audited Contract Surfaces
# | Contract Surface | Detected Regressions |
1 | AST Signatures | Removed functions/methods, removed or reordered parameters, sync/async flips, default changes. |
2 | PEP 562 & | Removed |
3 | Exception MRO | Narrowed base classes on |
4 | Wheel & Sdist Security | Zip-slip |
5 | PEP 561 & Packaging | Missing |
6 | Rust / C-ABI | Removed |
Architecture
flowchart LR
SRC["Base vs Target Python / Rust / Wheel"] --> AST["AST & In-Memory Archive Auditor"]
SRC --> RUST["semver-gate-rs (Pure Safe Rust)"]
AST --> FSM["7-Law Release FSM + SHA-256 Receipt"]
RUST --> FSM
FSM --> WIT["Classic TDD Pytest Witness Emitter"]Installation
pip install "git+https://github.com/skupriienko/semver-gate.git"For local development with the Pure Safe Rust scanner:
git clone https://github.com/skupriienko/semver-gate.git
cd semver-gate
cargo build --release --manifest-path rust/Cargo.toml
pip install -e ".[dev]"Quickstart
from semver_gate import audit_source_pair, evaluate_release_fsm, generate_tdd_witness
base = {"pkg/api.py": "def fetch(url: str, timeout: int = 10) -> str:\n return url\n"}
target = {"pkg/api.py": "def fetch(url: str) -> str:\n return url\n"}
report = audit_source_pair(base, target)
fsm = evaluate_release_fsm(report, version_bump="minor")
print("Passed:", report.passed, "FSM:", fsm["verdict"])
print(generate_tdd_witness(report))CLI Commands
semver-gate diff ./base_src ./target_src --json
semver-gate wheel ./dist/mypkg-1.0.0-py3-none-any.whl --json
semver-gate abi ./rust/src/lib.rs
semver-gate witness ./base_src ./target_src
semver-gate benchmarkMCP Server Setup
Register semver-gate as a Stdio JSON-RPC 2.0 server (8 tools, <= 8,000 char output):
{
"mcpServers": {
"semver-gate": {
"command": "semver-gate",
"args": ["mcp"]
}
}
}Tools: semver_diff, semver_wheel, semver_abi, semver_witness, semver_fsm, semver_chain, semver_laws, semver_benchmark.
When NOT to Use
Do not use
semver-gateto run full downstream integration test suites; runpytestin a clean environment for behavioral runtime coverage.Do not use
semver-gatefor non-Python, non-Rust binary.sosymbol tables whennmorobjdumpis needed.
Testing
cargo test --manifest-path rust/Cargo.toml
pytest -q -W errorSee docs/ARCHITECTURE_AND_RATIONALE.md for the 5-layer engineering rationale.
License
MIT License. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
30+ deterministic dev and delivery tools: linting, metrics, diagrams, model advice, AI-text checks.
Checks AI-written code for leaked keys and made-up packages, on your machine. Never uploads code.
Governance copilot for AI-assisted coding. 72 packs, 532 rules, proof bundles.
Security tools for AI agents: scan MCP servers, validate HDP delegation chains, audit releases.
Related MCP Servers
- AlicenseAqualityBmaintenanceEvidence-backed, read-only codebase diagnostics for coding agents: secrets, dependency, RLS, and source-impact audits with a verify loop and PR review verdicts. Never writes files or uses the network by default.7122 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to audit git diffs, scan for leaked secrets and unsafe APIs, detect breaking changes, triage issues, generate changelogs, and assess repository hygiene through native stdio JSON-RPC tools.7Apache 2.0
- AlicenseNot gradedqualityBmaintenanceExposes thirty callable tools that let any MCP client audit server manifests, detect poisoned tool descriptions, config files and long-term memory, catch tool rug-pulls, check known vulnerabilities and package authenticity, and statically screen tool code for SSRF, path traversal and command injection risk. It also simulates whether a proposed agent action should auto-approve or be held for human review.MIT
- AlicenseNot gradedqualityCmaintenanceProvides six MCP tools for AI-reliability work: grading LLM stacks from call logs, verifying source compilation, watching GitHub release drift, dry-running browser plans, auditing Actions workflows for fail-open settings, and gating drafts on human approval.MIT