
release-gate
io.github.MmUu001/release-gate
Pre-release and post-deploy gate: PASS/FAIL table with evidence for every row. Zero dependencies.
Documentation
release-gate
One command, one PASS/FAIL table, evidence for every row.
release-gate verifies the three moments where releases actually break:
- before you publish — does the manifest agree with the changelog, the tags, and the artifacts? (
releasegroup, L1–L6) - before you trust the docs — do the README's claims still match the repo and the registry? (
driftgroup, R1/R4/R5/R6/R8/R9/R10) - after you deploy — is the live site actually the thing you shipped, with the headers you promised? (
deploygroup, D1–D5)
Zero dependencies. Node >= 18. Every row carries machine-verifiable evidence; nothing is scored, ranked, or fuzzed.
The checks
| ID | Check | Second truth source |
|---|---|---|
| L1 | package.json version matches the CHANGELOG head entry | CHANGELOG.md |
| L2 | the head entry is dated today or earlier | system date |
| L3 | the current version has a matching git tag (v-prefixed or bare) | local git tag |
| L4 | the worktree has no uncommitted changes | git status --porcelain |
| L5 | the declared bin prints the manifest version on --version | running it |
| L6 | the files allowlist covers every declared entry point | package.json itself |
| R4 | files referenced by the docs exist | the repo tree |
| R8 | no machine-specific paths leaked into docs (Windows profile dirs, POSIX home dirs) | pattern set |
| R9 | no release-tense phrases in the docs | the docs (UNVERIFIED — a human confirms) |
| R1 | pinned install commands / release-tag links match the manifest | package.json version |
| R6 | truth sources exist (readme, machine-readable manifest) | the repo |
| R5a/b | package name and GitHub owner links match the repo slug | git remote or .release-gate.json |
| R10 | pinned install commands for THIS package match the registry's latest tag | npm registry (network) |
| D1 | the deployed URL responds within the timeout | HTTP status |
| D2 | the page carries the configured version token | response body |
| D3 | expected security headers are present (CSP, HSTS, XCTO, Referrer-Policy, XFO, Permissions-Policy) | response headers |
| D4 | indexability matches the expectation (noindex both ways) | meta tag, X-Robots-Tag, robots.txt |
| D5 | a retired site serves 404/410 on root AND api path (both, never just one) | two independent requests |
Statuses are exactly four: PASS, FAIL, SKIP (structural gap, with a reason),
UNVERIFIED (truth source unreachable — e.g. registry or site down; never a
false alarm). R9 markers and R4/gitignored-with-instructions findings are
UNVERIFIED because they need a human; everything else that fails is a real
mismatch. There are no scores.
Install
npm i -g @leeruu/release-gate # or: npx @leeruu/release-gate <repo-dir>
release-gate init # write release-gate.config.json (never overwrites)
release-gate check # run everything implemented, print the table
Usage
release-gate check [dir]
release-gate check [dir] --only=release|drift|deploy
release-gate check [dir] --json
release-gate check [dir] --offline # network checks report SKIP, not failures
release-gate check [dir] --strict # SKIP/UNVERIFIED rows also fail the gate (CI semantics)
Exit codes: 0 no FAIL, 1 at least one FAIL (--strict: any SKIP/UNVERIFIED too), 2 configuration error.
Configuration
release-gate.config.json (written by init). A guessed field is worse than a
missing one: unknown keys are a config error (exit 2), not a warning.
| Key | Default | Meaning |
|---|---|---|
packageDir | "." | where the manifest lives |
changelog | "CHANGELOG.md" | changelog path |
binSmoke | true | run the declared bin with --version |
git | true | git-backed checks (auto-SKIP outside a repo) |
offline | false | force network checks into SKIP |
drift.files | ["README.md"] | docs the drift group scans |
registry.enabled | true | R10 registry lookup |
deploy.url | null | enables the deploy group |
deploy.versionToken | null | string that must appear in the page body |
deploy.securityHeaders | true | true = all six headers, or an array of names |
deploy.indexable | true | expect the site to be indexable |
deploy.retired | false | retirement mode: D5 double-404 verdict |
deploy.apiPath | null | API path used by the retirement verdict |
deploy.timeoutMs | 15000 | hard fetch timeout |
MCP server
Same checks exposed over the Model Context Protocol (stdio, newline-delimited JSON-RPC):
{
"mcpServers": {
"release-gate": {
"command": "node",
"args": ["/path/to/release-gate/mcp/release-gate-mcp.mjs"]
}
}
}
Tools: release_gate_check { repoDir?, only? } and release_gate_init { repoDir? }.
A gate FAIL is a normal tool result (rows included), not a protocol error.
What this does not do
- It does not publish, deploy, or roll back anything. It verifies; you act.
- It does not score or rank. Four statuses, no numbers.
- It does not intercept agent behavior — that is a policy gateway's job.
deployfetches only the URLs you configure (plus/robots.txtwhen indexable). It never walks the site.- Network-unreachable checks report
UNVERIFIED, never FAIL. A gate that blocks on your own flaky network is a gate that gets disabled.
Development
npm test # unit (83) + golden snapshot over 16 fixtures + E2E
node tools/gen-fixtures.mjs --force # regenerate the synthetic fixture set
node tools/pack.mjs # dist/release-gate-<version>.zip + unpack smoke check
Fixtures are entirely synthetic; the deploy-group E2E talks to loopback servers on 127.0.0.1 only. No real repository and no real site is touched by the test suite. The registry path (R10) has been live-verified against the public npm registry (stale pin -> FAIL, fresh pin -> PASS).
Layout
bin/release-gate.mjs CLI: init / check
mcp/release-gate-mcp.mjs MCP stdio server (zero-dep JSON-RPC)
checks/release.js L1-L6
checks/drift.js R1/R4/R5/R6/R8/R9/R10
checks/deploy.js D1-D5
shared/ config (strict schema), findings, render
tests/unit.mjs 83 assertions, git/bin/http/registry all injected
tests/verify.mjs golden snapshot + CLI/MCP real-process E2E
tests/golden.json pinned [id, status] sequences for 16 fixtures
tools/pack.mjs dist zip + unpack smoke check
@leeruu/release-gatenpm install @leeruu/release-gate