Skip to content

v0.0.53: the audit as a CI gate

Choose a tag to compare

@bsbodden bsbodden released this 02 Nov 19:48
· 49 commits to main since this release

v0.0.53: the audit as a CI gate

One rule syntax for the gate, in the CLI, in a config file and in the GitHub Action, with baselines so an existing site can adopt it without first fixing every old finding, SARIF and JUnit output, build-directory audits and protected previews.

One rule syntax. --fail-on takes rules: error, warning or notice fails on any issue at or above that severity; score<80 on the overall score; score:aiReadiness<70 on a category (crawlability, indexability, onPage, content, links, performance, security, aiReadiness, social, localSeo, accessibility). Rules combine, comma-separated or with the flag repeated. --min-score 80 is the same as score<80 and still works. The exit codes have not changed: 0 completed, 1 a gate tripped, 2 bad invocation or an invalid config or baseline file, 3 no real audit (unreachable site, error status).

Baselines. Save a report once and commit it; the severity rule then counts only findings that are not in it. Old findings stay listed but do not fail the build until you fix them. Score rules stay absolute.

rankcli audit -o json > .rankcli/baseline.json      # once; commit the file
rankcli audit --fail-on error --baseline .rankcli/baseline.json

A finding is identified by its code and the page's path. The console and the JSON report list what is new since the baseline, what was fixed and what stayed. rankcli diff before.json after.json compares any two saved reports, with --fail-on and -o json.

SARIF and JUnit. -o sarif writes SARIF 2.1.0 for GitHub Code Scanning (github/codeql-action/upload-sarif) and other SARIF readers: one rule per code, one result per page, baselineState when a baseline is given, file locations with --dir. -o junit writes JUnit XML for test reporters. Every machine format is one document on stdout, on failure too.

Audit the build before deploying. rankcli audit --dir dist --url https://example.com --fail-on error serves the directory locally the way a static host would and audits it as the named site, so canonical and sitemap checks compare against the real origin. Host checks (TLS, security and caching headers, redirects, crawler access, canonical domain) are skipped. With -o sarif, findings point at the files.

Protected previews. --header "Name: value" and --cookie "name=value", both repeatable, go with every request to the audited site and to no other host.

Project config. rankcli.config.json (rankcli init writes it with the url) now carries the CI settings, read the same way by audit and the Action: maxPages, checkLinks, failOn, minScore, budgets (minimum category scores), baseline, ignore (by code, by page glob, or both, with a reason; ignored findings are counted and listed, never dropped silently), headers (values may use ${ENV_VAR}) and dir. Flags win over the file. An invalid file is exit 2, never ignored. --config <file> names another file.

Page discovery. The sitemap seeds the page list and homepage links fill the rest (default 5 pages); the JSON report says where each page came from (discovery) and adds ignored, baseline and gate.

The GitHub Action, v1.2.0 (integrallis/rankcli-action@v1), takes the same rules in fail-on, plus baseline, config, dir, max-pages (default 5), headers, report-file and annotations (findings annotated on the run, with file locations when dir is used). comment-on-pr is now regressions (the default: only when the gate fails or there are new findings against the baseline), always or never; the Action keeps one comment and updates it in place. New outputs: new-issues-count, fixed-issues-count, report-file. fail-on-error, fail-on-errors and score-threshold keep working. rankcli setup --github-action --url https://yoursite.com [--sync] writes a workflow that uses the Action.

Packages: @rankcli/cli 0.0.53, @rankcli/agent-runtime 0.0.41 (the gate, baselines, SARIF, JUnit, the config loader and auditSite() live in the engine), @rankcli/mcp-server 0.0.26 (the same engine).

Install

npm install -g @rankcli/cli    # or: brew install integrallis/tap/rankcli

Standalone binaries for macOS, Linux and Windows and the Claude Desktop extension (.mcpb) are attached below.