ai-saas-guard 0.35.1 → 0.36.0

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
@@ -146,7 +146,7 @@ One command returns a launch-readiness report with:
146
146
  - why the finding matters for an AI-built SaaS launch
147
147
  - manual verification steps you can actually run
148
148
  - practical fix direction, not generic advice
149
- - short `--summary`, terminal, JSON, SARIF, and PR markdown output for local review or CI
149
+ - launch decision queue, ranking explanation, trust statement, short `--summary`, terminal, JSON, SARIF, and PR markdown output for local review or CI
150
150
 
151
151
  ## Problems It Helps You Catch
152
152
 
@@ -231,13 +231,13 @@ The CLI is published on npm as `ai-saas-guard`, and the GitHub Action is availab
231
231
  | Area | Status |
232
232
  | --- | --- |
233
233
  | Public GitHub repository | Available |
234
- | npm CLI | `ai-saas-guard@0.35.1` |
235
- | GitHub Action | `zr9959/ai-saas-guard@v0` or fixed tag `v0.35.1` |
236
- | Outputs | Short summary, terminal, JSON, SARIF, and PR-focused markdown |
234
+ | npm CLI | `ai-saas-guard@0.36.0` |
235
+ | GitHub Action | `zr9959/ai-saas-guard@v0` or fixed tag `v0.36.0` |
236
+ | Outputs | Launch decision queue, short summary, terminal, JSON, SARIF, and PR-focused markdown |
237
237
  | Project config | `.ai-saas-guard.json` rule toggles, severity overrides, suppressions, and fail thresholds |
238
238
  | Privacy model | Local-first, read-only scan commands, no LLM calls, no code upload |
239
- | Versioned Action tags | `v0.35.1`, `v0` |
240
- | Current release | `0.35.1` updates the case-study fixture to a patched Next.js release so GitHub Dependabot no longer reports known Next.js advisories for the packaged example |
239
+ | Versioned Action tags | `v0.36.0`, `v0` |
240
+ | Current release | `0.36.0` turns Markdown and summary output into a clearer launch decision queue with ranking explanations, reviewer checklists, case-study flow, and local trust/resource statements |
241
241
  | npm publishing | Trusted Publisher/OIDC, no long-lived publish token |
242
242
  | Repository trust hardening | Strict branch protection, Dependabot, CodeQL, fast-check fuzzing, signed release provenance assets, private vulnerability reporting, secret scanning, and push protection |
243
243
  | Cloudflare hosted ingress | Deployed at `https://ai-saas-guard-hosted.zr9959.workers.dev`; signed GitHub App webhook delivery and compact Check Run smoke now pass in staging |
@@ -297,7 +297,7 @@ AI-generated PRs often combine unrelated work:
297
297
  - suggested PR split
298
298
  - required tests or manual verification
299
299
  - explicit git-diff diagnostics when a base ref or shallow checkout prevents PR classification
300
- - PR-focused markdown for GitHub step summaries or PR comments
300
+ - PR-focused markdown with launch decision queue, reviewer checklist, ranking explanation, and suggested split for GitHub step summaries or PR comments
301
301
 
302
302
  ```bash
303
303
  node dist/cli.js pr-risk --root /path/to/your-saas --base origin/main --json
@@ -415,7 +415,7 @@ Use `suppressions` for narrower false-positive handling when one rule is noisy o
415
415
 
416
416
  ## GitHub Action
417
417
 
418
- The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.35.1` for controlled upgrades, or pin a reviewed commit SHA for stricter supply-chain control:
418
+ The repo includes a composite Action. Use `v0` for the latest compatible pre-1.0 Action, a specific release tag such as `v0.36.0` for controlled upgrades, or pin a reviewed commit SHA for stricter supply-chain control:
419
419
 
