@codacy/verity-cli 0.31.3 โ†’ 0.32.0-experimental.5e53cb9

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 CHANGED
@@ -24,6 +24,16 @@ installs and updates it for you.
24
24
  plugin is present it owns the hooks, and the settings.json copy stands down.
25
25
  `verity init` detects the plugin and removes the duplicate wiring.
26
26
 
27
+ ### ๐Ÿšช A project that was never set up is left alone
28
+
29
+ Every hook now asks the same question the same way. `verity analyze` used to run
30
+ in a project that had never seen `verity init`, create `.verity/` there, and then โ€”
31
+ with no baseline to compare against โ€” review nothing. It now stands down like the
32
+ other hooks always have, so installing Verity no longer scatters state through
33
+ directories you merely opened. On the first session in such a project, Claude is
34
+ told once that the gate is off here and can offer `/verity:setup` (or `verity init`
35
+ on an npm install). Works correctly from linked git worktrees.
36
+
27
37
  ### โš™๏ธ Git-moment gating moved into the project
28
38
 
29
39
  `verity guard` now reads `.verity/config.json` instead of taking its moments from
@@ -32,6 +42,148 @@ default gates nothing** โ€” set it with `verity config git-moments commit,push`,
32
42
  answer the question in `verity init`. An explicit `--on` still wins, so existing
33
43
  installs are untouched.
34
44
 
