launch-doctor 0.4.0 → 0.4.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/CHANGELOG.md +50 -7
- package/README.md +82 -402
- package/dist/src/banner.d.ts +22 -0
- package/dist/src/banner.js +35 -0
- package/dist/src/bin.cjs +35 -0
- package/dist/src/bin.d.cts +2 -0
- package/dist/src/checks/access.js +8 -0
- package/dist/src/checks/costs.js +6 -0
- package/dist/src/checks/database.js +29 -0
- package/dist/src/checks/payments.js +12 -0
- package/dist/src/checks/secrets.d.ts +26 -1
- package/dist/src/checks/secrets.js +245 -5
- package/dist/src/cli.js +275 -11
- package/dist/src/fixes.d.ts +8 -1
- package/dist/src/fixes.js +31 -10
- package/dist/src/grade.d.ts +8 -1
- package/dist/src/grade.js +13 -0
- package/dist/src/grades.d.ts +42 -0
- package/dist/src/grades.js +163 -0
- package/dist/src/history.js +9 -2
- package/dist/src/hooks-setup.d.ts +26 -0
- package/dist/src/hooks-setup.js +115 -1
- package/dist/src/index.js +6 -1
- package/dist/src/init.d.ts +32 -2
- package/dist/src/init.js +120 -6
- package/dist/src/live.d.ts +4 -1
- package/dist/src/live.js +62 -23
- package/dist/src/net-guard.d.ts +14 -6
- package/dist/src/net-guard.js +9 -6
- package/dist/src/pinned-http.d.ts +31 -0
- package/dist/src/pinned-http.js +104 -0
- package/dist/src/prompt.d.ts +23 -0
- package/dist/src/prompt.js +88 -0
- package/dist/src/report.d.ts +14 -1
- package/dist/src/report.js +29 -15
- package/dist/src/short-report.d.ts +59 -0
- package/dist/src/short-report.js +241 -0
- package/dist/src/types.d.ts +27 -0
- package/dist/src/util.d.ts +2 -0
- package/dist/src/util.js +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,50 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.2] - 2026-12-04
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **What to do after a key leaks.** Every leaked-key fix prompt (keys in code, in a public variable, in a committed `.env`, in git history and in a live site) now ends with the next steps: check the provider's usage or activity log for someone else's use, run `--history` to find keys in old commits, and after deploying run `scan <url>` to check the live site (each pointer is left out where the finding came from). `LAUNCH_FIXES.md` shows "Rotate the key first" and "Check whether someone used it" links for these findings. The links come from one provider table in the code; a test checks every kind of key has an entry and every link is https. Usage-log links are given only where the page is known (Stripe, OpenAI, OpenRouter, Supabase, AWS, GitHub, SendGrid, Resend); other providers get a general pointer. Launch Doctor only prints the links; it never opens them or contacts a provider.
|
|
15
|
+
- `launch-doctor init --hooks --upgrade` moves the hooks that `init --hooks` installed (Claude Code, Cursor and the git pre-commit hook) onto the current version. It changes only the pinned launch-doctor package in each hook command, shows each line before and after, and leaves other hooks, other settings and the files' formatting alone. Hooks installed without a version are reported, not rewritten.
|
|
16
|
+
- On Node.js older than 22, `launch-doctor` now prints one message (the version found, that it needs 22 or newer, and how to update with the Node.js download page, nvm or fnm) and exits with code 1, instead of crashing with a syntax or import error. The command now starts from `dist/src/bin.cjs`, a small file in old syntax that checks the version before loading the program.
|
|
17
|
+
- **A shorter default report.** The terminal report now shows one verdict line ("NOT READY TO LAUNCH: 6 critical problems", or "Ready, as far as Launch Doctor can tell" with what was checked and what can't be), two grades (Security: secrets, database, access control, payments, AI costs; Launch readiness: email, monitoring, legal, first impressions), the three things to fix first, one "Also:" line with the other counts, and what to do next. The two grades use the same rules as the overall grade, which stays in `--json`; `--json` also gains `grades.security` and `grades.launch`. Findings that can be critical get a consequence-first title for this report ("Anyone can use your Stripe account: the live secret key is in your code"), a short reason, and for leaked keys a link to the provider's page for rotating them. These are in a new `display` field: finding ids, titles, fingerprints and baselines are unchanged.
|
|
18
|
+
- `--verbose` prints the full report (every category and every finding). `--ci`, `--changed`, `--staged`, `--pr-comment`, `scan <url>`, the hooks, the MCP server and pull request comments are unchanged.
|
|
19
|
+
- `launch-doctor prompt <n> [folder]` prints fix prompt n (the numbers in the report and in `LAUNCH_FIXES.md`) and says which finding it is for. `--copy` puts it on the clipboard with clip, pbcopy, wl-copy or xclip; without one, it prints the prompt and says so. No new dependencies.
|
|
20
|
+
- `LAUNCH_FIXES.md` starts with one prompt for all the critical problems.
|
|
21
|
+
- A progress line on scans that take more than a second, only in an interactive terminal, cleared before the report.
|
|
22
|
+
- An empty folder, or a project in a language the checks don't read (Rust, Java or Kotlin, .NET, Flutter, Swift, Elixir, C or C++) with nothing to fix, gets a plain explanation instead of a grade. `--json` and `--ci` are unchanged.
|
|
23
|
+
- An ASCII banner (LAUNCH / DOCTOR in the "ANSI Shadow" style, 51 columns wide) above the title of a full scan: a folder, `--demo` or `scan <url>`. It only shows when stdout is a terminal at least 53 columns wide, and never with `--json`, `--ci`, `--sarif`, `--out`, `--changed`, `--staged` or `--pr-comment`, or when `CI` or `GITHUB_ACTIONS` is set. `--no-banner` turns it off. It is plain text with no colour.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **A shorter README.** It starts with a five-step quick start, then keeps what a reader needs before trusting a grade ("Read this first", "What it cannot do", "How it is tested"), the checks, the grading and a table of common commands. The full CLI reference, configuration, CI and pull request comments, hooks and the MCP server, the live scan details, the pipeline description and the library API moved, unchanged apart from updated facts, into `docs/cli.md`, `docs/configuration.md`, `docs/ci.md`, `docs/ai-tools.md`, `docs/live-scan.md`, `docs/how-it-works.md` and `docs/library.md`. Facts updated on the way: Node 18 and 20 are now refused with a message, hooks move to a new version with `init --hooks --upgrade`, the test count, where the last recorded grade appears, and what is at the top of `LAUNCH_FIXES.md`. A test checks that every relative link in the README and `docs/` points to a file that exists.
|
|
28
|
+
- `scripts/corpus.mjs` reads the corpus folder from the `LAUNCH_DOCTOR_CORPUS_DIR` environment variable, and uses `.corpus/` in the repository when it is not set, so nothing changes for anyone who does not set it. `diff --check` (and `diff --update`) now exit with code 1 when an app could not be scanned, for example because the folder is wrong, instead of reporting "No difference"; `--update` leaves the snapshot alone in that case. CONTRIBUTING.md describes both.
|
|
29
|
+
- `docs/roadmap.md` is revised: M1 now plans two headline grades (Security and Launch readiness; the old overall grade stays in `--json`), M2 adds checks on AI agent and MCP configs, and new milestones cover deployment config, more frameworks, reliability, polish and strictness presets. `explain` and `compare` are planned in M10, and the list of what is not planned has five more entries with reasons. Nothing in it is built yet.
|
|
30
|
+
- The roadmap now starts with a rule that no new features are built until 0.5.0 is merged, except a "Quick wins" milestone (key rotation guidance, consequence-first titles, a clear message on old Node, `init --hooks --upgrade`, a shorter README). It also adds monorepo support to R2, sign-in and cookie rules and Supabase function listing to M1 and M2, `fix --safe`, an accuracy page and a browser version, and six more entries under "not planned". Nothing in it is built yet.
|
|
31
|
+
- New `docs/coverage.md` maps the checks to the OWASP Top 10 and says plainly what is not covered.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- A comment that only names a public secret variable ("// don't use VITE_OPENAI_API_KEY") is no longer reported as a critical leak, in code files and in commented-out `.env` lines. A variable used in code is still reported, at the line where it is used. Real key values inside comments are still found.
|
|
36
|
+
|
|
37
|
+
## [0.4.1] - 2026-12-04
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- **Grade history:** `--record` saves the grade of a full scan to `.launchdoctor/grades.json` (date, grade, score, counts, Launch Doctor version and the commit scanned; no finding text, file names or keys; the newest 200 entries). Every full scan then shows the last recorded grade under the overall grade, and `launch-doctor grades [folder]` lists the history (`--json` for the raw list). `--record` is refused with `--changed`, `--staged`, `--only`, `--skip` and `--demo`, whose grades aren't comparable. The file is read like the baseline (a regular file only) and every entry is checked before use.
|
|
42
|
+
- **README badge:** `--record` also draws `.launchdoctor/badge.svg` locally (no badge service), with the grade in a color that keeps 4.5:1 contrast with its white text. With scheduled monitoring, the README points at the copy on the `launch-doctor-grades` branch: ``.
|
|
43
|
+
- **Scheduled monitoring:** `launch-doctor init --monitor` adds `.github/workflows/launch-doctor-monitor.yml`. Every Monday (or when started by hand) it reads the grade history from the `launch-doctor-grades` branch, runs `--record --ci`, so a new critical problem fails the run and GitHub emails you; checks the deployed site too when the repository variable `LAUNCH_DOCTOR_URL` is set (passed through an environment variable, never pasted into the script); and commits `grades.json` and `badge.svg` to the `launch-doctor-grades` branch, also after a failed check. That branch is created on the first run as an orphan branch holding only those two files; nothing is committed to the default branch, so it works with a protected `main` and adds no commits to it. It runs Launch Doctor pinned to the version that created it, and `init --monitor` prints the badge line with your repository filled in when `origin` is on GitHub.
|
|
44
|
+
|
|
45
|
+
### Security
|
|
46
|
+
|
|
47
|
+
- `scan <url>` is no longer open to DNS rebinding. Requests are made with `node:http` and `node:https` instead of `fetch`, and each one connects only to the addresses that were checked for it, so DNS can't hand the connection a private address after the check said public. The host name is still used for the `Host` header and for HTTPS (the server name and the certificate check). Redirects (one hop at a time, at most 5), the per-request timeout, the 3 MB body cap (now counted after decompression) and gzip, deflate and Brotli bodies work as before.
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- Releases are published to npm with trusted publishing: the Release workflow proves who it is to npm with a short-lived GitHub token, so no npm token is stored anywhere, and every version gets a provenance statement linking it to its tag and workflow run. A version that is already on npm is skipped, so a re-run is safe. CONTRIBUTING.md has the one-time npm setup.
|
|
52
|
+
- `docs/roadmap.md` lists the milestones planned after the 0.5.0 engine rewrite, the rules every milestone follows (local-first, opt-in network access, no secrets in output, approval for new dependencies), and what is deliberately not planned, with the reasons. CONTRIBUTING.md, the README and `docs/architecture.md` link to it.
|
|
53
|
+
|
|
10
54
|
## [0.4.0] - 2026-12-02
|
|
11
55
|
|
|
12
56
|
### Added
|
|
@@ -51,6 +95,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
51
95
|
|
|
52
96
|
- An Express route registered before `app.use(requireAuth)` counted as protected, but Express runs middleware in the order it is registered, so the route was open. Sign-in middleware added with `app.use` now only covers the routes registered after it in the same file, so such a route is reported by the access-control checks (`api-write-no-auth`). Middleware registered in another file is still not tracked; that comes with the 0.5.0 engine. Scanning the 50 corpus apps shows no change.
|
|
53
97
|
- A sign-in helper that was only imported (`import { getServerSession } from 'next-auth'`, never called) counted as a sign-in check, so an unprotected AI route (`ai-endpoint-no-auth`) or data-changing endpoint (`api-write-no-auth`) in that file, or in a file that imports such a module, went unreported. Import and `require` lines no longer count; the helper has to appear in the code. A call whose result is never checked still counts; that needs the 0.5.0 engine. Scanning the 50 corpus apps shows no change.
|
|
98
|
+
- CLI tools that contain web-like sample code were misclassified as web apps. A project whose package.json declares a `bin` no longer counts as a website just because its source contains text like `"use server"` or `app.get(`, unless it depends on a server framework (Express, Fastify, Hono, Koa, NestJS or hapi), a frontend package or has an `index.html`. This removes the "No error tracking" warning from Launch Doctor's own scan.
|
|
99
|
+
- Public forms are matched by their whole name, not their first letters. `subscribe\w*` and `contact\w*` also exempted admin actions such as `subscribers_delete`, `contacts_export` and `contact_admin`, so a missing sign-in or ownership check on them went unreported. Now only the action itself is treated as public (`subscribe`, `unsubscribe`, `contact`, `contact_form`, `contact_submit`, `newsletter_signup`, `join_waitlist`, feedback, inquiry, `consume_link`, bounces, ping), and a name or URL that also says delete, update, edit, export, list, admin, remove or all is checked like any other endpoint. The same rule applies to URLs (`/api/contact/export`, `/api/contact_admin/:id`). Scanning the 50 corpus apps shows no other change.
|
|
100
|
+
- The pull request summary comment could go over GitHub's 65,536-character limit (with long paths, it reached 162,000 characters), and then GitHub refused it and no summary was posted. Its lists now get shorter until the comment fits (under 60,000 characters), long titles are cut at 300 characters, and a cut list says how many findings were left out and links to the run's job summary, which lists them all.
|
|
54
101
|
|
|
55
102
|
False alarms found by running Launch Doctor on 50 real open-source apps:
|
|
56
103
|
|
|
@@ -71,12 +118,6 @@ False alarms found by running Launch Doctor on 50 real open-source apps:
|
|
|
71
118
|
- SECURITY.md lists every network request Launch Doctor is expected to make: email DNS lookups, the `scan <url>` requests (including Supabase), the GitHub API calls for pull request comments, and the MCP server's tools.
|
|
72
119
|
- LICENSE, README and package.json credit Namay Singh for early development.
|
|
73
120
|
|
|
74
|
-
### Fixed
|
|
75
|
-
|
|
76
|
-
- Fix: CLI tools that contain web-like sample code were misclassified as web apps. A project whose package.json declares a `bin` no longer counts as a website just because its source contains text like `"use server"` or `app.get(`, unless it depends on a server framework (Express, Fastify, Hono, Koa, NestJS or hapi), a frontend package or has an `index.html`. This removes the "No error tracking" warning from Launch Doctor's own scan.
|
|
77
|
-
- Public forms are matched by their whole name, not their first letters. `subscribe\w*` and `contact\w*` also exempted admin actions such as `subscribers_delete`, `contacts_export` and `contact_admin`, so a missing sign-in or ownership check on them went unreported. Now only the action itself is treated as public (`subscribe`, `unsubscribe`, `contact`, `contact_form`, `contact_submit`, `newsletter_signup`, `join_waitlist`, feedback, inquiry, `consume_link`, bounces, ping), and a name or URL that also says delete, update, edit, export, list, admin, remove or all is checked like any other endpoint. The same rule applies to URLs (`/api/contact/export`, `/api/contact_admin/:id`). Scanning the 50 corpus apps shows no other change.
|
|
78
|
-
- The pull request summary comment could go over GitHub's 65,536-character limit (with long paths, it reached 162,000 characters), and then GitHub refused it and no summary was posted. Its lists now get shorter until the comment fits (under 60,000 characters), long titles are cut at 300 characters, and a cut list says how many findings were left out and links to the run's job summary, which lists them all.
|
|
79
|
-
|
|
80
121
|
## [0.3.0] - 2026-11-27
|
|
81
122
|
|
|
82
123
|
### Added
|
|
@@ -170,7 +211,9 @@ First release.
|
|
|
170
211
|
- `.launchdoctorignore` for silencing findings by id or skipping paths.
|
|
171
212
|
- Support for JavaScript / TypeScript and Python projects.
|
|
172
213
|
|
|
173
|
-
[Unreleased]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.
|
|
214
|
+
[Unreleased]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.2...HEAD
|
|
215
|
+
[0.4.2]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.1...v0.4.2
|
|
216
|
+
[0.4.1]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.0...v0.4.1
|
|
174
217
|
[0.4.0]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.3.0...v0.4.0
|
|
175
218
|
[0.3.0]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.2.1...v0.3.0
|
|
176
219
|
[0.2.1]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.2.0...v0.2.1
|