420
420
  ```yaml
421
421
  name: ai-saas-guard
@@ -1,5 +1,9 @@
1
1
  import type { BaseReport, Finding } from "../types.js";
2
2
  export declare function launchGateVerdict(report: BaseReport): string;
3
3
  export declare function reviewFirst(findings: Finding[], limit?: number): string[];
4
+ export declare function launchDecisionQuestions(findings: Finding[]): string[];
5
+ export declare function rankingExplanation(findings: Finding[]): string[];
6
+ export declare function prReviewerChecklist(): string[];
7
+ export declare function trustStatement(): string[];
4
8
  export declare function manualProofSteps(findings: Finding[], limit?: number): string[];
5
9
  export declare function nextSteps(findings: Finding[]): string[];
@@ -20,6 +20,47 @@ export function reviewFirst(findings, limit = 3) {
20
20
  return `${finding.severity.toUpperCase()} ${finding.ruleId}${location ? ` at ${location}` : ""} - ${finding.title}`;
21
21
  });
22
22
  }
23
+ export function launchDecisionQuestions(findings) {
24
+ if (findings.length === 0) {
25
+ return [
26
+ "Can a real user get access they should not have? No current finding, but still run a two-account auth/data-access smoke.",
27
+ "Can the app claim success when something failed? No current finding, but still force one provider failure before launch.",
28
+ "Can launch infrastructure do too much damage? No current finding, but still confirm env, CI, MCP, and deploy permissions."
29
+ ];
30
+ }
31
+ return [
32
+ "Can a real user get access they should not have? Review auth, tenant ownership, Supabase RLS, webhook entitlement, and data mutation findings first.",
33
+ "Can the app claim success when something failed? Review silent-success, hardcoded fallback, skipped test, and provider failure findings before launch.",
34
+ "Can launch infrastructure do too much damage? Review env exposure, GitHub Actions permissions, MCP tool power, deploy config, logging, and resource hints."
35
+ ];
36
+ }
37
+ export function rankingExplanation(findings) {
38
+ if (findings.length === 0) {
39
+ return [
40
+ "No findings were ranked by this command; this is still a heuristic result, not a certification."
41
+ ];
42
+ }
43
+ return [
44
+ "ai-saas-guard ranks auth, billing, tenant data, RLS, webhooks, and silent-success findings before deploy/cost hygiene because those paths can grant access, expose customer data, or hide production failures.",
45
+ "Medium and low deploy, CI, MCP, and observability findings stay in the queue because they can amplify launch damage, but they should not distract from critical user-access, payment, and data-access proof."
46
+ ];
47
+ }
48
+ export function prReviewerChecklist() {
49
+ return [
50
+ "What changed at the trust boundary?",
51
+ "Why this auth/session/payment/data access decision?",
52
+ "What manual proof should block merge until it passes?",
53
+ "Which files should be reviewed together before this PR is approved?",
54
+ "Should auth, billing, data access, deploy, or UI changes be split into separate PRs?"
55
+ ];
56
+ }
57
+ export function trustStatement() {
58
+ return [
59
+ "Runs as a local-first, deterministic, read-only launch gate over repository files.",
60
+ "Does not upload code or call an LLM.",
61
+ "Uses bounded file collection and ignores heavy generated directories such as node_modules, .next, dist, build, coverage, and .git."
62
+ ];
63
+ }
23
64
  export function manualProofSteps(findings, limit = 3) {
24
65
  const steps = [];
25
66
  const seen = new Set();
@@ -1,4 +1,4 @@
1
- import { launchGateVerdict, manualProofSteps, nextSteps, reviewFirst } from "./launchGate.js";
1
+ import { launchDecisionQuestions, launchGateVerdict, manualProofSteps, nextSteps, prReviewerChecklist, rankingExplanation, reviewFirst, trustStatement } from "./launchGate.js";
2
2
  export function formatMarkdownReport(report) {
3
3
  if (report.command === "demo")
4
4
  return `${formatDemoMarkdown(report)}\n`;
@@ -48,6 +48,9 @@ function formatPrRiskMarkdown(report) {
48
48
  lines.push(`**Risk categories:** ${report.categories.map((category) => `\`${category}\``).join(", ")}`);
49
49
  }
50
50
  lines.push("");
51
+ lines.push("### Launch Decision Queue");
52
+ appendList(lines, launchDecisionQuestions(report.findings).map(escapeMarkdownInline));
53
+ lines.push("");
51
54
  lines.push("### Review first");
52
55
  if (report.topRiskyFiles.length === 0) {
53
56
  lines.push("");
@@ -65,6 +68,15 @@ function formatPrRiskMarkdown(report) {
65
68
  lines.push("### Required verification");
66
69
  appendList(lines, report.requiredTests.length > 0 ? report.requiredTests : report.reviewChecklist);
67
70
  lines.push("");
71
+ lines.push("### Reviewer checklist");
72
+ appendList(lines, prReviewerChecklist().map(escapeMarkdownInline));
73
+ lines.push("");
74
+ lines.push("### Why this review order");
75
+ appendList(lines, [
76
+ "Rank trust-boundary files before cosmetic files because auth, billing, tenant data, RLS, webhook, and silent-success changes can affect real users before UI issues do.",
77
+ ...rankingExplanation(report.findings)
78
+ ].map(escapeMarkdownInline));
79
+ lines.push("");
68
80
  lines.push("### Suggested PR split");
69
81
  appendList(lines, report.suggestedSplit.length > 0 ? report.suggestedSplit : ["No split suggestion from the current diff."]);
70
82
  lines.push("");
@@ -94,6 +106,15 @@ function appendList(lines, items) {
94
106
  }
95
107
  }
96
108
  function appendLaunchQueue(lines, findings) {
109
+ lines.push("");
110
+ lines.push("### Launch Decision Queue");
111
+ appendList(lines, launchDecisionQuestions(findings).map(escapeMarkdownInline));
112
+ lines.push("");
113
+ lines.push("### Why This Is Ranked First");
114
+ appendList(lines, rankingExplanation(findings).map(escapeMarkdownInline));
115
+ lines.push("");
116
+ lines.push("### Trust Statement");
117
+ appendList(lines, trustStatement().map(escapeMarkdownInline));
97
118
  if (findings.length === 0)
98
119
  return;
99
120
  lines.push("");
@@ -1,4 +1,4 @@
1
- import { launchGateVerdict, manualProofSteps, nextSteps, reviewFirst } from "./launchGate.js";
1
+ import { launchDecisionQuestions, launchGateVerdict, manualProofSteps, nextSteps, reviewFirst } from "./launchGate.js";
2
2
  export function formatSummaryReport(report) {
3
3
  if (report.command === "demo")
4
4
  return formatShowcaseSummary(report);
@@ -7,6 +7,10 @@ export function formatSummaryReport(report) {
7
7
  lines.push(`Root: ${report.rootDir}`);
8
8
  lines.push(`Findings: ${summaryText(report)}`);
9
9
  lines.push(`Launch gate: ${launchGateVerdict(report)}`);
10
+ lines.push(`Decision queue: ${launchDecisionQuestions(report.findings)[0]}`);
11
+ if (report.findings.length > 0) {
12
+ lines.push("Review trust-boundary findings before deploy/cost hygiene.");
13
+ }
10
14
  if (report.findings.length === 0) {
11
15
  lines.push("");
12
16
  lines.push("No heuristic launch-readiness risks found by this command.");
@@ -143,7 +143,7 @@ Next steps
143
143
  - 说明它为什么会影响 AI 构建的 SaaS 上线
144
144
  - 给出可以人工复现的验证步骤
145
145
  - 给出实际修复方向,不只是一句泛泛建议
146
- - 支持短 `--summary`、terminal、JSON、SARIF 和 PR markdown,方便本地或 CI 使用
146
+ - 支持上线决策队列、排序解释、trust statement、短 `--summary`、terminal、JSON、SARIF 和 PR markdown,方便本地或 CI 使用
147
147
 
148
148
  ## 它能帮你抓住哪些问题
149
149
 
@@ -211,18 +211,18 @@ node dist/cli.js scan --root /path/to/your-saas
211
211
 
212
212
  这个仓库是公开 GitHub 仓库。
213
213
 
214
- CLI 已发布到 npm:`ai-saas-guard@0.35.1`。GitHub Action 支持 `v0` 浮动标签,也支持固定版本标签,例如 `v0.35.1`。
214
+ CLI 已发布到 npm:`ai-saas-guard@0.36.0`。GitHub Action 支持 `v0` 浮动标签,也支持固定版本标签,例如 `v0.36.0`。
215
215
 
216
216
  | 模块 | 状态 |
217
217
  | --- | --- |
218
218
  | 公开 GitHub 仓库 | 已可用 |
219
- | npm CLI | `ai-saas-guard@0.35.1` |
220
- | GitHub Action | `zr9959/ai-saas-guard@v0` 或固定标签 `v0.35.1` |
221
- | 输出格式 | summary、Terminal、JSON、SARIF 和 PR markdown |
219
+ | npm CLI | `ai-saas-guard@0.36.0` |
220
+ | GitHub Action | `zr9959/ai-saas-guard@v0` 或固定标签 `v0.36.0` |
221
+ | 输出格式 | 上线决策队列、短 summary、Terminal、JSON、SARIF 和 PR markdown |
222
222
  | 项目配置 | `.ai-saas-guard.json` 支持规则开关、severity 覆盖、suppressions 和 fail threshold |
223
223
  | 隐私模型 | 本地优先、只读扫描、不调用 LLM、不上传代码 |
224
- | 当前版本 | `0.35.1` 将 case-study fixture 升级到已修补的 Next.js 版本,避免 GitHub Dependabot 对包内示例继续报告已知 Next.js advisories |
225
- | Action 标签 | `v0.35.1`、`v0` |
224
+ | 当前版本 | `0.36.0` 将 Markdown summary 输出升级成更清楚的上线决策队列,加入排序解释、reviewer checklist、case-study flow 和本地 trust/resource statement |
225
+ | Action 标签 | `v0.36.0`、`v0` |
226
226
  | npm 发布 | GitHub Actions Trusted Publisher/OIDC,无需长期 npm token |
227
227
  | 仓库可信度加固 | 严格 branch protection、Dependabot、CodeQL、fast-check fuzzing、signed release provenance assets、private vulnerability reporting、secret scanning 和 push protection |
228
228
  | Cloudflare hosted ingress | 已部署到 `https://ai-saas-guard-hosted.zr9959.workers.dev`;签名 GitHub App webhook delivery 和 compact Check Run staging smoke 已通过 |
