@codacy/verity-cli 0.31.4 โ†’ 0.32.0-experimental.68ae2ee

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
@@ -42,6 +42,142 @@ default gates nothing** โ€” set it with `verity config git-moments commit,push`,
42
42
  answer the question in `verity init`. An explicit `--on` still wins, so existing
43
43
  installs are untouched.
44
44
 
45
+ ### ๐ŸŽฏ Setup finishes in one command
46
+
47
+ - **`verity init` now derives the Standard itself.** When the service has nothing
48
+ for this repository, the CLI reads the codebase โ€” languages counted, frameworks
49
+ read from the manifests (including nested ones, so a monorepo works),
50
+ architecture, build system, test framework โ€” and assembles
51
+ `.verity/standard.yaml`, `.codacy/codacy.config.json`, Verity's own ESLint
52
+ config and `VERITY.md`. Then it pushes them. No Claude Code session, no model
53
+ turn, about two seconds, and it works offline.
54
+ - **This closes a real hole.** Without a Standard, `analyze` answers
55
+ `400 STANDARD_NOT_FOUND` โ€” so a user who ran `verity init`, started working and
56
+ never ran `/verity-setup` got an error on every agent turn and static-only
57
+ findings, in a project init had just called set up.
58
+ - **The service still has first refusal.** If this repository already has a
59
+ Standard it is offered and adopted exactly as before; derivation is strictly
60
+ what happens when there is nothing to adopt. A local `standard.yaml` is never
61
+ overwritten without `--force`.
62
+ - **An adopted Standard with no analysis config now gets one**, derived from the
63
+ Standard's own declared languages and mode โ€” filling the gap without
64
+ re-authoring the team's rules as a competing version.
65
+ - **New: `verity standard synthesize`** (`--intensity`, `--force`, `--push`) โ€” the
66
+ same derivation on demand.
67
+ - **`--config-only` rewrites just the analysis config** from the Standard already
68
+ in place. Existing projects need it: a stale config is common, and the only
69
+ other way to rewrite one was `--force`, which also replaces the Standard โ€”
70
+ deleting hand-written `custom_patterns` to fix a file that was not the problem.
71
+ - `verity doctor`'s advice is a command now, not "open Claude Code".
72
+
73
+ **What is NOT derived:** `custom_patterns` stays empty. Project-specific rules are
74
+ the one part of synthesis that reads for intent rather than for facts, and
75
+ plausible-sounding rules invented from a dependency list would be enforced on
76
+ every turn without anyone having agreed to them. `/verity-setup` remains for
77
+ exactly that, and a later pass will propose them server-side.
78
+
79
+ **The catalogue is re-derived, and an audit found more than two lists wrong.**
80
+ Checking every curated list against the installed adapters: ESLint9 (25) and
81
+ shellcheck (14) were already exact; **Ruff** (20) needed the adapter's slug,
82
+ **Bandit** (10) and **Hadolint** (8) were missing their tool prefix โ€” all 38 are
83
+ now written as the adapter spells them. **PMD7's 12 cannot be fixed
84
+ mechanically**: they are bare rule names and the adapter's are
85
+ category-qualified, and the suffix is ambiguous across languages
86
+ (`UnusedLocalVariable` exists under both `_apex_` and `_java_`), so picking one
87
+ would enable a rule that can never fire. That is recorded in the catalogue the way
88
+ Semgrep's gap already was, and the CLI drops PMD7 rather than configuring it.
89
+
90
+ **A pinned slug still survives a rename.** Full spellings are right for a model
91
+ copying from the catalogue, but a slug is the adapter's prose and changes between
92
+ versions โ€” so an id also resolves by its stable head (`Ruff_F401`), and a pinned
93
+ long form that stops matching is not silently dropped.
94
+
95
+ **Your analysis config heals itself on upgrade.** `verity init` now validates an
96
+ existing config's ids and re-derives it from your Standard when the validator says
97
+ they no longer resolve โ€” and only then: a config that cannot be checked (no
98
+ analysis adapter on the machine, which is an ordinary state since that install is
99
+ allowed to fail) is reported as unverified and left exactly alone, never rewritten
100
+ on a guess โ€” the Standard is never touched, because it may carry hand-written
101
+ `custom_patterns` and it is not the file with the problem. `verity doctor` reports
102
+ the same state read-only (`โš  ids do not resolve`) so it is visible without running
103
+ anything. This is the path that matters for existing projects: an id that matches
104
+ nothing disables its whole tool while reporting zero issues.
105
+
106
+ **Carried into code, and now tested.** The analysis-config knowledge used to live
107
+ in the skill's markdown for a model to follow: `patterns: []` means "all 2,900
108
+ rules" rather than "none"; a mistyped pattern id disables a tool while reporting
109
+ zero issues; ESLint must not be pointed at the project's own config or Verity's
110
+ rule list degrades into a filter over it (VRT-108); Semgrep's ids are deliberately
111
+ not derived yet, so the tool is dropped rather than configured empty. Every one of
112
+ those is now an assertion.
113
+
114
+ ### โŒจ๏ธ The setup questions answer to arrow keys
115
+
116
+ - **`verity init` no longer asks you to type a number.** Analysis intensity and
117
+ the review moments are arrow-key lists: `โ†‘โ†“` to move, `space` to toggle a
118
+ moment, `enter` to confirm โ€” with the recommended answer already under the
119
+ cursor and the default set already ticked, so **Enter alone still gives exactly
120
+ what it gave before**.
121
+ - **Digits still work.** This prompt used to be "type a number", and muscle memory
122
+ should not be punished for an interface improvement โ€” a digit moves the cursor
123
+ rather than confirming, so it composes with the arrows instead of being a
124
+ second, hidden way to answer. `j`/`k` move too.
125
+ - **An empty moment selection is refused, not accepted.** Unticking everything and
126
+ pressing Enter says so instead of installing a review tool that reviews nothing
127
+ โ€” the same invariant the typed prompt held by falling back.
128
+ - **Three rungs of degradation, same default at each.** Arrow keys on a real
129
+ terminal; the typed number prompt when the terminal cannot do raw mode; the
130
+ default when there is no terminal at all or stdin ends. An interface improvement
131
+ must not become a new way for a setup to get stuck โ€” CI, pipes and agent Bash
132
+ calls behave exactly as before.
133
+ - **The terminal is restored on every exit,** including Ctrl+C, which restores
134
+ before exiting: raw mode left on outlives the process and makes the user's next
135
+ shell prompt unusable.
136
+
137
+
138
+ ### ๐Ÿค Joining a project that already has a Standard
139
+
140
+ - **`verity init` now offers the Standard the service already holds** for this
141
+ repository, instead of asking a model to invent a second one. Everyone after the
142
+ first person on a project โ€” a teammate cloning the repo, the same person on
143
+ another machine, a CI box โ€” gets the team's actual configuration
144
+ (`standard.yaml`, the analysis config, `.verityignore`, `VERITY.md`) written
145
+ straight to disk, and the model phase is skipped entirely.
146
+ - **This is a correctness fix as much as a speed one.** `verity standard push`
147
+ auto-versions, so a re-synthesis does not produce a private copy โ€” it produces
148
+ v4, and v4 is what the team is held to from then on.
149
+ - **Nothing about it can block a setup.** No token, offline, a 404, a service that
150
+ errors: every one of those falls through to the regular flow. An unreliable
151
+ answer is never reported as "no Standard stored" โ€” that would offer a fresh
152
+ synthesis over one the team already agreed.
153
+ - Unattended runs (`--yes`, CI) adopt without asking, for the same reason: a CI
154
+ box quietly authoring a new version of the team's Standard is not an outcome
155
+ anyone would choose on purpose.
156
+ - **`--no-adopt` opts out**, for a script that wants a fresh synthesis on purpose.
157
+ It skips the request as well as the write: asking a question whose answer is
158
+ discarded is a network call the user declined, and in a locked-down CI it is one
159
+ that can fail loudly for no reason.
160
+ - **Declining is remembered per VERSION, never as a mute.** Say no and init stops
161
+ asking about *that* Standard โ€” and offers the next one, because a new version is
162
+ new information. A boolean "never again" would have been the familiar
163
+ silent-forever failure: decline on Monday meaning to synthesize later, forget,
164
+ and every later run stays quiet while the project has no local config at all.
165
+
166
+ ### ๐Ÿ”ง Fixed
167
+
168
+ - **An upgrade no longer removes the gates you chose.** `.verity/setup.json` only
169
+ exists from this release, so every project configured before it had no recorded
170
+ answer โ€” including everyone who picked commit/push gates through the old
171
+ `/verity-setup`. The first upgraded `verity init` fell back to the shipped
172
+ default and reconciled those gates away, turning Stop back on. What you chose is
173
+ still legible in `.claude/settings.json`, so init reads it.
174
+ - `verity doctor` names the artifact that is actually missing instead of telling
175
+ you to run a phase that will decline: with a Standard adopted and no analysis
176
+ config, `/verity-setup` would have answered "already configured".
177
+ - The setup skill learned the same case โ€” Standard present, analysis config
178
+ missing โ€” and writes only the config rather than re-synthesizing the Standard.
179
+
180
+
45
181
  **Setup is one command.** `verity init` and `/verity-setup` were two half-flows
46
182
  that overlapped โ€” and the overlap was not harmless: init wired the Stop hook,
47
183
  then the skill reconciled the hooks to a selection it asked for afterwards,
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) |