@alimaandev/ripple 0.6.0 → 0.7.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
@@ -21,7 +21,7 @@ Change less. Break less. Know the blast radius of any file before you touch it.
21
21
  # or try it without installing anything:
22
22
  npx @alimaandev/ripple analyze src/your-file.ts</code></pre>
23
23
 
24
- <img src="https://raw.githubusercontent.com/alimaandev/ripple/main/assets/hero.svg" alt="Terminal output of `ripple analyze` — risk, affected files, routes, components, tests, and confidence score" title="ripple analyze" width="100%" />
24
+ <img src="https://raw.githubusercontent.com/alimaandev/ripple/main/assets/hero-animated.svg" alt="Animated terminal demo of `ripple analyze` — command types in, then the report builds up: risk score with gauge, affected files, routes, components, tests, and confidence" title="ripple analyze" width="100%" />
25
25
 
26
26
  </div>
27
27
 
@@ -100,7 +100,7 @@ Everything below is real output against a shipped example project in `tests/fixt
100
100
  ```bash
101
101
  npm install -g @alimaandev/ripple
102
102
 
103
- ripple version # → 0.6.0
103
+ ripple version # → 0.7.0
104
104
  ```
105
105
 
106
106
  Or install from source:
@@ -132,7 +132,7 @@ ripple analyze src/authentication/login.ts
132
132
  Expected output:
133
133
 
134
134
  ```text
135
- ripple · impact analysis · v0.6.0
135
+ ripple · impact analysis · v0.7.0
136
136
 
137
137
  File src/authentication/login.ts
138
138
  Risk MEDIUM · 34.7/100 ███░░░░░░░
@@ -165,7 +165,7 @@ ripple graph
165
165
  ```
166
166
 
167
167
  ```text
168
- ripple · dependency graph · v0.6.0
168
+ ripple · dependency graph · v0.7.0
169
169
 
170
170
  Files 25
171
171
  Edges 28
@@ -219,6 +219,7 @@ ripple <command> [options]
219
219
  | Command | Flag | Description |
220
220
  | --------- | --------------------- | ---------------------------------------------------------------------------------------------- |
221
221
  | `analyze` | `-j, --json` | Emit the JSON report instead of the terminal report |
222
+ | `analyze` | `--sarif` | Emit a SARIF 2.1.0 report for code scanning |
222
223
  | `analyze` | `-v, --verbose` | Include the risk-factor point breakdown |
223
224
  | `analyze` | `-d, --depth <n>` | Cap the reverse traversal at `n` levels |
224
225
  | `analyze` | `-c, --config <path>` | Use a specific config file |
@@ -235,11 +236,16 @@ ripple <command> [options]
235
236
  | `diff` | `-j, --json` | Emit the JSON report instead of the terminal report |
236
237
  | `diff` | `-b, --base <ref>` | Git ref to diff against (default: `origin/main`, `main`, `HEAD~1`, or `diff.base` from config) |
237
238
  | `diff` | `-g, --gate <level>` | Blocking level: `medium`, `high`, or `critical` (default: `high`, or `diff.gate` from config) |
238
- | `diff` | `-f, --format <fmt>` | Output: `terminal`, `json`, or `github` (workflow annotations) |
239
+ | `diff` | `-f, --format <fmt>` | Output: `terminal`, `json`, `github` (workflow annotations), or `sarif` |
239
240
  | `diff` | `-d, --depth <n>` | Cap reverse traversal per file |
240
241
  | `diff` | `-c, --config <path>` | Use a specific config file |
241
242
  | `diff` | `--no-color` | Disable ANSI colors |
242
243
 
244
+ ### `ripple mcp`
245
+
246
+ Serve Ripple's analysis tools over the Model Context Protocol (see
247
+ [the MCP section](#ripple-mcp-1) below).
248
+
243
249
  ### `ripple doctor`
244
250
 
245
251
  Independent health checks — config validity, tsconfig presence, source
@@ -333,6 +339,57 @@ verdict, so the job fails when the gate blocks:
333
339
  (`--json` is shorthand for `--format json`; the format flag also accepts
334
340
  `terminal`, the default.)
335
341
 
342
+ `--format sarif` emits SARIF 2.1.0, the format GitHub Code Scanning speaks:
343
+
344
+ ```bash
345
+ ripple diff --format sarif > ripple.sarif
346
+ ```
347
+
348
+ Each analyzed change becomes a finding on the file — `error` when it is
349
+ CRITICAL/HIGH, `warning` for MEDIUM, `note` for LOW — with a stable
350
+ `primaryLocationLineHash` fingerprint so results deduplicate across runs.
351
+ Allowlisted files are emitted as `note` with an in-source suppression, so
352
+ they show as exempted rather than failing. Upload the report straight into
353
+ Code Scanning alerts:
354
+
355
+ ```yaml
356
+ - uses: actions/upload-sarif@v3
357
+ with:
358
+ sarif_file: ripple.sarif
359
+ ```
360
+
361
+ The exit code still carries the gate verdict regardless of format.
362
+
363
+ ### `ripple mcp`
364
+
365
+ `ripple mcp` exposes Ripple's analysis to AI coding agents as a Model
366
+ Context Protocol server over stdio. Point any MCP client at the command and
367
+ the agent can check a file's blast radius before touching it:
368
+
369
+ ```json
370
+ {
371
+ "mcpServers": {
372
+ "ripple": { "command": "npx", "args": ["@alimaandev/ripple", "mcp"] }
373
+ }
374
+ }
375
+ ```
376
+
377
+ Four tools are served:
378
+
379
+ | Tool | Inputs | Returns |
380
+ | ------------- | ------------------- | ----------------------------------------------------------------------- |
381
+ | `impact` | `file`, `maxDepth?` | Blast radius: affected files, routes, tests, components, risk level |
382
+ | `dependents` | `file`, `depth?` | Who imports the file, up to a depth (default 1, direct) |
383
+ | `risk` | `file` | Risk score with the factor breakdown behind it |
384
+ | `gate_status` | `base?`, `gate?` | Current change set vs the merge gate: files, levels, pass/block verdict |
385
+
386
+ A typical agent loop: `impact src/auth/session.ts` before refactoring,
387
+ `dependents` to see who breaks, then `gate_status` after editing to confirm
388
+ the gate still passes. Tool results are JSON text; failures return
389
+ `isError` results instead of crashing the session.
390
+
391
+ <img src="https://raw.githubusercontent.com/alimaandev/ripple/main/assets/mcp-demo.svg" alt="Flow diagram — an AI agent calls impact on src/auth/session.ts through ripple mcp and gets the blast radius back: 7 affected files, 4 routes, MEDIUM risk" title="ripple mcp flow" width="100%" />
392
+
336
393
  ## Configuration
337
394
 
338
395
  Ripple discovers `ripple.config.ts`, `.js`, `.cjs`, `.mjs`, or `.json` in the