@@ -14,8 +14,46 @@ Expected findings include:
14
14
 
15
15
  Use it locally:
16
16
 
17
+ ## Local Scan
18
+
17
19
  ```bash
18
20
  npx ai-saas-guard@latest scan --root examples/case-study-ai-saas --summary
19
21
  ```
20
22
 
23
+ ## Markdown Report
24
+
25
+ Use Markdown when you want a launch decision queue that can be pasted into an issue or PR:
26
+
27
+ ```bash
28
+ npx ai-saas-guard@latest scan --root examples/case-study-ai-saas --markdown
29
+ ```
30
+
31
+ The report should start with the launch gate, decision queue, top risks, manual proof steps, ranking explanation, and trust statement before listing every finding.
32
+
33
+ ## PR Risk
34
+
35
+ To see how the same middle-layer logic works for an AI-heavy PR, run:
36
+
37
+ ```bash
38
+ npx ai-saas-guard@latest pr-risk --root examples/case-study-ai-saas --base origin/main --markdown
39
+ ```
40
+
41
+ The PR report is designed for reviewers: review order, required verification, reviewer checklist, suggested PR split, and file evidence.
42
+
43
+ ## Fix-before/fix-after
44
+
45
+ Use this fixture as the "before" state. The expected fix path is not to make the fixture a starter template; it is to demonstrate how a reviewer would close the launch gate:
46
+
47
+ - verify Stripe signatures before entitlement updates
48
+ - replace fake success fallbacks with explicit error or degraded-mode handling
49
+ - scope Supabase RLS by tenant/user ownership
50
+ - add Next/Vercel security headers and request IDs
51
+ - reduce GitHub Actions permissions and add PR concurrency cancellation
52
+
53
+ After each fix, rerun the local scan and keep the manual proof result with the launch checklist.
54
+
55
+ ## Trust and Resource Boundary
56
+
57
+ The fixture is scanned locally. `ai-saas-guard` does not upload source code or call an LLM, and normal CLI scans use bounded file collection with generated and dependency directories ignored.
58
+
21
59
  This fixture is public-safe and synthetic. It is not a SaaS starter template, pentest target, certification artifact, or full audit.
