revdeck 0.4.5 → 0.5.0

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.
@@ -14,6 +14,9 @@ provider:
14
14
  base: develop
15
15
  output:
16
16
  language: auto # auto | ru | en — language of findings and replies
17
+ review:
18
+ agents: 3
19
+ roles: [correctness, architecture, tests]
17
20
  rules:
18
21
  sources: [AGENTS.md]
19
22
  map:
@@ -33,6 +36,29 @@ publish:
33
36
  maxComments: 50
34
37
  ```
35
38
 
39
+ ## Personal overrides: `.revdeck.local.yml`
40
+
41
+ `revdeck` also reads `.revdeck.local.yml` (or `.revdeck.local.yaml`) next to the base config. Use it for
42
+ local roles, checks, output language or provider settings without changing the shared file. `init`
43
+ adds both local names to `.gitignore`.
44
+
45
+ Merge rules:
46
+
47
+ - objects are merged recursively;
48
+ - arrays and scalars from the local file replace the base value;
49
+ - `review.readOnly: true` in the base cannot be disabled locally (the effective value is OR);
50
+ - local file alone is allowed, but a base `.revdeck.yml` is recommended for the team;
51
+ - YAML/schema errors in the local file are reported, never silently ignored.
52
+
53
+ ```yaml
54
+ # .revdeck.local.yml — do not commit
55
+ review:
56
+ agents: 2
57
+ roles: [correctness, tests]
58
+ output:
59
+ language: ru
60
+ ```
61
+
36
62
  ## provider
37
63
 
38
64
  | Field | Default | Meaning |
@@ -56,9 +82,73 @@ review to a different project.
56
82
  via `--lang ru|en`, `REVDECK_LANG`, or the toggle in the UI.
57
83
  - `revdeck init --lang en` selects the English skill and writes `REVDECK_LANG` to the MCP config.
58
84
 
85
+ ## review
86
+
87
+ The review can be split between independent agents. The daemon stores the final result; spawning is done
88
+ by the harness (Claude Code subagents, DSH workflow, or another orchestrator).
89
+
90
+ ```yaml
91
+ review:
92
+ agents: 3
93
+ roles: [correctness, architecture, tests]
94
+ ```
95
+
96
+ | Field | Default | Meaning |
97
+ |---|---|---|
98
+ | `agents` | `3` | number of independent reviewers, 1–8 |
99
+ | `roles` | correctness, architecture, tests | roles for the reviewers; a shorter list is repeated to reach `agents` |
100
+
101
+ Available roles:
102
+
103
+ | Role | Focus | Criteria.md |
104
+ |---|---|---|
105
+ | `correctness` | logic, edge cases, errors, async and state | §6, §10 |
106
+ | `architecture` | layers, responsibility, coupling, precedents, ADRs | §3–§5, §7 |
107
+ | `tests` | coverage, assertions, missing cases, flakiness | §8 |
108
+ | `security` | authorization, validation, secrets, injections, shell | §10 |
109
+ | `performance` | complexity, N+1, allocations, blocking work | §10 |
110
+ | `compatibility` | public API, migrations, config and backward compatibility | §6, §7 |
111
+ | `docs` | documentation, configs, CHANGELOG and AI instructions | §9 |
112
+ | `concurrency` | races, locks, idempotency, retries, cancellation | §10 |
113
+ | `ux` | UI states, accessibility, errors, narrow screens | §9, §10 |
114
+ | `data` | schemas, migrations, storage | §3, §10 |
115
+ | `api` | public contracts, versioning, client compatibility | §6, §7 |
116
+ | `dependencies` | versions, licenses, supply chain | §3, §10 |
117
+ | `observability` | logs, metrics, traces, diagnostics | §9, §10 |
118
+ | `build` | CI, build, packaging, reproducibility | §8, §9 |
119
+ | `privacy` | PII, personal data, logs and leaks | §9, §10 |
120
+ | `general` | full review across all sections | §1–§12 |
121
+
122
+ Custom roles live in `review.customRoles`; `roles` may reference built-ins or those keys:
123
+
124
+ ```yaml
125
+ review:
126
+ roles: [correctness, accessibility]
127
+ customRoles:
128
+ accessibility:
129
+ title: "Accessibility"
130
+ description: "Keyboard navigation, ARIA, focus and contrast."
131
+ criteria: ["9", "10"]
132
+ focus: "a11y and keyboard"
133
+ instructions: |
134
+ Report only accessibility problems; do not repeat general architecture findings.
135
+ ```
136
+
137
+ Custom ids cannot override a built-in role. `review.readOnly: true` disables all writes and publishing
138
+ for that review (the UI shows a banner, the daemon rejects mutations).
139
+
140
+ Several MRs can be opened at once with `revdeck open 345 344 556` (or an array in `revdeck_open`); run
141
+ a separate group per review and do not merge findings across MRs.
142
+
143
+ `revdeck context <N> --role <role> --shard i/N` renders a worker context with only its files (and threads
144
+ for those files), plus a reminder not to write findings. The MCP tool accepts the same `role` and `shard`
145
+ arguments. The lead agent should collect the workers' JSON, deduplicate by `file:line:title`, and only
146
+ then call `revdeck_set_summary` / `revdeck_draft_findings`.
147
+
59
148
  ## rules
60
149
 
61
- - `sources` — the default documents when none of the `map` rows match. Empty — auto-discovery
150
+ - `sources` — exact document paths (optional `#section`), not glob patterns. Use `map.match` to select
151
+ documents by changed path. The default documents when none of the `map` rows match. Empty — auto-discovery
62
152
  (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `docs/ARCHITECTURE.md`, `docs/Architecture.md`,
63
153
  `docs/STYLEGUIDE.md`, `docs/Styleguide.md`, `docs/CONTRIBUTING.md`).