45
+ Linked git worktrees inherit the setting from the main checkout: `.verity/` is
46
+ gitignored, so a fresh `git worktree add` had no config of its own and the guard
47
+ there gated nothing while `verity hooks check` said "wired but gating nothing".
48
+ A worktree's own `.verity/config.json`, when present, still wins โ€” including an
49
+ explicit `none` โ€” and `hooks check` names the file it inherited from.
50
+
51
+ ### ๐ŸŽฏ Setup finishes in one command
52
+
53
+ - **`verity init` now derives the Standard itself.** When the service has nothing
54
+ for this repository, the CLI reads the codebase โ€” languages counted, frameworks
55
+ read from the manifests (including nested ones, so a monorepo works),
56
+ architecture, build system, test framework โ€” and assembles
57
+ `.verity/standard.yaml`, `.codacy/codacy.config.json`, Verity's own ESLint
58
+ config and `VERITY.md`. Then it pushes them. No Claude Code session, no model
59
+ turn, about two seconds, and it works offline.
60
+ - **This closes a real hole.** Without a Standard, `analyze` answers
61
+ `400 STANDARD_NOT_FOUND` โ€” so a user who ran `verity init`, started working and
62
+ never ran `/verity-setup` got an error on every agent turn and static-only
63
+ findings, in a project init had just called set up.
64
+ - **The service still has first refusal.** If this repository already has a
65
+ Standard it is offered and adopted exactly as before; derivation is strictly
66
+ what happens when there is nothing to adopt. A local `standard.yaml` is never
67
+ overwritten without `--force`.
68
+ - **An adopted Standard with no analysis config now gets one**, derived from the
69
+ Standard's own declared languages and mode โ€” filling the gap without
70
+ re-authoring the team's rules as a competing version.
71
+ - **New: `verity standard synthesize`** (`--intensity`, `--force`, `--push`) โ€” the
72
+ same derivation on demand.
73
+ - **`--config-only` rewrites just the analysis config** from the Standard already
74
+ in place. Existing projects need it: a stale config is common, and the only
75
+ other way to rewrite one was `--force`, which also replaces the Standard โ€”
76
+ deleting hand-written `custom_patterns` to fix a file that was not the problem.
77
+ - `verity doctor`'s advice is a command now, not "open Claude Code".
78
+
79
+ **What is NOT derived:** `custom_patterns` stays empty. Project-specific rules are
80
+ the one part of synthesis that reads for intent rather than for facts, and
81
+ plausible-sounding rules invented from a dependency list would be enforced on
82
+ every turn without anyone having agreed to them. `/verity-setup` remains for
83
+ exactly that, and a later pass will propose them server-side.
84
+
85
+ **The catalogue is re-derived, and an audit found more than two lists wrong.**
86
+ Checking every curated list against the installed adapters: ESLint9 (25) and
87
+ shellcheck (14) were already exact; **Ruff** (20) needed the adapter's slug,
88
+ **Bandit** (10) and **Hadolint** (8) were missing their tool prefix โ€” all 38 are
89
+ now written as the adapter spells them. **PMD7's 12 cannot be fixed
90
+ mechanically**: they are bare rule names and the adapter's are
91
+ category-qualified, and the suffix is ambiguous across languages
92
+ (`UnusedLocalVariable` exists under both `_apex_` and `_java_`), so picking one
93
+ would enable a rule that can never fire. That is recorded in the catalogue the way
94
+ Semgrep's gap already was, and the CLI drops PMD7 rather than configuring it.
95
+
96
+ **A pinned slug still survives a rename.** Full spellings are right for a model
97
+ copying from the catalogue, but a slug is the adapter's prose and changes between
98
+ versions โ€” so an id also resolves by its stable head (`Ruff_F401`), and a pinned
99
+ long form that stops matching is not silently dropped.
100
+
101
+ **Your analysis config heals itself on upgrade.** `verity init` now validates an
102
+ existing config's ids and re-derives it from your Standard when the validator says
103
+ they no longer resolve โ€” and only then: a config that cannot be checked (no
104
+ analysis adapter on the machine, which is an ordinary state since that install is
105
+ allowed to fail) is reported as unverified and left exactly alone, never rewritten
106
+ on a guess โ€” the Standard is never touched, because it may carry hand-written
107
+ `custom_patterns` and it is not the file with the problem. `verity doctor` reports
108
+ the same state read-only (`โš  ids do not resolve`) so it is visible without running
109
+ anything. This is the path that matters for existing projects: an id that matches
110
+ nothing disables its whole tool while reporting zero issues.
111
+
112
+ **Carried into code, and now tested.** The analysis-config knowledge used to live
113
+ in the skill's markdown for a model to follow: `patterns: []` means "all 2,900
114
+ rules" rather than "none"; a mistyped pattern id disables a tool while reporting
115
+ zero issues; ESLint must not be pointed at the project's own config or Verity's
116
+ rule list degrades into a filter over it (VRT-108); Semgrep's ids are deliberately
117
+ not derived yet, so the tool is dropped rather than configured empty. Every one of
118
+ those is now an assertion.
119
+
120
+ ### โŒจ๏ธ The setup questions answer to arrow keys
121
+
122
+ - **`verity init` no longer asks you to type a number.** Analysis intensity and
123
+ the review moments are arrow-key lists: `โ†‘โ†“` to move, `space` to toggle a
124
+ moment, `enter` to confirm โ€” with the recommended answer already under the
125
+ cursor and the default set already ticked, so **Enter alone still gives exactly
126
+ what it gave before**.
127
+ - **Digits still work.** This prompt used to be "type a number", and muscle memory
128
+ should not be punished for an interface improvement โ€” a digit moves the cursor
129
+ rather than confirming, so it composes with the arrows instead of being a
130
+ second, hidden way to answer. `j`/`k` move too.
131
+ - **An empty moment selection is refused, not accepted.** Unticking everything and
132
+ pressing Enter says so instead of installing a review tool that reviews nothing
133
+ โ€” the same invariant the typed prompt held by falling back.
134
+ - **Three rungs of degradation, same default at each.** Arrow keys on a real
135
+ terminal; the typed number prompt when the terminal cannot do raw mode; the
136
+ default when there is no terminal at all or stdin ends. An interface improvement
137
+ must not become a new way for a setup to get stuck โ€” CI, pipes and agent Bash
138
+ calls behave exactly as before.
139
+ - **The terminal is restored on every exit,** including Ctrl+C, which restores
140
+ before exiting: raw mode left on outlives the process and makes the user's next
141
+ shell prompt unusable.
142
+
143
+
144
+ ### ๐Ÿค Joining a project that already has a Standard
145
+
146
+ - **`verity init` now offers the Standard the service already holds** for this
147
+ repository, instead of asking a model to invent a second one. Everyone after the
148
+ first person on a project โ€” a teammate cloning the repo, the same person on
149
+ another machine, a CI box โ€” gets the team's actual configuration
150
+ (`standard.yaml`, the analysis config, `.verityignore`, `VERITY.md`) written
151
+ straight to disk, and the model phase is skipped entirely.
152
+ - **This is a correctness fix as much as a speed one.** `verity standard push`
153
+ auto-versions, so a re-synthesis does not produce a private copy โ€” it produces
154
+ v4, and v4 is what the team is held to from then on.
155
+ - **Nothing about it can block a setup.** No token, offline, a 404, a service that
156
+ errors: every one of those falls through to the regular flow. An unreliable
157
+ answer is never reported as "no Standard stored" โ€” that would offer a fresh
158
+ synthesis over one the team already agreed.
159
+ - Unattended runs (`--yes`, CI) adopt without asking, for the same reason: a CI
160
+ box quietly authoring a new version of the team's Standard is not an outcome
161
+ anyone would choose on purpose.
162
+ - **`--no-adopt` opts out**, for a script that wants a fresh synthesis on purpose.
163
+ It skips the request as well as the write: asking a question whose answer is
164
+ discarded is a network call the user declined, and in a locked-down CI it is one
165
+ that can fail loudly for no reason.
166
+ - **Declining is remembered per VERSION, never as a mute.** Say no and init stops
167
+ asking about *that* Standard โ€” and offers the next one, because a new version is
168
+ new information. A boolean "never again" would have been the familiar
169
+ silent-forever failure: decline on Monday meaning to synthesize later, forget,
170
+ and every later run stays quiet while the project has no local config at all.
171
+
172
+ ### ๐Ÿ”ง Fixed
173
+
174
+ - **An upgrade no longer removes the gates you chose.** `.verity/setup.json` only
175
+ exists from this release, so every project configured before it had no recorded
176
+ answer โ€” including everyone who picked commit/push gates through the old
177
+ `/verity-setup`. The first upgraded `verity init` fell back to the shipped
178
+ default and reconciled those gates away, turning Stop back on. What you chose is
179
+ still legible in `.claude/settings.json`, so init reads it.
180
+ - `verity doctor` names the artifact that is actually missing instead of telling
181
+ you to run a phase that will decline: with a Standard adopted and no analysis
182
+ config, `/verity-setup` would have answered "already configured".
183
+ - The setup skill learned the same case โ€” Standard present, analysis config
184
+ missing โ€” and writes only the config rather than re-synthesizing the Standard.
185
+
186
+
35
187
  **Setup is one command.** `verity init` and `/verity-setup` were two half-flows