@@ -8,7 +8,7 @@ The Action runs the same local scanner inside the GitHub-hosted runner. It reads
8
8
 
9
9
  ## PR Summary
10
10
 
11
- Use markdown when reviewers need a short, evidence-first summary of risky files, required verification, and suggested PR split.
11
+ Use markdown when reviewers need a short, evidence-first launch decision queue: risky files, required verification, reviewer checklist, ranking explanation, and suggested PR split.
12
12
 
13
13
  ```yaml
14
14
  name: ai-saas-guard-pr-summary
@@ -37,7 +37,7 @@ jobs:
37
37
  - run: cat ai-saas-guard-pr.md >> "$GITHUB_STEP_SUMMARY"
38
38
  ```
39
39
 
40
- Use markdown for PR review triage. It is intentionally short enough for a GitHub step summary or a PR comment created by your own workflow. It does not require a hosted service.
40
+ Use markdown for PR review triage. It is intentionally short enough for a GitHub step summary or a PR comment created by your own workflow. It does not require a hosted service. The report keeps the middle-layer contract explicit: it translates trust-boundary changes into human review questions, not an automatic approval.
41
41
 
42
42
  ## Project Config
43
43
 
@@ -98,4 +98,4 @@ jobs:
98
98
  sarif_file: ai-saas-guard.sarif
