@codacy/verity-cli 0.31.1-experimental.02b82ff โ†’ 0.31.1-experimental.4cbb87c

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
@@ -3,6 +3,221 @@
3
3
  All notable changes to Verity are documented here. This project follows
4
4
  [Semantic Versioning](https://semver.org/).
5
5
 
6
+ ## [Unreleased]
7
+
8
+ ### ๐ŸŽฏ Setup finishes in one command
9
+
10
+ - **`verity init` now derives the Standard itself.** When the service has nothing
11
+ for this repository, the CLI reads the codebase โ€” languages counted, frameworks
12
+ read from the manifests (including nested ones, so a monorepo works),
13
+ architecture, build system, test framework โ€” and assembles
14
+ `.verity/standard.yaml`, `.codacy/codacy.config.json`, Verity's own ESLint
15
+ config and `VERITY.md`. Then it pushes them. No Claude Code session, no model
16
+ turn, about two seconds, and it works offline.
17
+ - **This closes a real hole.** Without a Standard, `analyze` answers
18
+ `400 STANDARD_NOT_FOUND` โ€” so a user who ran `verity init`, started working and
19
+ never ran `/verity-setup` got an error on every agent turn and static-only
20
+ findings, in a project init had just called set up.
21
+ - **The service still has first refusal.** If this repository already has a
22
+ Standard it is offered and adopted exactly as before; derivation is strictly
23
+ what happens when there is nothing to adopt. A local `standard.yaml` is never
24
+ overwritten without `--force`.
25
+ - **An adopted Standard with no analysis config now gets one**, derived from the
26
+ Standard's own declared languages and mode โ€” filling the gap without
27
+ re-authoring the team's rules as a competing version.
28
+ - **New: `verity standard synthesize`** (`--intensity`, `--force`, `--push`) โ€” the
29
+ same derivation on demand.
30
+ - **`--config-only` rewrites just the analysis config** from the Standard already
31
+ in place. Existing projects need it: a stale config is common, and the only
32
+ other way to rewrite one was `--force`, which also replaces the Standard โ€”
33
+ deleting hand-written `custom_patterns` to fix a file that was not the problem.
34
+ - `verity doctor`'s advice is a command now, not "open Claude Code".
35
+
36
+ **What is NOT derived:** `custom_patterns` stays empty. Project-specific rules are
37
+ the one part of synthesis that reads for intent rather than for facts, and
38
+ plausible-sounding rules invented from a dependency list would be enforced on
39
+ every turn without anyone having agreed to them. `/verity-setup` remains for
40
+ exactly that, and a later pass will propose them server-side.
41
+
42
+ **The catalogue is re-derived, and an audit found more than two lists wrong.**
43
+ Checking every curated list against the installed adapters: ESLint9 (25) and
44
+ shellcheck (14) were already exact; **Ruff** (20) needed the adapter's slug,
45
+ **Bandit** (10) and **Hadolint** (8) were missing their tool prefix โ€” all 38 are
46
+ now written as the adapter spells them. **PMD7's 12 cannot be fixed
47
+ mechanically**: they are bare rule names and the adapter's are
48
+ category-qualified, and the suffix is ambiguous across languages
49
+ (`UnusedLocalVariable` exists under both `_apex_` and `_java_`), so picking one
50
+ would enable a rule that can never fire. That is recorded in the catalogue the way
51
+ Semgrep's gap already was, and the CLI drops PMD7 rather than configuring it.
52
+
53
+ **A pinned slug still survives a rename.** Full spellings are right for a model
54
+ copying from the catalogue, but a slug is the adapter's prose and changes between
55
+ versions โ€” so an id also resolves by its stable head (`Ruff_F401`), and a pinned
56
+ long form that stops matching is not silently dropped.
57
+
58
+ **Your analysis config heals itself on upgrade.** `verity init` now validates an
59
+ existing config's ids and re-derives it from your Standard when the validator says
60
+ they no longer resolve โ€” and only then: a config that cannot be checked (no
61
+ analysis adapter on the machine, which is an ordinary state since that install is
62
+ allowed to fail) is reported as unverified and left exactly alone, never rewritten
63
+ on a guess โ€” the Standard is never touched, because it may carry hand-written
64
+ `custom_patterns` and it is not the file with the problem. `verity doctor` reports
65
+ the same state read-only (`โš  ids do not resolve`) so it is visible without running
66
+ anything. This is the path that matters for existing projects: an id that matches
67
+ nothing disables its whole tool while reporting zero issues.
68
+
69
+ **Carried into code, and now tested.** The analysis-config knowledge used to live
70
+ in the skill's markdown for a model to follow: `patterns: []` means "all 2,900
71
+ rules" rather than "none"; a mistyped pattern id disables a tool while reporting
72
+ zero issues; ESLint must not be pointed at the project's own config or Verity's
73
+ rule list degrades into a filter over it (VRT-108); Semgrep's ids are deliberately
74
+ not derived yet, so the tool is dropped rather than configured empty. Every one of
75
+ those is now an assertion.
76
+
77
+ ### โŒจ๏ธ The setup questions answer to arrow keys
78
+
79
+ - **`verity init` no longer asks you to type a number.** Analysis intensity and
80
+ the review moments are arrow-key lists: `โ†‘โ†“` to move, `space` to toggle a
81
+ moment, `enter` to confirm โ€” with the recommended answer already under the
82
+ cursor and the default set already ticked, so **Enter alone still gives exactly
83
+ what it gave before**.
84
+ - **Digits still work.** This prompt used to be "type a number", and muscle memory
85
+ should not be punished for an interface improvement โ€” a digit moves the cursor
86
+ rather than confirming, so it composes with the arrows instead of being a
87
+ second, hidden way to answer. `j`/`k` move too.
88
+ - **An empty moment selection is refused, not accepted.** Unticking everything and
89
+ pressing Enter says so instead of installing a review tool that reviews nothing
90
+ โ€” the same invariant the typed prompt held by falling back.
91
+ - **Three rungs of degradation, same default at each.** Arrow keys on a real
92
+ terminal; the typed number prompt when the terminal cannot do raw mode; the
93
+ default when there is no terminal at all or stdin ends. An interface improvement
94
+ must not become a new way for a setup to get stuck โ€” CI, pipes and agent Bash
95
+ calls behave exactly as before.
96
+ - **The terminal is restored on every exit,** including Ctrl+C, which restores
97
+ before exiting: raw mode left on outlives the process and makes the user's next
98
+ shell prompt unusable.
99
+
100
+ ## [Unreleased]
101
+
102
+ ### ๐Ÿค Joining a project that already has a Standard
103
+
104
+ - **`verity init` now offers the Standard the service already holds** for this
105
+ repository, instead of asking a model to invent a second one. Everyone after the
106
+ first person on a project โ€” a teammate cloning the repo, the same person on
107
+ another machine, a CI box โ€” gets the team's actual configuration
108
+ (`standard.yaml`, the analysis config, `.verityignore`, `VERITY.md`) written
109
+ straight to disk, and the model phase is skipped entirely.
110
+ - **This is a correctness fix as much as a speed one.** `verity standard push`
111
+ auto-versions, so a re-synthesis does not produce a private copy โ€” it produces
112
+ v4, and v4 is what the team is held to from then on.
113
+ - **Nothing about it can block a setup.** No token, offline, a 404, a service that
114
+ errors: every one of those falls through to the regular flow. An unreliable
115
+ answer is never reported as "no Standard stored" โ€” that would offer a fresh
116
+ synthesis over one the team already agreed.
117
+ - Unattended runs (`--yes`, CI) adopt without asking, for the same reason: a CI
118
+ box quietly authoring a new version of the team's Standard is not an outcome
119
+ anyone would choose on purpose.
120
+ - **`--no-adopt` opts out**, for a script that wants a fresh synthesis on purpose.
121
+ It skips the request as well as the write: asking a question whose answer is
122
+ discarded is a network call the user declined, and in a locked-down CI it is one
123
+ that can fail loudly for no reason.
124
+ - **Declining is remembered per VERSION, never as a mute.** Say no and init stops
125
+ asking about *that* Standard โ€” and offers the next one, because a new version is
126
+ new information. A boolean "never again" would have been the familiar
127
+ silent-forever failure: decline on Monday meaning to synthesize later, forget,
128
+ and every later run stays quiet while the project has no local config at all.
129
+
130
+ ### ๐Ÿ”ง Fixed
131
+
132
+ - **An upgrade no longer removes the gates you chose.** `.verity/setup.json` only
133
+ exists from this release, so every project configured before it had no recorded
134
+ answer โ€” including everyone who picked commit/push gates through the old
135
+ `/verity-setup`. The first upgraded `verity init` fell back to the shipped
136
+ default and reconciled those gates away, turning Stop back on. What you chose is
137
+ still legible in `.claude/settings.json`, so init reads it.
138
+ - `verity doctor` names the artifact that is actually missing instead of telling
139
+ you to run a phase that will decline: with a Standard adopted and no analysis
140
+ config, `/verity-setup` would have answered "already configured".
141
+ - The setup skill learned the same case โ€” Standard present, analysis config
142
+ missing โ€” and writes only the config rather than re-synthesizing the Standard.
143
+
144
+ ## [Unreleased]
145
+
146
+ **Setup is one command.** `verity init` and `/verity-setup` were two half-flows
147
+ that overlapped โ€” and the overlap was not harmless: init wired the Stop hook,
148
+ then the skill reconciled the hooks to a selection it asked for afterwards,
149
+ silently removing what init had just reported installing. They are now one flow
150
+ with one entry point.
151
+
152
+ ### ๐ŸŽฏ `verity init` is the whole setup
153
+
154
+ - **It asks the questions whose answers it acts on** โ€” analysis intensity, when
155
+ to review (on stop / before commit / before push), and cost & usage telemetry.
156
+ On the terminal, before anything is wired to them.
157
+ - **Then it hands off to Claude Code** to finish the half that needs a model:
158
+ reading the codebase and synthesizing the Standard (`/verity-setup`). If Claude
159
+ Code isn't installed, or you are already inside a session, it prints the one
160
+ command instead. `verity setup` is an alias for the same command.
161
+ - **`--yes` takes every recommended answer and asks nothing** (CI, scripts,
162
+ agents) โ€” including the GitHub login, whose unattended answer is skip, so the
163
+ project stays local-only until you run `verity login`. `--no-setup` stops after
164
+ the deterministic phase. A re-run keeps the answers you gave interactively
165
+ instead of resetting them to the defaults.
166
+ - **The hooks are written ONCE, to your selection.** Init reconciles instead of
167
+ installing-then-being-reconciled, so a project that chose commit+push no longer
168
+ gets a Stop hook installed and then removed. The always-on infra hooks (intent,
169
+ baseline, post-compact, session-end) are wired by that same path โ€” previously
170
+ only the legacy installer added the last two, and `verity uninstall` left them
171
+ behind.
172
+
173
+ ### ๐Ÿฉบ `verity doctor`
174
+
175
+ - **New command: what is set up here, and what is missing.** Prerequisites, which
176
+ phase has run, your recorded answers, the hook wiring, telemetry, and the
177
+ artifacts โ€” plus a `next` list. `--json` is what `/verity-setup` reads, so the
178
+ skill no longer re-implements init's prerequisite checks (its own version told
179
+ you to install the analysis CLI by hand, which init had already installed for
180
+ you).
181
+
182
+ ### โœจ It looks like something now
183
+
184
+ - **A wordmark on `verity init`**, and the flow is drawn as what it is: `Phase 1 of
185
+ 2 ยท this machine`, then `Phase 2 of 2 ยท your Standard`. Steps are numbered
186
+ `[n/8]`, so a run that stops tells you where.
187
+ - **Spinners on the two waits that are actually long** โ€” the global install of
188
+ `@codacy/analysis-cli`, and the GitHub device flow, where the elapsed clock is
189
+ the difference between "waiting for you to approve" and a terminal that looks
190
+ hung. Nowhere else: seven of init's eight steps take milliseconds, and a spinner
191
+ on an instant step claims work that isn't happening. No progress bars either โ€”
192
+ no step has a real percentage, so a bar would be an animation of a guess.
193
+ - **The handoff to `/verity-setup` is framed and then verified.** Before: what
194
+ phase 2 does and roughly how long. After: what it actually produced, read from
195
+ disk (`standard.yaml`, the analysis config, `VERITY.md`), with elapsed time โ€” so
196
+ quitting that session early no longer leaves you with no statement of what got
197
+ done. (No spinner over it: the Claude Code session owns the terminal and draws
198
+ its own status, so ours would be painting blind.)
199
+ - **Colour is finally gated.** Every `[verity]` prefix used to carry raw ANSI into
200
+ CI logs, pipes, and agent transcripts. Colour and art now require a terminal on
201
+ stderr and honour `NO_COLOR` / `TERM=dumb`, with `FORCE_COLOR=1` to override.
202
+
203
+ ### ๐Ÿงน One writer per file
204
+
205
+ - **`.gitignore`** โ€” one whitelist block from one writer. Init used to write a
206
+ single `.verity/.snapshot/` line while the skill wrote a block that supersedes
207
+ it; an install with only the narrow line now upgrades, so `.verity/setup.json`,
208
+ `.baseline`, `.cache/` and whatever state file ships next are covered by
209
+ construction rather than by enumeration.
210
+ - **A `.verity/` entry is repaired to `.verity/*`.** With the directory form git
211
+ cannot re-include the committed standard, and the symptom is not an error: a
212
+ project that looks configured while `.verity/standard.yaml` is silently ignored.
213
+ Committed machine state is also detected and offered for untracking.
214
+ - **`CLAUDE.md`** โ€” the post-task reflection instructions moved into the managed
215
+ block. The skill used to append them beside it, along with a second copy of the
216
+ memory pointer.
217
+ - **A closed stdin no longer aborts an install.** A question that loses its
218
+ terminal (Ctrl+D, a pty that ends) falls back to the default instead of
219
+ crashing init between copying the skills and wiring the hooks.
220
+
6
221
  ## [0.31.1] โ€” 2026-08-27
