pqcheck 0.16.31 → 0.16.33

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 CHANGED
@@ -8,7 +8,7 @@
8
8
  [![npm downloads](https://img.shields.io/npm/dm/pqcheck.svg?style=flat-square&color=06b6d4)](https://www.npmjs.com/package/pqcheck)
9
9
  [![license](https://img.shields.io/npm/l/pqcheck.svg?style=flat-square&color=06b6d4)](./LICENSE)
10
10
 
11
- > **Latest: v0.16.31** — `--fresh` now actually refreshes posture. External dogfood bug: a customer deployed CSP/HSTS/X-Frame-Options/X-Content-Type-Options/Referrer-Policy/Permissions-Policy via Next.js, verified all six on the wire with curl, and `pqcheck deploy-check --fresh` continued to report `posture_grade=D` + `posture_leaks=x-powered-by: Next.js` directly contradicting reality. Root cause: the CLI silently dropped `--fresh` from the trust-diff request body. Now plumbed through end-to-end. Every response carries `fresh_status` (`applied | rate_limited | unauthenticated | unavailable | not_requested`) so callers route on whether the posture is current no more silent stale reads. `--verbose` emits a `CIPHERWAKE_SCANNER_OBSERVED` block with the actual headers, final URL, and status the grade was computed from, so customers can diff "what Cipherwake saw" vs `curl -I` instantly. [Full changelog →](./CHANGELOG.md)
11
+ > **Latest: v0.16.33** — Two real-dogfood fixes from a Next.js 15 Vercel deploy session. **(1) CSP quality grading (R93)** beyond the existing `unsafe-inline`/`unsafe-eval`/`*` deductions, posture now flags scheme-wildcards (`script-src 'self' https:` is nearly as broad as `*`), missing `object-src 'none'`, missing restrictive `base-uri`, and HSTS without `includeSubDomains`. Presence ≠ strength: a CSP that satisfies "present" but allows scheme wildcards now grades accordingly. **(2) Generated workflow uses `deployment_status` not `push:main`** `pqcheck init` no longer races the platform's deploy. The generated GitHub Action now fires AFTER a successful Production deploy, so trust-diff sees the surface that actually shipped (Vercel / Netlify / Render / Railway / any platform emitting `deployment_status` events). `pull_request` trigger preserved for advisory PR diffs; `push:main` documented as a fallback for non-deployment-event platforms. [Full changelog →](./CHANGELOG.md)
12
12
 
13
13
  ## Two ways to use it
14
14
 
package/bin/pqcheck.js CHANGED
@@ -5497,9 +5497,20 @@ function isValidBaseline(value) {
5497
5497
  function renderTrustDiffWorkflow({ domain, failOn, baseline }) {
5498
5498
  return `# Cipherwake — Trust Diff gate
5499
5499
  # Generated by \`pqcheck init\` (v${VERSION}).
5500
- # Runs on every PR and pushes to main: fails the build if your public trust
5501
- # posture regresses vs the baseline (cert / SPKI / vendor scripts / HSTS / CSP /
5502
- # DMARC / HNDL).
5500
+ # Runs:
5501
+ # - on every PR (advisory diff against the production baseline)
5502
+ # - on every successful Production deployment (post-deploy gate)
5503
+ # Fails the build if your public trust posture regresses vs the baseline
5504
+ # (cert / SPKI / vendor scripts / HSTS / CSP / DMARC / HNDL / declared
5505
+ # route assertions).
5506
+ #
5507
+ # R93 (2026-06-08): defaults to deployment_status (success + Production) for
5508
+ # the post-deploy job, NOT push:main. Reason: on platforms with git-integrated
5509
+ # deploys (Vercel, Netlify, Render, Railway, etc.) the deploy fires from the
5510
+ # same push event — running on push:main would RACE the deploy and diff the
5511
+ # STALE production surface before the new deploy is live. deployment_status
5512
+ # fires AFTER the deploy lands, so trust-diff sees the surface that actually
5513
+ # shipped.
5503
5514
  #
5504
5515
  # Free tier: 100 Trust Diff calls/month per repo (OIDC-metered).
5505
5516
  # Methodology: https://cipherwake.io/methodology/
@@ -5510,8 +5521,7 @@ name: Cipherwake Trust Diff
5510
5521
  on:
5511
5522
  pull_request:
5512
5523
  branches: [main]
5513
- push:
5514
- branches: [main]
5524
+ deployment_status:
5515
5525
 
5516
5526
  permissions:
5517
5527
  contents: read
@@ -5522,6 +5532,18 @@ permissions:
5522
5532
  jobs:
5523
5533
  trust-diff:
5524
5534
  runs-on: ubuntu-latest
5535
+ # Run on PRs OR on successful Production deployments.
5536
+ # PRs: github.event_name == "pull_request" — advisory diff for the change
5537
+ # Deployment: deployment_status.state == "success" — only after a deploy
5538
+ # actually succeeded; skips failed/error/pending events. Environment
5539
+ # filter on "production" / "Production" so preview deploys don't
5540
+ # trigger trust-diff against the prod domain (different surfaces).
5541
+ if: |
5542
+ github.event_name == 'pull_request' ||
5543
+ (github.event_name == 'deployment_status' &&
5544
+ github.event.deployment_status.state == 'success' &&
5545
+ (github.event.deployment.environment == 'production' ||
5546
+ github.event.deployment.environment == 'Production'))
5525
5547
  steps:
5526
5548
  - name: Run Cipherwake Trust Diff
5527
5549
  uses: cipherwakelabs/pqcheck@v4
@@ -5535,6 +5557,16 @@ jobs:
5535
5557
  # OIDC token and meters per repo (100 calls/mo, no setup).
5536
5558
  # If you want higher limits, link this repo to a paid Cipherwake
5537
5559
  # account at https://cipherwake.io/account → Linked repos.
5560
+ #
5561
+ # If your platform does NOT emit deployment_status events (custom
5562
+ # CD scripts, S3-sync deploys, manual rollouts), replace the
5563
+ # deployment_status trigger above with:
5564
+ #
5565
+ # push:
5566
+ # branches: [main]
5567
+ #
5568
+ # AND add a delay/health-check step before this one so trust-diff
5569
+ # runs AFTER your deploy is live, not racing it.
5538
5570
  `;
5539
5571
  }
5540
5572
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pqcheck",
3
- "version": "0.16.31",
3
+ "version": "0.16.33",
4
4
  "description": "Deploy gate for AI-coded web apps. `pqcheck deploy-check --ai` returns ship_decision=pass|review|block for Claude Code / Cursor / Copilot / Aider to gate deploys before they ship. Anonymous, no signup, free for first use.",
5
5
  "keywords": [
6
6
  "ai-coder",