64
154
  - `map` — a list of rules: `match` (a glob or an array of globs) and `docs` (an array of selectors).
@@ -100,6 +190,48 @@ rules:
100
190
  If `rules.sources`/`rules.map` are set, auto-discovery is disabled; a missing explicit document then
101
191
  produces its own warning instead. Empty `sources: []` keeps auto-discovery enabled.
102
192
 
193
+ ### Change groups
194
+
195
+ ```yaml
196
+ review:
197
+ groups:
198
+ - id: auth
199
+ title: "Authorization"
200
+ match: ["src/auth/**", "src/security/**"]
201
+ ```
202
+
203
+ Explicit groups are applied first; other files are grouped by kind (docs, tests, config, styles,
204
+ generated) and by top-level module. Groups are shown in Overview and in the agent context.
205
+
206
+ ### Secret scan
207
+
208
+ Off by default:
209
+
210
+ ```yaml
211
+ review:
212
+ secrets:
213
+ enabled: true
214
+ scan: diff # diff | files | both
215
+ includeTests: false
216
+ allowlist: ["test/fixtures/**", "rule:generic-secret"]
217
+ ```
218
+
219
+ The scanner looks for AWS/GitHub/GitLab/Stripe/OpenAI keys, private keys and generic secret
220
+ assignments. Only a masked preview is returned; raw values are never stored in the review or sent to the
221
+ agent. `revdeck scan <N>` returns the same list.
222
+
223
+ ### Version history
224
+
225
+ ```yaml
226
+ review:
227
+ history:
228
+ enabled: true
229
+ keep: 20
230
+ ```
231
+
232
+ Each refresh with a changed head/diff stores a version (head/base SHA, diff hash, counts and review
233
+ snapshot). `revdeck versions <N>` lists them; Overview shows the timeline. Versions are pruned to `keep`.
234
+
103
235
  ### Document selectors
104
236
 
105
237
  | Selector | What is included |
@@ -132,7 +264,8 @@ string would allow arbitrary code to be executed during a review.
132
264
  | `consent` | requires explicit confirmation (default `true`) |
133
265
  | `timeoutMs` | timeout (default 300,000) |
134
266
 
135
- Running: `revdeck checks <N> --run --yes`. The MCP tool only shows the plan.
267
+ Running: `revdeck checks <N> --run --yes`, or **Run matching** in the Rules tab with an explicit
268
+ confirmation. Read-only reviews disable the runner. The MCP tool only shows the plan.
136
269
 
137
270
  ## publish
138
271
 
@@ -14,6 +14,9 @@ provider:
14
14
  base: develop
15
15
  output:
16
16
  language: auto # auto | ru | en — язык замечаний и ответов
17
+ review:
18
+ agents: 3
19
+ roles: [correctness, architecture, tests]
17
20
  rules:
18
21
  sources: [AGENTS.md]
19
22
  map:
@@ -33,6 +36,29 @@ publish:
33
36
  maxComments: 50
34
37
  ```
35
38
 
39
+ ## Личные настройки: `.revdeck.local.yml`
40
+
41
+ `revdeck` читает `.revdeck.local.yml` (или `.revdeck.local.yaml`) рядом с базовым конфигом. В нём можно
42
+ переопределить роли, проверки, язык вывода или provider, не меняя общий файл. `init` добавляет оба
43
+ локальных имени в `.gitignore`.
44
+
45
+ Правила слияния:
46
+
47
+ - объекты сливаются рекурсивно;
48
+ - массивы и скаляры из локального файла заменяют базовое значение;
49
+ - `review.readOnly: true` из базового файла нельзя отключить локально (эффективное значение — OR);
50
+ - локальный файл может быть единственным, но для команды лучше иметь базовый `.revdeck.yml`;
51
+ - ошибки YAML/схемы в локальном файле показываются, а не игнорируются.
52
+
53
+ ```yaml
54
+ # .revdeck.local.yml — не коммитить
55
+ review:
56
+ agents: 2
57
+ roles: [correctness, tests]
58
+ output:
59
+ language: ru
60
+ ```
61
+
36
62
  ## provider
37
63
 
38
64
  | Поле | По умолчанию | Смысл |
@@ -54,9 +80,75 @@ publish:
54
80
  `REVDECK_LANG` или переключателем в UI.
55
81
  - `revdeck init --lang en` выбирает английский skill и пишет `REVDECK_LANG` в MCP-конфиг.
56
82
 
83
+ ## review
84
+
85
+ Ревью можно разделить между независимыми агентами. Демон хранит итог; запуск агентов выполняет harness
86
+ (субагенты Claude Code, workflow DSH или другой оркестратор).
87
+
88
+ ```yaml
89
+ review:
90
+ agents: 3
91
+ roles: [correctness, architecture, tests]
92
+ ```
93
+
94
+ | Поле | По умолчанию | Смысл |
95
+ |---|---|---|
96
+ | `agents` | `3` | число независимых ревьюеров, 1–8 |
97
+ | `roles` | correctness, architecture, tests | роли ревьюеров; короткий список повторяется до `agents` |
98
+
99
+ Доступные роли:
100
+
101
+ | Роль | Фокус | Criteria.md |
102
+ |---|---|---|
103
+ | `correctness` | логика, граничные случаи, ошибки, async и состояние | §6, §10 |
104
+ | `architecture` | слои, ответственность, связность, прецеденты, ADR | §3–§5, §7 |
105
+ | `tests` | покрытие, assertions, пропущенные случаи, нестабильность | §8 |
106
+ | `security` | авторизация, валидация, секреты, инъекции, shell | §10 |
107
+ | `performance` | сложность, N+1, аллокации, блокирующие операции | §10 |
108
+ | `compatibility` | публичный API, миграции, конфиги, обратная совместимость | §6, §7 |
109
+ | `docs` | документация, конфиги, CHANGELOG и AI-инструкции | §9 |
110
+ | `concurrency` | гонки, блокировки, идемпотентность, retries, отмена | §10 |
111
+ | `ux` | состояния UI, доступность, ошибки, узкие экраны | §9, §10 |
112
+ | `data` | схемы, миграции, хранение | §3, §10 |
113
+ | `api` | публичные контракты, версионирование, совместимость клиентов | §6, §7 |
114
+ | `dependencies` | версии, лицензии, supply chain | §3, §10 |
115
+ | `observability` | логи, метрики, трейсы, диагностика | §9, §10 |
116
+ | `build` | CI, сборка, упаковка, воспроизводимость | §8, §9 |
117
+ | `privacy` | PII, персональные данные, логи и утечки | §9, §10 |
118
+ | `general` | полное ревью по всем разделам | §1–§12 |
119
+
120
+ Кастомные роли задаются в `review.customRoles`; `roles` может ссылаться на встроенные роли или на
121
+ эти ключи:
122
+
123
+ ```yaml
124
+ review:
125
+ roles: [correctness, accessibility]
126
+ customRoles:
127
+ accessibility:
128
+ title: "Доступность"
129
+ description: "Клавиатурная навигация, ARIA, фокус и контраст."
130
+ criteria: ["9", "10"]
131
+ focus: "a11y и клавиатура"
132
+ instructions: |
133
+ Сообщай только о проблемах доступности; не повторяй общие замечания по архитектуре.
134
+ ```
135
+
136
+ Кастомный id не может переопределить встроенную роль. `review.readOnly: true` запрещает изменения и
137
+ публикацию для этого ревью (UI показывает баннер, демон отклоняет мутации).
138
+
139
+ Несколько MR можно открыть одной командой `revdeck open 345 344 556` (или массивом в `revdeck_open`);
140
+ для каждого ревью запускается отдельная группа, замечания разных MR не смешиваются.
141
+
142
+ `revdeck context <N> --role <роль> --shard i/N` отдаёт контекст только с файлами шарда (и тредами по
143
+ этим файлам) и напоминает не писать findings. MCP-инструмент принимает те же `role` и `shard`.
144
+ Лид-агент собирает JSON воркеров, дедуплицирует по `file:line:title` и только потом вызывает
145
+ `revdeck_set_summary` / `revdeck_draft_findings`.
146
+
57
147
  ## rules
58
148
 
59
- - `sources` — документы по умолчанию, если ни одна строка `map` не подошла. Пусто — автообнаружение
149
+ - `sources` — точные пути к документам (можно с `#секцией`), не glob-шаблоны. Для выбора документов по
150
+ изменённым путям используйте `map.match`. Документы по умолчанию, если ни одна строка `map` не
151
+ подошла. Пусто — автообнаружение
60
152
  (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `docs/ARCHITECTURE.md`, `docs/Architecture.md`,
61
153
  `docs/STYLEGUIDE.md`, `docs/Styleguide.md`, `docs/CONTRIBUTING.md`).
