launch-doctor 0.4.1 → 0.4.3

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +46 -1
  2. package/README.md +90 -432
  3. package/dist/src/banner.d.ts +22 -0
  4. package/dist/src/banner.js +35 -0
  5. package/dist/src/baseline.d.ts +9 -0
  6. package/dist/src/baseline.js +26 -0
  7. package/dist/src/bin.cjs +35 -0
  8. package/dist/src/bin.d.cts +2 -0
  9. package/dist/src/checks/access.js +8 -0
  10. package/dist/src/checks/costs.js +6 -0
  11. package/dist/src/checks/database.js +29 -0
  12. package/dist/src/checks/payments.js +12 -0
  13. package/dist/src/checks/secrets.d.ts +26 -1
  14. package/dist/src/checks/secrets.js +245 -5
  15. package/dist/src/cli.js +352 -57
  16. package/dist/src/core.d.ts +85 -0
  17. package/dist/src/core.js +166 -0
  18. package/dist/src/explanations.d.ts +24 -0
  19. package/dist/src/explanations.js +562 -0
  20. package/dist/src/fixes.d.ts +8 -1
  21. package/dist/src/fixes.js +31 -10
  22. package/dist/src/grade.d.ts +8 -1
  23. package/dist/src/grade.js +13 -0
  24. package/dist/src/history.js +9 -2
  25. package/dist/src/hooks-setup.d.ts +26 -0
  26. package/dist/src/hooks-setup.js +115 -1
  27. package/dist/src/index.js +8 -2
  28. package/dist/src/init.d.ts +12 -0
  29. package/dist/src/init.js +55 -0
  30. package/dist/src/live.js +8 -3
  31. package/dist/src/mcp.d.ts +126 -11
  32. package/dist/src/mcp.js +285 -148
  33. package/dist/src/prompt.d.ts +23 -0
  34. package/dist/src/prompt.js +88 -0
  35. package/dist/src/report-md.d.ts +14 -0
  36. package/dist/src/report-md.js +71 -0
  37. package/dist/src/report.d.ts +12 -1
  38. package/dist/src/report.js +27 -15
  39. package/dist/src/short-report.d.ts +61 -0
  40. package/dist/src/short-report.js +246 -0
  41. package/dist/src/types.d.ts +33 -0
  42. package/dist/src/util.d.ts +2 -0
  43. package/dist/src/util.js +2 -0
  44. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -7,6 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.3] - 2026-12-04
11
+
12
+ ### Added
13
+
14
+ - **Every finding has a stable id** (`ref` in `--json`): 8 letters and digits from the rule, the file and the text of the line, the same on every scan while the finding is unchanged, even when the line moves. `launch-doctor prompt` accepts it as well as a number.
15
+ - **MCP tools to work through findings one at a time.** `scan_project` now returns a short list (at most 25 findings, critical first, each with its id, rule, file and line), the Security and Launch readiness grades, and coverage notes, instead of every fix prompt at once; text is capped at 12,000 characters. New tools: `explain_finding` (why it matters, how to confirm, how to fix, false-alarm hint), `fix_prompt` (the prompt for one finding), `rescan` (only the files of the given ids or paths, or the files changed since the last commit, and which ids are now fixed) and `grade_history`. They share one core with the CLI.
16
+ - `launch-doctor explain <n|id>` prints the same explanation in the terminal.
17
+ - **`--report`** writes `.launchdoctor/report.md`: every finding with why it matters, how to confirm it, how to fix it and when it is a false alarm, built from the same explanations. Each finding points to its fix prompt (`launch-doctor prompt N`) instead of copying it, and no secret value is written. The short report's Next lines point to it.
18
+ - **`init --mcp`** prints the exact `claude mcp add` command and ready JSON for Cursor and Claude Desktop; it edits no config file. `launch-doctor mcp [folder]` serves a given folder (Claude Desktop does not start servers in your project).
19
+ - `init` adds `.launchdoctor/` to `.gitignore` (creating the file if needed).
20
+ - **An explanation for every rule**, written once in `src/explanations.ts`: what it is, why it matters (what an attacker or a surprise bill looks like), how to confirm it by hand, how to fix it, and when it is a false alarm. A test fails if a rule has none.
21
+
22
+ ### Changed
23
+
24
+ - **The MCP server makes no network requests for a project scan** (no email DNS lookups; `offline` is accepted and ignored, and `domain` is gone). Only `scan_url` uses the network, with the address it is given. Every tool reads only inside the folder the server started in: a `path` outside it is refused.
25
+
26
+ ## [0.4.2] - 2026-12-04
27
+
28
+ ### Added
29
+
30
+ - **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.
31
+ - `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.
32
+ - 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.
33
+ - **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.
34
+ - `--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.
35
+ - `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.
36
+ - `LAUNCH_FIXES.md` starts with one prompt for all the critical problems.
37
+ - A progress line on scans that take more than a second, only in an interactive terminal, cleared before the report.
38
+ - 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.
39
+ - 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.
40
+
41
+ ### Changed
42
+
43
+ - **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.
44
+ - `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.
45
+ - `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.
46
+ - 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.
47
+ - New `docs/coverage.md` maps the checks to the OWASP Top 10 and says plainly what is not covered.
48
+
49
+ ### Fixed
50
+
51
+ - 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.
52
+
10
53
  ## [0.4.1] - 2026-12-04
11
54
 
12
55
  ### Added
@@ -184,7 +227,9 @@ First release.
184
227
  - `.launchdoctorignore` for silencing findings by id or skipping paths.
185
228
  - Support for JavaScript / TypeScript and Python projects.
186
229
 
187
- [Unreleased]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.1...HEAD
230
+ [Unreleased]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.3...HEAD
231
+ [0.4.3]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.2...v0.4.3
232
+ [0.4.2]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.1...v0.4.2
188
233
  [0.4.1]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.4.0...v0.4.1
189
234
  [0.4.0]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.3.0...v0.4.0
190
235
  [0.3.0]: https://github.com/SHARAJ379/Launch-Doctor/compare/v0.2.1...v0.3.0