36
188
  that overlapped โ€” and the overlap was not harmless: init wired the Stop hook,
37
189
  then the skill reconciled the hooks to a selection it asked for afterwards,
@@ -107,6 +259,51 @@ with one entry point.
107
259
  terminal (Ctrl+D, a pty that ends) falls back to the default instead of
108
260
  crashing init between copying the skills and wiring the hooks.
109
261
 
262
+ ### ๐Ÿ”’ Fixed โ€” four ways the gate could be off while reporting itself on
263
+
264
+ - **`git add x && git commit` was never reviewed.** A Claude Code hook runs
265
+ *before* the command, so the index it read had not had the `add` applied:
266
+ no files, and the gate's "nothing staged" exit โ€” a silent allow, with no
267
+ trace that a commit had gone unreviewed. It is the shape an agent writes by
268
+ default, so it was most of the pre-commit gate's coverage. The gate now works
269
+ out what the command will stage, using git's own pathspec matching, and
270
+ handles `git commit -a`. Where it cannot โ€” a pathspec the shell expands,
271
+ `git add -p` โ€” it says so and lets the commit through **loudly** rather than
272
+ reviewing a set it guessed at.
273
+ - **Uninstalling the Claude Code plugin left projects with no gate at all.**
274
+ Whether the plugin owned a project's hooks was decided by whether its install
275
+ directory existed โ€” and that directory survives an uninstall. Every project
276
+ the plugin had ever run in went on standing its own hooks down for a plugin
277
+ that was gone. Ownership now comes from Claude Code's install registry, and
278
+ `verity init` clears the stale marker.
279
+ - **`verity init` now says which mode it is in before it acts on it** โ€” the
280
+ plugin's hooks or this project's own โ€” with the install it found and
281
+ `--no-plugin` to overrule it. It does two opposite things depending on that
282
+ answer, and it used to make the choice silently.
283
+ - **A plugin installed from a local marketplace is recognised too.** Claude Code
284
+ runs a marketplace served from a *directory* out of that directory while
285
+ recording the cache copy it made, so the two paths disagree and a live,
286
+ gating install read as unverified โ€” every reporter then said "no analysis
287
+ moment is active" about a project the plugin was gating on every turn.
288
+ - **A repository can no longer switch the gate off by shipping a file.**
289
+ Ownership was claimed by `.verity/.plugin-active`, which is a file inside the
290
+ project. One naming any directory that happened to exist disabled every hook
291
+ in that project. An install Claude Code cannot vouch for is now ignored.
292
+ - **`verity status` and `verity doctor` agree with `verity hooks check`.** Under
293
+ the plugin both used to report "Stop: off" and tell you to install hooks that
294
+ were firing on every turn. All three read one answer now, and it is correct
295
+ from a subdirectory too.
296
+ - **A commit gate on a linked worktree gates what the main checkout gates.**
297
+ `.verity/config.json` is machine-local, so every `git worktree add` started
298
+ with no moments and reviewed nothing.
299
+ - **A verdict the client does not understand is no longer rendered as a pass.**
300
+ An absent or unrecognised gate decision โ€” a truncated response, a proxy error
301
+ page โ€” reached the "โœ“ PASS" line. It is reported as unreviewed.
302
+ - **`verity hooks install --moments <typo>` no longer removes every gate.**
303
+ Unrecognised moments were dropped, so a misspelling reconciled to nothing and
304
+ reported success. It is an error now; `--moments none` turns them off on
305
+ purpose.
306
+
110
307
  ## [0.31.3] โ€” 2026-09-03