62
154
  - `map` — список правил: `match` (glob или массив glob) и `docs` (массив селекторов). Несколько
@@ -98,6 +190,49 @@ rules:
98
190
  Если заданы `rules.sources`/`rules.map`, автообнаружение отключается; отсутствующий явный документ
99
191
  даст отдельное предупреждение. Пустой `sources: []` оставляет автообнаружение включённым.
100
192
 
193
+ ### Группы изменений
194
+
195
+ ```yaml
196
+ review:
197
+ groups:
198
+ - id: auth
199
+ title: "Авторизация"
200
+ match: ["src/auth/**", "src/security/**"]
201
+ ```
202
+
203
+ Явные группы применяются первыми; остальные файлы группируются по типу (docs, tests, config, styles,
204
+ generated) и верхнему модулю. Группы видны в «Обзоре» и в контексте агента.
205
+
206
+ ### Скан секретов
207
+
208
+ По умолчанию выключен:
209
+
210
+ ```yaml
211
+ review:
212
+ secrets:
213
+ enabled: true
214
+ scan: diff # diff | files | both
215
+ includeTests: false
216
+ allowlist: ["test/fixtures/**", "rule:generic-secret"]
217
+ ```
218
+
219
+ Сканер ищет ключи AWS/GitHub/GitLab/Stripe/OpenAI, private keys и generic secret assignments.
220
+ Возвращается только замаскированный preview; сырые значения не сохраняются в ревью и не уходят
221
+ агенту. `revdeck scan <N>` возвращает тот же список.
222
+
223
+ ### История версий
224
+
225
+ ```yaml
226
+ review:
227
+ history:
228
+ enabled: true
229
+ keep: 20
230
+ ```
231
+
232
+ Каждое обновление с изменившимся head/diff сохраняет версию (head/base SHA, diff hash, счётчики и
233
+ снимок ревью). `revdeck versions <N>` показывает список; в «Обзоре» есть таймлайн. Хранится не больше
234
+ `keep` версий.
235
+
101
236
  ### Селекторы документов
102
237
 
103
238
  | Селектор | Что берётся |
@@ -130,7 +265,8 @@ rules:
130
265
  | `consent` | требует явного подтверждения (по умолчанию `true`) |