99
99
  ```
100
100
 
101
- Use SARIF for tracking alerts over time. Use markdown for reviewer guidance on a specific PR. Many teams should run both: markdown for quick review order, SARIF for code scanning visibility.
101
+ Use SARIF for tracking alerts over time. Use markdown for reviewer guidance on a specific PR. Many teams should run both: markdown for launch decision queues, SARIF for code scanning visibility.
@@ -5,11 +5,11 @@
5
5
  ## Current State
6
6
 
7
7
  - Package name: `ai-saas-guard`
8
- - Current published version: `0.35.1`
8
+ - Current published version: `0.36.0`
9
9
  - Next source candidate: none
10
10
  - npm registry state: published at <https://www.npmjs.com/package/ai-saas-guard>
11
11
  - First npm-published version: `0.1.1`
12
- - GitHub Release: `v0.35.1`
12
+ - GitHub Release: `v0.36.0`
13
13
  - Publish workflow: `.github/workflows/npm-publish.yml`
14
14
  - Trusted Publisher: GitHub Actions, `zr9959/ai-saas-guard`, workflow `npm-publish.yml`, allowed action `npm publish`
15
15
  - Long-lived npm publish token: not required
@@ -18,7 +18,7 @@
18
18
 
19
19
  Use GitHub Actions with npm Trusted Publisher/OIDC:
20
20
 
21
- 1. Create and review a release tag such as `v0.35.1`.
21
+ 1. Create and review a release tag such as `v0.36.0`.
22
22
  2. Publish from the GitHub Release or run the `Publish npm` workflow manually with `ref` set to that tag.
23
23
  3. Keep `permissions.id-token: write` in the workflow so npm can exchange the GitHub Actions OIDC identity for a short-lived publish credential.
24
24
  4. Run `npm publish --access public` from the workflow. Trusted publishing automatically generates provenance for this public package from this public repository.
@@ -2,6 +2,32 @@
2
2
 
3
3
  This project should compete by being narrow, trustworthy, and review-oriented.
4
4
 
5
+ ## North Star
6
+
7
+ `ai-saas-guard` should become the launch-risk middle layer between AI-generated SaaS code and real users.
8
+
9
+ The product is not trying to be the lowest-level static-analysis engine, and it is not trying to be a top-level full security audit service. Its job is to translate messy AI-built SaaS code and AI-heavy PRs into a founder-readable, reviewer-ready launch gate:
10
+
11
+ ```text
12
+ AI-built SaaS code
13
+
14
+ ai-saas-guard: launch-risk middle layer
15
+
16
+ founder, reviewer, CI, or GitHub App makes the final launch decision
17
+ ```
18
+
19
+ The long-term product sentence:
20
+
21
+ > The launch gate between AI-generated code and real users.
22
+
23
+ Every major feature should support this middle-layer role:
24
+
25
+ - translate code changes into launch-risk language
26
+ - prioritize trust-boundary paths: auth, billing, tenant data, RLS, webhooks, env, CI, MCP, and deploy
27
+ - turn findings into manual proof steps a human can actually run
28
+ - keep the default trust model local-first, deterministic, read-only, no code upload, and no LLM calls
29
+ - avoid claiming pentest, certification, full audit, or complete vulnerability discovery
30
+
5
31
  ## Public Position
6
32
 
7
33
  `ai-saas-guard` is a local-first launch preflight for AI-built SaaS apps. It finds common production-readiness risks and produces concrete verification steps.
@@ -23,6 +23,8 @@ Recent setup commits at the time this handoff was created:
23
23
 
24
24
  `ai-saas-guard` is a local-first launch preflight CLI for AI-built SaaS apps.
25
25
 
26
+ North star: `ai-saas-guard` is the launch-risk middle layer between AI-generated SaaS code and real users. It translates AI-built SaaS code and AI-heavy PRs into a founder-readable, reviewer-ready launch gate. It is not a low-level static-analysis engine, a pentest, a certification, or a full security audit service.
27
+
26
28
  The core user is a founder, solo builder, or reviewer shipping an AI-assisted SaaS MVP who needs to know what deserves human review before launch or merge.
27
29
 
28
30
  The narrow product promise:
@@ -6,6 +6,8 @@ This is a synthetic, public-safe example of the kind of review queue `ai-saas-gu
6
6
  ai-saas-guard scan summary
