pqcheck 0.16.33 → 0.17.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -5
- package/bin/pqcheck.js +858 -142
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
[](https://www.npmjs.com/package/pqcheck)
|
|
9
9
|
[](./LICENSE)
|
|
10
10
|
|
|
11
|
-
>
|
|
11
|
+
> **`@latest`: v0.16.32** — Stable; what `npm install pqcheck` resolves to.
|
|
12
|
+
>
|
|
13
|
+
> **`@beta`: v0.17.0-beta.2** — R96 second review sweep (15 fixes) + 3 dogfood features: new **`pqcheck last`** reuses a recent gate verdict (local state or your GitHub Actions CI run) instead of re-scanning; `setup`/`init` remember your domain in `.cipherwake.json` so `deploy-check`/`guard` work with no arguments; the AI guard block gains **flake context** (`flake_hint=first_failure|previously_dismissed|…`) from local check history; internal crashes exit 3 instead of masquerading as a security block. Try with `npm install pqcheck@beta`. A `0.17.0-beta.N` becomes `@latest` only after `scripts/release-gate.sh` is green + a few days of clean dogfood. [Full changelog →](./CHANGELOG.md)
|
|
12
14
|
|
|
13
15
|
## Two ways to use it
|
|
14
16
|
|
|
@@ -93,8 +95,9 @@ Grouped by intent: **deploy gate** (the flagship wedge) → **drift comparison**
|
|
|
93
95
|
| Command | What it gives you |
|
|
94
96
|
|---|---|
|
|
95
97
|
| **Deploy gate — the flagship wedge** | |
|
|
96
|
-
| `npx pqcheck deploy-check <domain> --ai` | **The flagship.** Scans the domain, compares against the previous scan (first run sets the baseline), and emits a `ship_decision=pass\|review\|block` field your AI coding agent parses to decide whether to announce the deploy, ask you, or stop. Works anonymously — no signup needed. |
|
|
97
|
-
| **`npx pqcheck guard --domain <D> -- <cmd>`** | **Deploy guard wrapper.** Wraps any deploy command. Runs `deploy-check` first; conditionally runs `<cmd>` based on `ship_decision`. Modes: `--gate-mode balanced` (default) / `advisory` / `strict`. ONE command instead of two — the strongest single artifact for AI-coder workflows because the AI never has to remember to chain check + deploy. |
|
|
98
|
+
| `npx pqcheck deploy-check <domain> --ai` | **The flagship.** Scans the domain, compares against the previous scan (first run sets the baseline), and emits a `ship_decision=pass\|review\|block` field your AI coding agent parses to decide whether to announce the deploy, ask you, or stop. Works anonymously — no signup needed. In a repo set up with `pqcheck setup`/`init`, `<domain>` is optional — it defaults to the `domain` field in `.cipherwake.json`. |
|
|
99
|
+
| **`npx pqcheck guard --domain <D> -- <cmd>`** | **Deploy guard wrapper.** Wraps any deploy command. Runs `deploy-check` first; conditionally runs `<cmd>` based on `ship_decision`. Modes: `--gate-mode balanced` (default) / `advisory` / `strict`. ONE command instead of two — the strongest single artifact for AI-coder workflows because the AI never has to remember to chain check + deploy. `--domain` is optional in a set-up repo (defaults from `.cipherwake.json`). |
|
|
100
|
+
| **`npx pqcheck last [domain]`** | **Reuse a recent verdict instead of re-scanning.** Reads the local state files; `--remote` reads your repo's latest `cipherwake.yml` GitHub Actions run. Honesty guards: results older than `--max-age` (default 60 min) are never reusable, and a remote pass requires the CI run to match your local HEAD commit exactly. Exit `0` = reuse (skip the duplicate deploy-check), `1`/`2` = trust the review/block, `3` = no reusable signal → run `deploy-check --ai`. Advisory-only. Set `GITHUB_TOKEN` for private repos / higher API limits. |
|
|
98
101
|
| **`--ai` flag** (any of the above) | **AI Coder Mode.** Three-layer output (banner / body / structured `CIPHERWAKE_AI_GUARD_RESULT` block) tuned for Claude Code / Cursor / Aider / Zed. Includes a `ship_decision=pass\|review\|block` field your AI coworker parses to decide whether to announce the deploy, ask you, or revert. See [/methodology/ai-coder-mode](https://cipherwake.io/methodology/ai-coder-mode). |
|
|
99
102
|
| **Drift comparison — what the gate runs on** | |
|
|
100
103
|
| `npx pqcheck trust-diff <domain>` | Compare today's HTTPS surface against a saved baseline (last week / last month / a saved CI baseline). For CI gates and release checklists. |
|
|
@@ -160,7 +163,7 @@ advisory_only=true
|
|
|
160
163
|
END_CIPHERWAKE_AI_GUARD_RESULT
|
|
161
164
|
```
|
|
162
165
|
|
|
163
|
-
The structured block is what your AI coworker (Claude / Cursor / Aider / Zed) parses to decide whether to announce the deploy, ask you, or revert. Exit code in `--ai` mode reflects `ship_decision`: `0` pass · `1` review · `2` block.
|
|
166
|
+
The structured block is what your AI coworker (Claude / Cursor / Aider / Zed) parses to decide whether to announce the deploy, ask you, or revert. Exit code in `--ai` mode reflects `ship_decision`: `0` pass · `1` review · `2` block · `3` error / no signal (the check itself failed — never treated as a security block; the block carries a `top_issue` code like `cli_internal_error` so the agent routes to "rerun or verify manually" instead of silently shipping).
|
|
164
167
|
|
|
165
168
|
---
|
|
166
169
|
|
|
@@ -351,15 +354,38 @@ npx pqcheck --file domains.txt Bulk scan from a newline-separated
|
|
|
351
354
|
- `--days <N>` — History window (default 90)
|
|
352
355
|
- `--json` — Raw JSON output
|
|
353
356
|
|
|
357
|
+
**`pqcheck last`:**
|
|
358
|
+
- `--remote` — Read your repo's latest `cipherwake.yml` GitHub Actions run instead of local state
|
|
359
|
+
- `--max-age <minutes>` — Freshness window; older results are never reusable (default 60)
|
|
360
|
+
|
|
361
|
+
### Environment variables
|
|
362
|
+
|
|
363
|
+
| Variable | Purpose |
|
|
364
|
+
|---|---|
|
|
365
|
+
| `CIPHERWAKE_API_KEY` | Authenticate as your account: higher quotas, `--fresh` forced scans, `watch`, `vendors sync`. Free tier works without it. |
|
|
366
|
+
| `GITHUB_TOKEN` / `GH_TOKEN` | Used by `pqcheck last --remote` for private repos and higher GitHub API limits. Optional for public repos. |
|
|
367
|
+
| `PQCHECK_API_BASE` | Override the API base URL (default `https://cipherwake.io`). For corporate proxies that re-route egress, or testing against a staging deployment. |
|
|
368
|
+
|
|
354
369
|
### Exit codes
|
|
355
370
|
|
|
371
|
+
**Deploy gate** (`deploy-check` / `guard` / `last` in `--ai` mode):
|
|
372
|
+
|
|
373
|
+
| Code | Meaning |
|
|
374
|
+
|---|---|
|
|
375
|
+
| `0` | `ship_decision=pass` — safe to announce |
|
|
376
|
+
| `1` | `ship_decision=review` — surface to the user before announcing |
|
|
377
|
+
| `2` | `ship_decision=block` — do not announce; investigate |
|
|
378
|
+
| `3` | Error / no signal — the check itself failed (network, crash, no reusable result). Never treated as a security verdict: rerun or verify manually. |
|
|
379
|
+
|
|
380
|
+
**Bare scan + artifact commands:**
|
|
381
|
+
|
|
356
382
|
| Code | Meaning |
|
|
357
383
|
|---|---|
|
|
358
384
|
| `0` | Success |
|
|
359
385
|
| `1` | Usage / network / scan error |
|
|
360
386
|
| `2` | Score met or exceeded `--threshold`, or `diff` detected regression |
|
|
361
387
|
| `3` | Allowlist violation (`pqcheck deps --allowlist`) |
|
|
362
|
-
| `4` | Supply-chain change detected — new host(s) since baseline (`pqcheck deps --fail-on-new`) |
|
|
388
|
+
| `4` | Supply-chain change detected — new host(s) since baseline (`pqcheck deps --fail-on-new`), or new origin (`vendors check`) |
|
|
363
389
|
|
|
364
390
|
## Examples
|
|
365
391
|
|