@codacy/verity-cli 0.23.0 → 0.23.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/bin/verity.js CHANGED
@@ -16317,7 +16317,7 @@ function registerTelemetryCommands(program2) {
16317
16317
  }
16318
16318
 
16319
16319
  // src/cli.ts
16320
- program.name("verity").description("CLI for Verity quality gate service").version("0.23.0").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr");
16320
+ program.name("verity").description("CLI for Verity quality gate service").version("0.23.1").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr");
16321
16321
  registerAuthCommands(program);
16322
16322
  registerHooksCommands(program);
16323
16323
  registerIntentCommands(program);
@@ -75,6 +75,32 @@ Default to `balanced` if the user says "default" or doesn't specify a preference
75
75
 
76
76
  ---
77
77
 
78
+ ## Step 3a: Choose analysis moments
79
+
80
+ This decides **when** Verity reviews code. Use the **AskUserQuestion** tool with
81
+ `multiSelect: true`:
82
+
83
+ > **When should Verity review your code? (select all that apply)**
84
+ > - **On stop** (recommended) — after every agent turn. Fast feedback while you work.
85
+ > - **Before commit** — gates `git commit`; reviews the **staged** diff and blocks the commit on FAIL.
86
+ > - **Before push / PR** — gates `git push` and `gh pr create`; reviews the **to-be-pushed** commits and blocks on FAIL.
87
+ >
88
+ > Default: **On stop**
89
+
90
+ Notes to convey if asked:
91
+ - The git-moment gates run an independent reviewer at the boundary the customer cares
92
+ about; a FAIL blocks the commit/push so the agent fixes issues before they land
93
+ (capped at 2 review cycles so you're never stuck).
94
+ - These are **Claude Code** hooks (they fire when the agent runs `git commit`/`git push`),
95
+ not native git hooks — no `.git/hooks` files, no GitHub App.
96
+ - "On stop" alone matches today's behavior. Many teams pick **Before commit + Before push**
97
+ and turn **On stop** off to review only at real boundaries.
98
+
99
+ Map the selection to moment ids: On stop → `stop`, Before commit → `pre-commit`,
100
+ Before push/PR → `pre-push`. Remember this list; you apply it in **Step 9**.
101
+
102
+ ---
103
+
78
104
  ## Step 3b: Ask about cost & usage telemetry (opt-in)
79
105
 
80
106
  Cost & usage observability is **opt-in** and **required** for the `/usage` dashboard — all
@@ -414,27 +440,37 @@ These blocks enable two capabilities:
414
440
 
415
441
  ---
416
442
 
417
- ## Step 9: Verify hooks
443
+ ## Step 9: Wire the selected moments
418
444
 
419
- The installer already wired the Claude Code hooks via `verity hooks install`. Verify they're in place:
445
+ Apply the moments the user chose in **Step 3a**. Pass the comma-separated moment ids
446
+ (always include the always-on intent hook automatically):
447
+
448
+ ```bash
449
+ # Example: user chose On stop + Before commit + Before push
450
+ verity hooks install --moments stop,pre-commit,pre-push
451
+ ```
452
+
453
+ `--moments` reconciles Verity's own hooks in `.claude/settings.json` to **exactly**
454
+ the selection (adding the git-moment gate, removing the Stop hook if unselected),
455
+ while preserving every non-Verity hook. The `verity intent capture` hook is always
456
+ installed. If the user picked only `stop` (the default), pass `--moments stop`.
457
+
458
+ Then verify:
420
459
 
421
460
  ```bash
422
461
  verity hooks check
423
462
  ```
424
463
 
425
- Expected output:
464
+ Expected output (for `stop,pre-commit,pre-push`):
426
465
  ```
427
466
  [verity] Stop hook (verity analyze): installed
428
467
  [verity] Intent hook (verity intent capture): installed
468
+ [verity] Git-moment gate (verity guard): installed [commit, push]
429
469
  ```
430
470
 
431
- If hooks are missing (e.g., user installed manually without the installer), install them:
432
-
433
- ```bash
434
- verity hooks install
435
- ```
436
-
437
- This wires both the Stop hook (`verity analyze`) and UserPromptSubmit hook (`verity intent capture`) into `.claude/settings.json`, preserving any existing hooks.
471
+ The git-moment gate is a single `PreToolUse(Bash)` hook (`verity guard`) that
472
+ intercepts `git commit` / `git push` / `gh pr create` and reviews the staged or
473
+ to-be-pushed diff before it lands.
438
474
 
439
475
  ---
440
476
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/verity-cli",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "CLI for Verity quality gate service",
5
5
  "homepage": "https://verity.md",
6
6
  "repository": {