7
7
  Findings: 6 findings: 0 critical, 3 high, 3 medium, 0 low, 0 info
8
8
  Launch gate: review required: high-risk launch paths need manual verification before launch
9
+ Decision queue: Can a real user get access they should not have? Review auth, tenant ownership, Supabase RLS, webhook entitlement, and data mutation findings first.
10
+ Review trust-boundary findings before deploy/cost hygiene.
9
11
 
10
12
  Top risks:
11
13
  - HIGH stripe.webhook.missing-signature at app/api/stripe/webhook/route.ts:12 - Stripe webhook does not verify the Stripe signature
@@ -25,6 +27,12 @@ Full report:
25
27
  Rerun without --summary, or use --json, --sarif, or --markdown where supported.
26
28
  ```
27
29
 
30
+ Markdown reports include the same decision queue plus:
31
+
32
+ - why auth, billing, tenant data, RLS, webhooks, and silent-success findings rank first
33
+ - a trust statement: local-first, deterministic, read-only, no code upload, no LLM calls
34
+ - a reviewer checklist for PR risk output
35
+
28
36
  The full terminal report expands each finding:
29
37
 
30
38
  ```text
@@ -86,4 +94,4 @@ Start with the highest severity findings that touch trust-boundary code: auth, b
86
94
  - Why could this fail for real users?
87
95
  - What manual proof shows the path fails closed?
88
96
 
89
- The report is a focused review queue. It does not replace your two-account authorization tests, Stripe webhook replay, deploy-preview checks, or human review.
97
+ The report is a focused launch decision queue. It does not replace your two-account authorization tests, Stripe webhook replay, deploy-preview checks, or human review.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-saas-guard",
3
- "version": "0.35.1",
3
+ "version": "0.36.0",
4
4
  "description": "Local-first CLI that catches launch blockers in AI-built Next.js/Supabase/Stripe SaaS apps.",
5
5
  "readmeFilename": "README.md",
6
6
  "type": "module",