@vibgrate/cli 2026.704.1 → 2026.708.1

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/DOCS.md CHANGED
@@ -16,6 +16,7 @@ For a quick overview, see the [README](./README.md). This document covers everyt
16
16
  - [Vulnerabilities and exposure attribution](#vulnerabilities-and-exposure-attribution)
17
17
  - [vg why](#vg-why)
18
18
  - [vg bisect](#vg-bisect)
19
+ - [vg fix](#vg-fix)
19
20
  - [vg baseline](#vg-baseline)
20
21
  - [vg report](#vg-report)
21
22
  - [vg sbom](#vg-sbom)
@@ -39,7 +40,7 @@ For a quick overview, see the [README](./README.md). This document covers everyt
39
40
  - [vg tests](#vg-tests)
40
41
  - [vg embed](#vg-embed)
41
42
  - [vg export](#vg-export)
42
- - [Upgrade Drift Score](#upgrade-drift-score)
43
+ - [DriftScore](#driftscore)
43
44
  - [Drift Baselines & Fitness Functions](#drift-baselines--fitness-functions)
44
45
  - [How the Score Is Calculated](#how-the-score-is-calculated)
45
46
  - [Risk Levels](#risk-levels)
@@ -90,7 +91,7 @@ Vibgrate recursively scans your repository for `package.json` (Node/TypeScript),
90
91
  1. **Detects** the runtime version, target framework, and all dependencies
91
92
  2. **Queries** the npm/NuGet registry for latest stable versions (with built-in caching and concurrency control)
92
93
  3. **Computes** how far behind each component is — major version lag, EOL proximity, dependency age distribution
93
- 4. **Generates** a deterministic Upgrade Drift Score (0–100)
94
+ 4. **Generates** a deterministic DriftScore (0–100)
94
95
  5. **Produces** findings, a full JSON artifact, and optional SARIF output
95
96
 
96
97
  Core drift analysis does not execute source code. Optional security scanners can run lightweight secret heuristics and local toolchain checks. Vibgrate Cloud upload remains optional.
@@ -294,6 +295,91 @@ Exit codes: `0` when the query resolves, `2` when `--assert` finds the constrain
294
295
 
295
296
  ---
296
297
 
298
+ ### vg fix
299
+
300
+ Turn a drift scan into ranked, risk-tiered upgrade plans and **apply** the one
301
+ you choose — bringing packages up to date with confidence.
302
+
303
+ `vg fix` uses the hosted Vibgrate planner, so it needs a login: run `vg login`
304
+ (or set `VIBGRATE_DSN`). The CLI only measures your project locally — your source
305
+ never leaves your machine; only dependency versions and the aggregate usage
306
+ signals the planner needs are sent.
307
+
308
+ ```bash
309
+ vg login # once, to authenticate
310
+ vg fix # analyse, then choose/apply a plan
311
+ vg fix --dry-run # show exactly what would change, apply nothing
312
+ vg fix --plan safe --yes # apply a specific plan non-interactively (CI)
313
+ vg fix --no-apply # only print the plans
314
+ vg fix --format json # machine-readable report for CI or an agent (no apply)
315
+ ```
316
+
317
+ **Applying.** When there's more than one plan, `vg fix` shows them and asks which
318
+ to apply; with a single plan it applies it directly. Applying runs your project's
319
+ own package manager (pnpm/npm/yarn/bun, pip, cargo, go, composer, dotnet, dart, …)
320
+ to pin each target version — editing the manifest and installing in one step.
321
+ Ecosystems without a clean one-shot pin (e.g. Maven/Gradle) are reported for a
322
+ manual edit rather than skipped silently. Changes are local and git-reversible;
323
+ use `--dry-run` to preview, `--no-apply` to never touch the project, `--yes`/
324
+ `--plan` for non-interactive runs. `--format json`/`md` are report-only.
325
+
326
+ It reads the last scan artifact (`.vibgrate/scan_result.json`); if there isn't
327
+ one it runs a drift scan first, skipping the code map. Every drifted dependency —
328
+ across all supported ecosystems (npm, PyPI, Go, Cargo, Maven/Gradle, NuGet,
329
+ Composer, RubyGems, pub, Hex, …) — is sent to the planner, which builds three
330
+ plans and names the categorical best one:
331
+
332
+ - **Low-risk** — patch and minor updates only, limited to lightly-used packages
333
+ with no breaking-change signals and no dependency conflicts.
334
+ - **Balanced** — the low-risk set plus single, clean major upgrades.
335
+ - **Full** — everything to latest stable, except upgrades that are mutually
336
+ incompatible at those versions.
337
+
338
+ The analysis runs in two phases. A fast pass classifies every upgrade
339
+ (patch / minor / major) and measures its blast radius from how heavily the
340
+ package is used in your source. When major upgrades are involved it goes deeper:
341
+ it checks npm peer dependencies to find packages that **cannot** upgrade together
342
+ (e.g. `react-dom@18` needs `react@18`), scans the intervening releases for
343
+ breaking-change signals, and considers the API surface — the classes and
344
+ functions your code imports — that a new version must preserve.
345
+
346
+ Security is folded in with **real-world exploitability**. Each upgrade is checked
347
+ against OSV in both directions (advisories **remediated** vs. **introduced**), and
348
+ current-version advisories are cross-referenced with the **CISA KEV** (known-
349
+ exploited) list and **FIRST EPSS** (exploit-probability) scores. A package with a
350
+ known-exploited advisory is treated as must-fix, so the recommendation prioritises
351
+ "fix these few" over churning everything. Advisories with no upgrade path in any
352
+ plan are called out as unresolved.
353
+
354
+ Each plan also shows an **expected DriftScore** — the estimated score after the
355
+ plan lands — so you can weigh drift-reduction payoff against risk (e.g. *Low-risk:
356
+ 58 → 54; Full: 58 → 31*). Where a package has a known upgrade **playbook**, the
357
+ plan surfaces its codemod (e.g. `ng update`).
358
+
359
+ The recommendation is deterministic. When known-exploited or high/critical
360
+ advisories are open, `vg fix` recommends the lowest-risk plan that clears them —
361
+ so if a patch closes a critical CVE, that's the plan it points you to rather than
362
+ a sweeping major bump. With nothing severe outstanding, it prefers the least
363
+ disruptive plan.
364
+
365
+ | Flag | Meaning |
366
+ |---|---|
367
+ | `--format <text\|json\|md>` | Output format (default `text`; `json`/`md` are report-only, no apply). |
368
+ | `--in <file>` | Scan artifact to read (default `.vibgrate/scan_result.json`, resolved against the analysed path). |
369
+ | `--dsn <dsn>` | DSN token (or use `VIBGRATE_DSN` / `vg login`). |
370
+ | `--region <region>` | Override data residency region (`us`, `eu`). |
371
+ | `--plan <tier>` | Apply a specific plan non-interactively (`safe`/`balanced`/`aggressive`). |
372
+ | `--yes` | Apply the recommended plan without prompting. |
373
+ | `--dry-run` | Show what would change without applying. |
374
+ | `--no-apply` | Only print the plans; never modify the project. |
375
+ | `--repository-name <name>` | Override the repository name recorded for this plan. |
376
+ | `--fail-on-vulns <severity>` | Exit non-zero if the recommended plan leaves an advisory at or above this severity unresolved. |
377
+
378
+ Exit codes: `0` on success, `2` when `--fail-on-vulns` finds an unresolved
379
+ advisory at or above the threshold or an apply step fails.
380
+
381
+ ---
382
+
297
383
  ### vg baseline
298
384
 
299
385
  Create a drift baseline snapshot for delta comparison.
@@ -777,11 +863,11 @@ Recommended workflow:
777
863
 
778
864
  This makes drift a formal quality gate (fitness function), not just reporting.
779
865
 
780
- ## Upgrade Drift Score
866
+ ## DriftScore
781
867
 
782
868
  ### How the Score Is Calculated
783
869
 
784
- The Upgrade Drift Score is a deterministic, versioned metric (0–100) that represents how far behind your codebase is relative to the current stable ecosystem baseline.
870
+ The DriftScore is a deterministic, versioned metric (0–100) that represents how far behind your codebase is relative to the current stable ecosystem baseline.
785
871
 
786
872
  **Lower score = healthier upgrade posture.** 0 means no drift (fully current); 100 means maximum drift. Higher is worse.
787
873
 
package/README.md CHANGED
@@ -20,7 +20,7 @@
20
20
  `vg` answers two questions for any repo:
21
21
 
22
22
  1. **What is this codebase?** — A deterministic code graph: call trees, import paths, impact surfaces, dependency facts.
23
- 2. **How far behind is it?** — A ranked **Upgrade Drift Score** (0–100) with runtime/framework lag, dependency age and EOL proximity, and a prioritised fix list.
23
+ 2. **How far behind is it?** — A ranked **DriftScore** (0–100) with runtime/framework lag, dependency age and EOL proximity, and a prioritised fix list.
24
24
 
25
25
  Everything runs **on your machine**. No API key, no network call, no data leaving your repo unless you explicitly push. The `vibgrate` command is an alias for `vg` — they are interchangeable.
26
26
 
@@ -0,0 +1,6 @@
1
+ export { baselineCommand, runBaseline } from './chunk-FMCI3MXH.js';
2
+ import './chunk-SRWMZBLG.js';
3
+ import './chunk-RXP66R2E.js';
4
+ import './chunk-GI6W53LM.js';
5
+ //# sourceMappingURL=baseline-RRO4NNNF.js.map
6
+ //# sourceMappingURL=baseline-RRO4NNNF.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-FESLZK5O.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"baseline-RRO4NNNF.js"}