Repository avatar
AI Tools
v0.1.1
active

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:

  1. before you publish — does the manifest agree with the changelog, the tags, and the artifacts? (release group, L1–L6)
  2. before you trust the docs — do the README's claims still match the repo and the registry? (drift group, R1/R4/R5/R6/R8/R9/R10)
  3. after you deploy — is the live site actually the thing you shipped, with the headers you promised? (deploy group, D1–D5)

Zero dependencies. Node >= 18. Every row carries machine-verifiable evidence; nothing is scored, ranked, or fuzzed.

The checks

IDCheckSecond truth source
L1package.json version matches the CHANGELOG head entryCHANGELOG.md
L2the head entry is dated today or earliersystem date
L3the current version has a matching git tag (v-prefixed or bare)local git tag
L4the worktree has no uncommitted changesgit status --porcelain
L5the declared bin prints the manifest version on --versionrunning it
L6the files allowlist covers every declared entry pointpackage.json itself
R4files referenced by the docs existthe repo tree
R8no machine-specific paths leaked into docs (Windows profile dirs, POSIX home dirs)pattern set
R9no release-tense phrases in the docsthe docs (UNVERIFIED — a human confirms)
R1pinned install commands / release-tag links match the manifestpackage.json version
R6truth sources exist (readme, machine-readable manifest)the repo
R5a/bpackage name and GitHub owner links match the repo sluggit remote or .release-gate.json
R10pinned install commands for THIS package match the registry's latest tagnpm registry (network)
D1the deployed URL responds within the timeoutHTTP status
D2the page carries the configured version tokenresponse body
D3expected security headers are present (CSP, HSTS, XCTO, Referrer-Policy, XFO, Permissions-Policy)response headers
D4indexability matches the expectation (noindex both ways)meta tag, X-Robots-Tag, robots.txt
D5a 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.

KeyDefaultMeaning
packageDir"."where the manifest lives
changelog"CHANGELOG.md"changelog path
binSmoketruerun the declared bin with --version
gittruegit-backed checks (auto-SKIP outside a repo)
offlinefalseforce network checks into SKIP
drift.files["README.md"]docs the drift group scans
registry.enabledtrueR10 registry lookup
deploy.urlnullenables the deploy group
deploy.versionTokennullstring that must appear in the page body
deploy.securityHeaderstruetrue = all six headers, or an array of names
deploy.indexabletrueexpect the site to be indexable
deploy.retiredfalseretirement mode: D5 double-404 verdict
deploy.apiPathnullAPI path used by the retirement verdict
deploy.timeoutMs15000hard 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.
  • deploy fetches only the URLs you configure (plus /robots.txt when 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
NPM
@leeruu/release-gate
Install Command
npm install @leeruu/release-gate