111
308
 
112
309
  **After a rebase, Verity reviewed the wrong code.** When a branch was rebased
package/README.md CHANGED
@@ -10,10 +10,52 @@ cd your-project
10
10
  verity init
11
11
  ```
12
12
 
13
- `verity init` is the whole setup. It asks how deeply to review and when
14
- (on stop / before commit / before push), wires everything, offers the optional
15
- GitHub login โ€” then launches Claude Code to finish the half that needs a model:
16
- reading your codebase and synthesizing the Standard (`/verity-setup`).
13
+ `verity init` is the whole setup, and it finishes on its own โ€” no second tool, no
14
+ model turn. It asks how deeply to review and when (on stop / before commit /
15
+ before push) with arrow-key lists โ€” `โ†‘โ†“` to move, `space` to toggle, `enter` to
16
+ confirm, and Enter alone takes the recommended answers โ€” wires everything, offers
17
+ the optional GitHub login, and then gets this project a Standard: **the one your
18
+ team already has**, or one **derived from your codebase** if there isn't one yet.
19
+
20
+ When it's done the gate is live on your next Claude Code session. `/verity-setup`
21
+ is no longer part of setup; it is there when you want a model to propose
22
+ project-specific rules.
23
+
24
+ ### Where the Standard comes from
25
+
26
+ | Situation | What init does |
27
+ |---|---|
28
+ | The service has a Standard for this repo | offers it, and adopting writes it locally (see below) |
29
+ | It doesn't, or you declined, or you're offline | **derives one from your codebase** and pushes it when signed in |
30
+ | `.verity/standard.yaml` already exists | leaves it alone |
31
+
32
+ The derivation is a lookup, not a guess: languages and frameworks are counted and
33
+ read from your manifests, and the rules come from Verity's research-backed
34
+ patterns reference โ€” the same catalogue the setup skill uses. The one thing it
35
+ does not invent is **project-specific patterns** ("every route under `api/` uses
36
+ the auth middleware"); `custom_patterns` stays empty until a model proposes them
37
+ or you write them by hand.
38
+
39
+ ### Joining a project that already uses Verity
40
+
41
+ A Standard belongs to the project, not to your machine. So once you are signed in,
42
+ init asks the service whether this repository already has one:
43
+
44
+ ```
45
+ This repository already has a Standard on Verity: version 3, pushed by claude-code
46
+ on 2026-08-12 ยท with analysis config and .verityignore
47
+ Use the existing Standard? [Y/n]
48
+ ```
49
+
50
+ Say yes and it writes `.verity/standard.yaml`, `.codacy/codacy.config.json`,
51
+ `.verityignore` and `VERITY.md` straight from the service โ€” no model phase, and no
52
+ second version of your team's Standard (`verity standard push` auto-versions, so a
53
+ fresh synthesis would become the version everyone is held to). Say no and it stops asking about
54
+ that version โ€” and offers the next one, since a new version is new information.
55
+ With no Standard stored yet, the regular flow runs.
56
+ `--no-adopt` opts out of the whole check, including the request. Offline, signed out, or a service
57
+ that cannot answer: also the regular flow โ€” setup has never needed the network and
58
+ still doesn't.
17
59
 
18
60
  If Claude Code isn't on your PATH, or you're already inside a session, init prints
19
61
  the one command to run instead. `verity setup` is an alias for the same command.
@@ -22,6 +64,7 @@ the one command to run instead. `verity setup` is an alias for the same command.
22
64
  |------|-----|
23
65
  | `--yes` | Take the recommended answer for every question โ€” no prompts at all (CI, scripts, agents). Includes the GitHub login, whose unattended answer is **skip**: the project stays local-only until you run `verity login`. |
24
66
  | `--no-setup` | Stop after the deterministic phase; don't launch Claude Code |
67
+ | `--no-adopt` | Don't offer the Standard the service already holds for this repo โ€” synthesize a fresh one. Skips the request entirely |
25
68
  | `--force` | Overwrite the installed skills even when they differ |
26
69
 
27
70
  Run `verity doctor` any time to see prerequisites, which phase is done, the hook
@@ -72,8 +115,10 @@ No re-setup needed: your token, Standard, and run history all carry over.
72
115
  | Command | Description |
73
116
  |---------|-------------|
74
117
  | **Core** | |
75
- | `verity init` | Set up Verity in this project โ€” asks the setup questions, then hands off to `/verity-setup` (alias: `verity setup`) |
118
+ | `verity init` | Set up Verity in this project, end to end โ€” questions, wiring, and the Standard (alias: `verity setup`) |
76
119
  | `verity doctor` | Prerequisites, setup phase, hook wiring, and what is still missing (`--json` for the machine-readable report) |
120
+ | `verity standard synthesize` | Derive the Standard + analysis config from this codebase โ€” no model, no network (`--push`, `--force`) |
121
+ | `verity standard synthesize --config-only` | Rewrite only the analysis config, from the Standard already here โ€” the fix for a stale one |
77
122
  | `verity analyze` | Run analysis on changed files (stop hook) |
78
123
  | `verity analyze --mode <mode>` | Force analysis mode (standard/plan/debug/skip) |
79
124
  | `verity review --files <paths>` | On-demand analysis (advisory) |