7
222
 
8
223
  **Verity stops repeating itself.** A finding it had already closed could keep
@@ -30,9 +245,10 @@ npm install -g @codacy/verity-cli
30
245
 
31
246
  ### ๐Ÿ’ฌ The carried-findings notice tells the truth, and offers a way out
32
247
 
33
- - It **no longer calls those findings "blocking."** They are the ones that did
34
- *not* gate your run โ€” a passing run was printing "1 blocking finding(s)" every
35
- turn, an alarm the gate itself had already decided not to act on.
248
+ - It **no longer calls those findings "blocking."** They did not *fail* your
249
+ run โ€” a run that was otherwise passing printed "1 blocking finding(s)" every
250
+ turn, which reads as a failure that never happened. (It does still turn a PASS
251
+ into a WARN, and the notice now says only what is true.)
36
252
  - It now **names the way to resolve them**, instead of repeating a problem with
37
253
  no stated exit.
38
254
 
package/README.md CHANGED
@@ -10,7 +10,73 @@ cd your-project
10
10
  verity init
11
11
  ```
12
12
 
13
- Then open the project in Claude Code and run `/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.
59
+
60
+ If Claude Code isn't on your PATH, or you're already inside a session, init prints
61
+ the one command to run instead. `verity setup` is an alias for the same command.
62
+
63
+ | Flag | Use |
64
+ |------|-----|
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`. |
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 |
68
+ | `--force` | Overwrite the installed skills even when they differ |
69
+
70
+ Run `verity doctor` any time to see prerequisites, which phase is done, the hook
71
+ wiring, and what is still missing.
72
+
73
+ ### Output
74
+
75
+ Human output goes to **stderr**; stdout carries only data (`--json`). Colour, the
76
+ wordmark, and the spinners appear only when stderr is a terminal, and honour
77
+ `NO_COLOR` and `TERM=dumb`; `FORCE_COLOR=1` forces them on for a pipe that renders
78
+ ANSI. In CI, in a pipe, or when init runs inside a Claude Code session you get the
79
+ same information as plain lines โ€” no art, no animation, no escape sequences.
14
80
 
15
81
  ### Permission denied?
16
82
 
@@ -49,7 +115,10 @@ No re-setup needed: your token, Standard, and run history all carry over.
49
115
  | Command | Description |
50
116
  |---------|-------------|
51
117
  | **Core** | |
52
- | `verity init` | Initialize Verity in current project |
118
+ | `verity init` | Set up Verity in this project, end to end โ€” questions, wiring, and the Standard (alias: `verity setup`) |
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 |
53
122
  | `verity analyze` | Run analysis on changed files (stop hook) |
54
123
  | `verity analyze --mode <mode>` | Force analysis mode (standard/plan/debug/skip) |
55
124
  | `verity review --files <paths>` | On-demand analysis (advisory) |
@@ -69,6 +138,7 @@ No re-setup needed: your token, Standard, and run history all carry over.
69
138
  | `verity logout --others` | Sign out every OTHER machine (e.g. a lost laptop) |
70
139
  | `verity logout --all` | Sign out everywhere, including here |
71
140
  | `verity hooks install` | Wire Claude Code hooks |
141
+ | `verity hooks install --moments stop,pre-commit,pre-push` | Change WHEN Verity reviews (what `verity init` asks for) |
72
142
  | `verity standard push` | Upload project Standard |
73
143
  | **Knowledge** | |
74
144
  | `verity reflect` | Trigger knowledge extraction for current task |
@@ -85,7 +155,7 @@ No re-setup needed: your token, Standard, and run history all carry over.
85
155
 
86
156
  | Skill | Description |
87
157
  |-------|-------------|
88
- | `/verity-setup` | Project configuration wizard |
158
+ | `/verity-setup` | Synthesizes the Standard + analysis config (the half of setup that needs a model; `verity init` launches it) |
89
159
  | `/verity-analyze` | On-demand analysis |
90
160
  | `/verity-status` | Project health dashboard |
91
161
  | `/verity-feedback` | Feedback (general + per-finding) |