131
266
  | `timeoutMs` | таймаут (по умолчанию 300 000) |
132
267
 
133
- Запуск: `revdeck checks <N> --run --yes`. MCP-инструмент только показывает план.
268
+ Запуск: `revdeck checks <N> --run --yes` или кнопка **Запустить подходящие** на вкладке «Правила» с
269
+ подтверждением. В read-only проверки отключены. MCP-инструмент только показывает план.
134
270
 
135
271
  ## publish
136
272
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdeck",
3
- "version": "0.4.5",
3
+ "version": "0.5.0",
4
4
  "description": "Agent-first code review for GitLab and GitHub: local daemon, CLI, MCP server and a triage UI.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,6 +42,26 @@ capabilities.
42
42
  3. Run the procedure of the chosen scenario.
43
43
  4. Record findings and reply drafts with the tools. **Do not publish.**
44
44
 
45
+ ## Multi-agent review
46
+
47
+ The context starts with a **Multi-agent review** section when `.revdeck.yml` has `review.agents > 1`.
48
+ Act as the lead:
49
+
50
+ 1. Read `agents` and `roles` from the context.
51
+ 2. Spawn one subagent per role/shard if the harness supports subagents (`Task` in Claude Code, a
52
+ workflow in DSH, or the equivalent). Give each: `revdeck_context` with the `role` and `shard` from
53
+ the plan, and tell it to return a JSON findings array plus a short summary. A worker must **not**
54
+ call `revdeck_draft_findings`, `revdeck_set_summary` or `revdeck_draft_reply`.
55
+ 3. If there is no subagent support, run the roles sequentially and keep their results separate.
56
+ 4. Deduplicate by `file:line:title` (prefer the higher level), then write the final summary and findings
57
+ **once** as the lead. The UI shows that single merged result.
58
+
59
+ Several reviews can be opened in one call (`revdeck_open` accepts an array; CLI: `revdeck open 345 344
60
+ 556`). Run a separate multi-agent group per review and keep findings namespaced by review; never merge
61
+ findings from different MRs. The UI still shows one review at a time.
62
+
63
+ Fallback: with one agent or no multi-agent section, just do the normal review.
64
+
45
65
  ## Chat answer
46
66
 
47
67
  The UI is the source of truth. After a review or a feedback pass, answer in the chat in 3–7 lines:
@@ -40,6 +40,26 @@ description: "Ревью merge/pull request через локальный revdec
40
40
  3. Выполнить процедуру выбранного сценария.
41
41
  4. Черновики замечаний и ответов записать инструментами. **Не публиковать.**
42
42
 
43
+ ## Многоагентное ревью
44
+
45
+ Если в `.revdeck.yml` задано `review.agents > 1`, контекст начинается с раздела
46
+ **Многоагентное ревью**. Действуйте как лид:
47
+
48
+ 1. Прочитайте `agents` и `roles` из контекста.
49
+ 2. Если harness поддерживает субагентов (`Task` в Claude Code, workflow в DSH или аналог), запустите
50
+ по субагенту на роль/шард. Каждому дайте `revdeck_context` с его `role` и `shard` и попросите
51
+ вернуть JSON с замечаниями и короткой выжимкой. Воркер **не должен** вызывать
52
+ `revdeck_draft_findings`, `revdeck_set_summary` и `revdeck_draft_reply`.
53
+ 3. Если субагентов нет, пройдите роли последовательно, сохраняя результаты отдельно.
54
+ 4. Уберите дубли по `file:line:title` (оставляйте более высокий уровень) и только потом один раз
55
+ запишите итоговые summary и findings как лид. UI покажет один общий результат.
56
+
57
+ Несколько ревью можно открыть одним вызовом (`revdeck_open` принимает массив; CLI:
58
+ `revdeck open 345 344 556`). Для каждого ревью запускайте отдельную группу агентов и не смешивайте
59
+ замечания разных MR. UI по-прежнему показывает одно ревью за раз.
60
+
61
+ Если агент один или раздела multi-agent нет — работайте как обычно.
62
+
43
63
  ## Ответ в чате
44
64
 
45
65
  Источник правды — UI. После ревью или прохода по замечаниям отвечайте в чате в 3–7 строк: что