revdeck 0.4.6 → 0.6.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +81 -1
  2. package/README.md +95 -9
  3. package/README.ru.md +96 -12
  4. package/dist/cli.js +1648 -531
  5. package/dist/cli.js.map +4 -4
  6. package/dist/daemon.js +1932 -240
  7. package/dist/daemon.js.map +4 -4
  8. package/dist/mcp.js +1143 -125
  9. package/dist/mcp.js.map +4 -4
  10. package/dist/ui/assets/index-BH0dNFhd.css +1 -0
  11. package/dist/ui/assets/index-Wz1DYbiv.js +14 -0
  12. package/dist/ui/index.html +2 -2
  13. package/docs/README.md +1 -1
  14. package/docs/architecture.md +51 -6
  15. package/docs/capabilities.md +227 -0
  16. package/docs/configuration.md +196 -1
  17. package/docs/integrations.md +35 -0
  18. package/docs/protocol.md +52 -2
  19. package/docs/ru/README.md +1 -1
  20. package/docs/ru/architecture.md +51 -5
  21. package/docs/ru/capabilities.md +227 -0
  22. package/docs/ru/configuration.md +189 -1
  23. package/docs/ru/integrations.md +36 -0
  24. package/docs/ru/protocol.md +51 -2
  25. package/docs/ru/threat-model.md +28 -0
  26. package/docs/screenshot.png +0 -0
  27. package/docs/screenshot.ru.png +0 -0
  28. package/docs/threat-model.md +29 -0
  29. package/examples/analytics-platform.yml +40 -0
  30. package/examples/monorepo.yml +1 -1
  31. package/package.json +1 -1
  32. package/skills/revdeck/en/Feature.md +61 -0
  33. package/skills/revdeck/en/SKILL.md +37 -1
  34. package/skills/revdeck/ru/Feature.md +61 -0
  35. package/skills/revdeck/ru/SKILL.md +38 -1
  36. package/dist/ui/assets/index-DP2dIReT.js +0 -10
  37. package/dist/ui/assets/index-DZ9XSSBl.css +0 -1
  38. package/docs/adr/0001-daemon-first.md +0 -65
  39. package/docs/ru/adr/0001-daemon-first.md +0 -63
  40. package/examples/web-chat-core.yml +0 -45
@@ -7,8 +7,8 @@
7
7
  <meta name="referrer" content="no-referrer" />
8
8
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
9
9
  <title>revdeck</title>
10
- <script type="module" crossorigin src="/assets/index-DP2dIReT.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-DZ9XSSBl.css">
10
+ <script type="module" crossorigin src="/assets/index-Wz1DYbiv.js"></script>
11
+ <link rel="stylesheet" crossorigin href="/assets/index-BH0dNFhd.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="app"></div>
package/docs/README.md CHANGED
@@ -7,11 +7,11 @@ slightly behind.
7
7
 
8
8
  | Document | English | Русский |
9
9
  |---|---|---|
10
+ | Capabilities and decisions | [capabilities.md](capabilities.md) | [ru/capabilities.md](ru/capabilities.md) |
10
11
  | Overview and design | [architecture.md](architecture.md) | [ru/architecture.md](ru/architecture.md) |
11
12
  | Configuration and rules | [configuration.md](configuration.md) | [ru/configuration.md](ru/configuration.md) |
12
13
  | RPC and HTTP protocol | [protocol.md](protocol.md) | [ru/protocol.md](ru/protocol.md) |
13
14
  | Threat model | [threat-model.md](threat-model.md) | [ru/threat-model.md](ru/threat-model.md) |
14
15
  | Harness integrations | [integrations.md](integrations.md) | [ru/integrations.md](ru/integrations.md) |
15
- | ADR-0001: daemon-first | [adr/0001-daemon-first.md](adr/0001-daemon-first.md) | [ru/adr/0001-daemon-first.md](ru/adr/0001-daemon-first.md) |
16
16
 
17
17
  Start with the [README](../README.md) for installation, commands and MCP setup.
@@ -15,8 +15,8 @@
15
15
 
16
16
  - Replacing GitLab/GitHub's native diff viewer. The UI is optimized for triage and approval.
17
17
  - Built-in static analysis. Checks are delegated to the project's linter, types, and tests.
18
- - A multi-user server. The model is one user, several reviews, and a
19
- [daemon on the host](adr/0001-daemon-first.md).
18
+ - A multi-user server. The model is one user, several repositories and reviews, and a
19
+ [daemon on the host](capabilities.md#daemon-first).
20
20
 
21
21
  ## Components
22
22
 
@@ -26,14 +26,14 @@ agent (MCP/CLI) ──▶ revdeck daemon ──glab/gh──▶ GitLab/GitHub
26
26
  SQLite + UI ◀── human
27
27
  ```
28
28
 
29
- - `src/core` — pure functions and models: unified diff parser, rules, finding fingerprints,
29
+ - `src/core` — pure functions and models: project identity and keys, unified diff parser, rules, finding fingerprints,
30
30
  [publication sanitizer](threat-model.md), secret redaction, safe process execution.
31
31
  - `src/providers` — the only place that knows about platforms. `Provider` normalizes MR/PR, diff,
32
32
  threads, replies, resolution, and comment creation.
33
33
  - `src/daemon/service.ts` — orchestrator: review refresh, drafts, decisions, publication plan,
34
34
  approval, idempotent writes, background sync.
35
- - `src/daemon/store.ts` — SQLite (`node:sqlite`): reviews, diff/thread snapshot, drafts, findings,
36
- decisions, comments, approvals, audit.
35
+ - `src/daemon/store.ts` — SQLite (`node:sqlite`): projects and their roots, reviews, diff/thread snapshot,
36
+ drafts, findings, decisions, comments, approvals, audit.
37
37
  - `src/daemon/rpc.ts` — [JSON-RPC](protocol.md) over a Unix socket (0600) for the CLI and MCP.
38
38
  - `src/daemon/bridge.ts` — an additional RPC socket in a stable home-based directory for devcontainers.
39
39
  - `src/daemon/http.ts` — UI and `/api/*`, SSE events, cookie session with a one-time token.
@@ -43,7 +43,7 @@ agent (MCP/CLI) ──▶ revdeck daemon ──glab/gh──▶ GitLab/GitHub
43
43
 
44
44
  ## Data flow
45
45
 
46
- 1. `revdeck open 42` → RPC `reviews.open` with the working copy `root`.
46
+ 1. `revdeck open 42` → RPC `reviews.open` with the working copy `root`; the project is resolved from the config/remote and registered.
47
47
  2. The daemon determines the platform/host/project (arguments → config → git remote), creates a
48
48
  provider, reads the MR, diff, and threads, and saves a snapshot and synthetic drafts.
49
49
  3. The agent requests `revdeck_context`: the daemon assembles effective rules (documents and sections
@@ -55,6 +55,10 @@ agent (MCP/CLI) ──▶ revdeck daemon ──glab/gh──▶ GitLab/GitHub
55
55
 
56
56
  ## Data model
57
57
 
58
+ - `Project` — a repository: `key = platform:host/project` (normalized for comparison), display values,
59
+ and one or more working-copy roots. Reviews carry the same `projectKey`.
60
+ - `Feature` — an explicit bundle of reviews with a brief, contract and notes; `FeatureReview` adds a
61
+ role and order; `FeatureNote` holds non-published cross-project notes/findings.
58
62
  - `ReviewRef` — platform, host, project, number. `reviewId` — `platform:host/project!number`.
59
63
  - `DiffFile`/`Hunk`/`DiffLine` — line numbers in the old and new versions; a finding's `line` always
60
64
  refers to the new file.
@@ -64,6 +68,47 @@ agent (MCP/CLI) ──▶ revdeck daemon ──glab/gh──▶ GitLab/GitHub
64
68
  - `Approval` — a one-time id tied to `hash = sha256(canonicalJson({reviewId, kind, items}))`,
65
69
  with a 10-minute TTL.
66
70
 
71
+ ## Projects and isolation
72
+
73
+ One daemon serves several repositories. A **project** is one repository, identified by
74
+ `platform:host/project`; a review stores its project key and its own working-copy root. The daemon
75
+ registry (`projects`, `project_roots`) is populated when a review is opened or when a project is
76
+ registered explicitly (`revdeck projects add <path>`).
77
+
78
+ - The UI selects one project at a time: a switcher, a projects home, and a review queue scoped to the
79
+ selection. The selection is kept in the URL and in local storage.
80
+ - The MCP server is the isolation point. It resolves its project from `REVDECK_ROOT` (or the current
81
+ directory), lists only that project, and rejects review ids/URLs from other projects. The agent gets
82
+ no `root` or project overrides.
83
+ - `reviews.list` accepts `project` or `root`; this is a filter for the UI/CLI, not a security boundary.
84
+ One daemon and one database remain; a process with access to the user's home can read the database.
85
+ - Cross-project work is not implicit. A human-created feature links reviews from several projects; a
86
+ foreign review is rejected outside it. See [capabilities](capabilities.md#project-scopes) and [Features](#features).
87
+
88
+ ## Features
89
+
90
+ A **feature** is a human-created bundle of reviews across projects. It is not a project and not a
91
+ permanent project link: projects appear in it only while at least one of their reviews is a member.
92
+ The `features` table holds the title, Markdown brief, a separate Markdown/OpenAPI contract, status
93
+ and human/agent feature notes; `feature_reviews` holds membership, a free-form role and order. Several
94
+ reviews from one project are allowed. OpenAPI contracts are parsed into operations and schemas, and
95
+ the context marks which changed reviews mention each operation. Application profiles are background
96
+ documents declared in `context.sources` of each repository (`context.maxBytes` caps them).
97
+
98
+ - The UI and CLI create/edit features; MCP exposes read-only discovery/context and, in a feature session,
99
+ `revdeck_feature_note` for agent-authored notes (never published).
100
+ - A **project session** sees features that include its project, may read the combined context, and
101
+ writes only in its project.
102
+ - A **feature session** is explicit (`REVDECK_FEATURE=<id>`): the current repository must be a member,
103
+ the scope covers only members, and drafts may be written to any member. Publishing remains per
104
+ review and requires human approval.
105
+ - The combined context contains the brief, the contract (parsed OpenAPI or raw Markdown), application
106
+ profiles, feature notes, an overview matrix and one section per review with its own project rules.
107
+ Rules are never merged. The budget is split across reviews.
108
+ - There is no feature-level publish. Findings and summaries belong to reviews; feature notes/findings
109
+ are a non-published cross-project scratchpad. The feature aggregates reviews for navigation. See
110
+ [capabilities](capabilities.md#features).
111
+
67
112
  ## Idempotency and concurrency
68
113
 
69
114
  - Draft and finding writes go through a single process; SQLite in WAL mode.
@@ -0,0 +1,227 @@
1
+ # Capabilities and design decisions
2
+
3
+ [English](capabilities.md) | [Русский](ru/capabilities.md)
4
+
5
+ This document is the single, current description of what revdeck can do and why the product is built
6
+ this way. It also records the decisions behind the daemon-first architecture, project scopes and
7
+ cross-project features.
8
+
9
+ ## Product model
10
+
11
+ revdeck is a local, agent-first code review tool for GitLab and GitHub. One user runs one daemon on the
12
+ host; agents, the CLI and the browser UI are clients.
13
+
14
+ ```text
15
+ agent (MCP/CLI) ──unix socket──▶ revdeck daemon ──glab/gh──▶ GitLab / GitHub
16
+ │
17
+ SQLite + Svelte UI ◀── human
18
+ ```
19
+
20
+ The core guarantees:
21
+
22
+ - **The human publishes.** Agents write drafts (summaries, findings, replies, line comments). A human
23
+ approves the exact plan in the UI or CLI; the daemon then posts it. An agent cannot create an
24
+ approval.
25
+ - **Tokens stay on the host.** The daemon calls `glab`/`gh`; platform tokens are not passed over RPC
26
+ and are scrubbed from child environments.
27
+ - **Project rules are explicit.** For changed paths revdeck selects repository documents and exact
28
+ sections (`AGENTS.md`, architecture, style guides, ADRs).
29
+ - **One local database.** Reviews, projects, features, drafts, approvals and audit live in SQLite in
30
+ the user's state directory.
31
+ - **Agent work is review-only.** Checks are planned by the agent and run only after human consent.
32
+ Publishing, resolving and approvals remain human actions.
33
+
34
+ ## Reviews
35
+
36
+ - GitLab MR and GitHub PR are normalized into one model: ref, description, author, state, branches,
37
+ commits, diff, threads, notes and reactions.
38
+ - Open a review by number, URL, project reference or the current branch; multiple reviews can be
39
+ opened in one call.
40
+ - Local triage queue with cached snapshots; background sync and SSE keep the UI fresh.
41
+ - Unified diff with per-file hunks, line numbers in old/new versions, changed-file filters and
42
+ viewed-state per review.
43
+ - Threads: read, reply, resolve, react; line comments from the human; reactions on MR/PR and notes.
44
+ - Edit and delete your own platform comments.
45
+ - Attachments: upload raster images and videos to GitLab project uploads and insert a markdown link;
46
+ GitHub attachments are not supported by its public API.
47
+ - Review summary, findings with severity (`blocker`/`major`/`minor`/`question`), stable finding ids,
48
+ decisions (`accept`/`reject`/`discuss`), private agent notes and publish status.
49
+ - Multi-agent review roles and shards (`review.agents`, `review.roles`, custom roles); the daemon
50
+ stores the lead's merged result.
51
+ - Analytics: accepted/rejected/pending findings, acceptance rate, threads, drafts, rejected
52
+ suggestions.
53
+ - Optional secret scan with masked previews only.
54
+ - Optional review version history by head/base SHA.
55
+ - Change groups: explicit or derived by file kind/module.
56
+ - Project checks: argv without a shell, path scoping, explicit `--run --yes` confirmation.
57
+ - Read-only reviews: drafts, findings, comments, reactions, checks and publishing are disabled.
58
+ - Export/import of the legacy file format.
59
+
60
+ ## Agent interfaces
61
+
62
+ - **MCP server** over stdio with tools for status, list, open, context, threads, diff, rules, draft
63
+ replies, draft findings, summary, line notes, feature context/notes, publish preview and publish.
64
+ - **CLI** with the same capabilities for harnesses without MCP.
65
+ - **Skill** (`skills/revdeck`) carrying the review procedure, criteria, feedback workflow and
66
+ cross-project feature workflow.
67
+ - MCP prompts `review-mr`, `close-feedback` and `review-feature`.
68
+ - Context is deterministic and size-limited: summary, changed files, effective rules, threads,
69
+ findings, drafts and next actions.
70
+ - The agent cannot publish, resolve threads, approve/merge or call platform CLIs directly.
71
+ - Publication requires an approval bound to a hash of the exact plan; `publish.commit` is idempotent
72
+ and skips already-posted items.
73
+
74
+ ## Projects
75
+
76
+ A project is a repository, not a "frontend" or "backend" kind.
77
+
78
+ - Stable key `platform:host/project`, normalized for comparison; display values are kept separately.
79
+ - Project registry and working-copy roots (`projects`, `project_roots`); one project can have several
80
+ clones/worktrees.
81
+ - Reviews carry `projectKey`; the UI, HTTP API and CLI can filter by project or working-copy root.
82
+ - `revdeck projects` lists projects, roots and review counts; `revdeck projects add <path>` registers a
83
+ project before its first review.
84
+ - The UI has a project switcher and a projects home; only the selected project's reviews are shown.
85
+ The selection is stored in the URL and local storage.
86
+ - An MCP server is scoped to the repository it runs in: status/list/open only see that project, and a
87
+ review id or URL from another project is rejected. `REVDECK_ROOT` supports multi-root workspaces.
88
+ - Devcontainers mount a stable bridge to the host daemon; the container never starts its own daemon.
89
+ - Cross-project work is possible only through an explicit feature.
90
+
91
+ ## Features
92
+
93
+ A feature is a human-created bundle of reviews from one or more projects. It is not a project and not
94
+ a permanent project link; a project appears in a feature while at least one of its reviews is a member.
95
+
96
+ - Title, Markdown brief (goal, non-goals, rollout order, acceptance criteria), separate Markdown or
97
+ OpenAPI contract, status (`open`/`archived`).
98
+ - Ordered reviews with free-form roles (`api`, `ui`, `worker`, `mobile`); several reviews from one
99
+ project are allowed.
100
+ - **OpenAPI contract:** parsed into operations, parameters, request bodies, responses and schemas. The
101
+ feature context marks which changed reviews mention each operation path.
102
+ - **Application profiles:** `context.sources` / `context.maxBytes` in each repository; included once
103
+ per project as background, never as review criteria.
104
+ - **Feature notes/findings:** cross-project notes stored on the feature, visible in the UI and context.
105
+ They are never published. Humans write them in the UI/CLI; an agent may write them only in a feature
106
+ session through `revdeck_feature_note`, and may change/delete only notes authored by an agent.
107
+ Note and profile text is treated as data, not instructions.
108
+ - **Project session:** sees its project and features that include it; may read the combined feature
109
+ context, but writes drafts only in its own project.
110
+ - **Feature session:** started explicitly with `REVDECK_FEATURE=<id>`. The current repository must be a
111
+ member; the scope covers only members. Drafts may be written to any member. Publishing remains per
112
+ review and requires human approval. Feature notes may be written.
113
+ - Feature membership is revalidated on tool calls: removing the current project/review revokes access.
114
+ - Combined context contains the brief, parsed contract or raw Markdown, application profiles, feature
115
+ notes, an overview matrix and one section per review with its own project rules. Rules are never
116
+ merged; the budget is split across reviews.
117
+ - UI: feature list, feature page with project groups, roles, contract, notes, context preview, agent
118
+ command, archive, delete, reorder and add-review flows.
119
+ - CLI: `revdeck feature list|create|get|add|remove|reorder|notes|note|note-delete|context|update|archive|delete`.
120
+ - MCP: `revdeck_feature` (read-only list/get/context/notes) and `revdeck_feature_note` (feature session
121
+ only, never published).
122
+ - Removing a tracked review that belongs to a feature is blocked until it is removed from the feature.
123
+ - There is no feature-level publish; findings and summaries belong to their reviews.
124
+
125
+ ## User interface
126
+
127
+ - Local Svelte 5 SPA served by the daemon with a one-time launch token and cookie session.
128
+ - Project switcher, projects home, feature list and feature page.
129
+ - Review tabs: Overview, Threads, Findings, Diff, Rules, Analytics.
130
+ - Keyboard shortcuts (`1`–`5`, `o`, `r`, `s`, `p`, `?`), command palette, deep links to threads,
131
+ findings and diff lines with browser Back/Forward.
132
+ - Markdown preview, attachment button, reactions, line comments, publish dialog with exact plan.
133
+ - Russian and English interface; language is independent from the language of review output.
134
+ - Responsive sidebar and mobile backdrop; dark/light theme via CSS variables.
135
+
136
+ ## Security and trust
137
+
138
+ - Unix socket with `0700` directory and `0600` socket; loopback UI only; `Host`/`Origin` checks,
139
+ `HttpOnly` `SameSite=Strict` cookie, CSP.
140
+ - Platform CLI calls without a shell, outside the working copy, with a scrubbed environment; secrets
141
+ redacted in logs and errors.
142
+ - MR text, comments and diff are untrusted data; the skill and context say so.
143
+ - Comment sanitizer blocks HTML, control/bidi characters, GitLab quick actions and mass mentions;
144
+ external images are links, not loads.
145
+ - Approvals are random, single-use, TTL-bound and tied to the review and plan hash.
146
+ - Project and feature scopes are **context isolation**, not a security boundary: one daemon and one
147
+ database remain; a process with access to the user's home can read them.
148
+ - Hard isolation would require a separate daemon/state directory under another user/container; that is
149
+ outside the current model and breaks cross-project review.
150
+
151
+ ## Configuration
152
+
153
+ `.revdeck.yml` (or `.revdeck.yaml`) at the repository root, with personal `.revdeck.local.yml`
154
+ overrides:
155
+
156
+ - `version`, `provider` (`type`, `host`, `project`, `base`), `output.language`.
157
+ - `review`: agents, roles, custom roles, groups, secrets, history, readOnly.
158
+ - `context`: application-profile sources and `maxBytes`.
159
+ - `rules`: sources, path map, ignore, document/total limits.
160
+ - `checks`: id, name, argv, path conditions, consent, timeout.
161
+ - `publish`: approval requirement, max comments.
162
+
163
+ Explicit CLI arguments override config, config overrides the git remote; this prevents redirecting a
164
+ review by tampering with `.git/config`. The schema is validated by zod and unknown fields fail with a
165
+ path.
166
+
167
+ ## Operations
168
+
169
+ - `revdeck init`: config, skill, harness adapters and MCP config; idempotent, never overwrites foreign
170
+ keys.
171
+ - `revdeck eject`: inverse operation; plan by default, `--yes` to apply, `--keep-config` to keep the
172
+ config.
173
+ - `revdeck doctor`: Node, git, `glab`/`gh` auth, daemon, adapters; knows about devcontainers.
174
+ - Daemon lifecycle: start/stop/restart/status/logs/install/uninstall; systemd user unit on Linux,
175
+ launchd on macOS.
176
+ - Devcontainer bridge: stable socket/state mounts; host-side `glab`/`gh`; no daemon in the container.
177
+ - HTTP transport for containers where the socket is not forwarded (`REVDECK_URL`, `REVDECK_TOKEN`).
178
+ - Export/import for sandboxes without a socket.
179
+ - Linux and macOS autostart; Windows runs manually.
180
+
181
+ ## Architecture decisions
182
+
183
+ ### Daemon-first
184
+
185
+ A long-lived user-owned daemon holds credentials, SQLite, providers, RPC, HTTP/SSE and the UI. CLI and
186
+ MCP are thin clients. The alternative — an MCP process per session without a daemon — was rejected
187
+ because the UI would not survive the session, agents would compete for state, tokens would end up in
188
+ the agent process and containers would still need a host process. File exchange remains only as
189
+ `export`/`import`.
190
+
191
+ Consequences: daemon lifecycle, socket permissions, a bridge for containers, version-matched clients,
192
+ background sync and SSE. One daemon serves several repositories; `root` is passed on open and config is
193
+ read from that root.
194
+
195
+ ### Project scopes
196
+
197
+ A project is a repository. The key is `platform:host/project`; reviews carry it and the daemon keeps a
198
+ registry with working-copy roots. The UI and CLI are project-scoped; the MCP server is scoped to the
199
+ repository it runs in. A per-project daemon/database was rejected: it breaks cross-project review,
200
+ adds ports/services/backups and is still not a security boundary against the same user.
201
+
202
+ Consequences: migration/backfill, project-scoped MCP errors, multi-root workspace configuration, and
203
+ explicit context-only isolation.
204
+
205
+ ### Explicit features
206
+
207
+ Because projects are isolated, cross-project work needs an explicit human-created feature. The feature
208
+ is the only door: membership is chosen per task; project sessions read the combined context but write
209
+ only in their project; a feature session may write across members, with per-review publishing. A
210
+ permanent project link or automatic cross-project discovery was rejected because it leaks contexts into
211
+ unrelated tasks.
212
+
213
+ Consequences: feature notes are non-published, contracts and profiles are human-provided, feature
214
+ sessions are explicit, and removing membership revokes access on the next tool call.
215
+
216
+ ## Non-goals and limitations
217
+
218
+ - Replacing the native GitLab/GitHub diff viewer; the UI is for triage and approval.
219
+ - Built-in static analysis; checks are delegated to the project's tools.
220
+ - A multi-user server or role-based authorization.
221
+ - Hard security isolation between projects; see the caveat above.
222
+ - Native draft notes/pending reviews (providers are ready, publishing uses regular comments).
223
+ - GitHub attachment upload via public API.
224
+ - Automatic OpenAPI-based static validation of client code: the contract is parsed and given to the
225
+ agent; the agent validates the implementation.
226
+ - Feature-level publishing or automatically publishing a whole feature.
227
+ - Source checkout of other repositories in a feature context: only review data, profiles and contracts.
@@ -14,6 +14,12 @@ 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]
20
+ context:
21
+ sources: [docs/AppContext.md] # application profile, not review rules
22
+ maxBytes: 30000
17
23
  rules:
18
24
  sources: [AGENTS.md]
19
25
  map:
@@ -33,6 +39,29 @@ publish:
33
39
  maxComments: 50
34
40
  ```
35
41
 
42
+ ## Personal overrides: `.revdeck.local.yml`
43
+
44
+ `revdeck` also reads `.revdeck.local.yml` (or `.revdeck.local.yaml`) next to the base config. Use it for
45
+ local roles, checks, output language or provider settings without changing the shared file. `init`
46
+ adds both local names to `.gitignore`.
47
+
48
+ Merge rules:
49
+
50
+ - objects are merged recursively;
51
+ - arrays and scalars from the local file replace the base value;
52
+ - `review.readOnly: true` in the base cannot be disabled locally (the effective value is OR);
53
+ - local file alone is allowed, but a base `.revdeck.yml` is recommended for the team;
54
+ - YAML/schema errors in the local file are reported, never silently ignored.
55
+
56
+ ```yaml
57
+ # .revdeck.local.yml — do not commit
58
+ review:
59
+ agents: 2
60
+ roles: [correctness, tests]
61
+ output:
62
+ language: ru
63
+ ```
64
+
36
65
  ## provider
37
66
 
38
67
  | Field | Default | Meaning |
@@ -46,6 +75,59 @@ Explicit CLI arguments (`--platform`, `--project`, `--host`) take precedence ove
46
75
  config takes precedence over the git remote. This way, tampering with `.git/config` cannot redirect the
47
76
  review to a different project.
48
77
 
78
+ ## Project identity
79
+
80
+ A project is a repository. Its key is `platform:host/project`, normalized for comparison (host and
81
+ path are lower-cased; the original values are kept for display). One repository can have several
82
+ working-copy roots, but they are one project.
83
+
84
+ The key is derived from `provider` (or the git remote) and stored in the daemon registry. There is no
85
+ `kind` field: "api", "web" or "mobile" are not project types, and a project does not need them. A
86
+ review always uses the config and rules from its own working-copy root, so several roots of the same
87
+ project do not mix their rules.
88
+
89
+ ```bash
90
+ revdeck projects # list projects, review counts and roots
91
+ revdeck projects add /path/repo # register a project before its first review
92
+ ```
93
+
94
+ The UI and agent scope are described in [architecture.md](architecture.md) and
95
+ [capabilities](capabilities.md#project-scopes).
96
+
97
+ ## Features and contracts
98
+
99
+ Features are not `.revdeck.yml` settings: they are local daemon records created by a human in the UI
100
+ or CLI. A feature has a title, a Markdown **brief**, a separate **contract** (Markdown or OpenAPI) and
101
+ an ordered set of reviews. Put the task goal, non-goals, rollout order and acceptance criteria into the
102
+ brief; put the API/event contract into the contract field. OpenAPI is parsed into operations and
103
+ schemas, and the feature context marks which changed reviews mention each path. Each member review
104
+ keeps its own `.revdeck.yml` and rules; the brief and contract never override them.
105
+
106
+ Application profiles are background documents, not review criteria. Declare them per repository:
107
+
108
+ ```yaml
109
+ context:
110
+ sources: [docs/AppContext.md, docs/API.md]
111
+ maxBytes: 30000
112
+ ```
113
+
114
+ `maxBytes` is the aggregate limit for the project profile; `0` uses the feature-context budget. The
115
+ feature context itself is capped by `revdeck feature context --max-bytes` (or the MCP `max_bytes`).
116
+ Profile and note text is quoted and treated as data, not instructions.
117
+
118
+ Feature notes/findings are stored on the feature and are never published. Publishing remains per
119
+ review.
120
+
121
+ ```bash
122
+ revdeck feature create "Checkout v2" --brief brief.md --contract openapi.yaml \
123
+ <review-id> <review-id>
124
+ revdeck feature context ft-a1b2c3
125
+ revdeck feature note ft-a1b2c3 --title "Contract gap" --body "Client is missing a header" --kind finding --level major
126
+ ```
127
+
128
+ To start a feature-scoped agent session, run the MCP server from a repository that is a feature
129
+ member with `REVDECK_FEATURE=<feature id>`. Project rules are still read from each member's own root.
130
+
49
131
  ## output
50
132
 
51
133
  - `language: auto` — findings and replies are written in the language of the MR description and
@@ -56,6 +138,69 @@ review to a different project.
56
138
  via `--lang ru|en`, `REVDECK_LANG`, or the toggle in the UI.
57
139
  - `revdeck init --lang en` selects the English skill and writes `REVDECK_LANG` to the MCP config.
58
140
 
141
+ ## review
142
+
143
+ The review can be split between independent agents. The daemon stores the final result; spawning is done
144
+ by the harness (Claude Code subagents, DSH workflow, or another orchestrator).
145
+
146
+ ```yaml
147
+ review:
148
+ agents: 3
149
+ roles: [correctness, architecture, tests]
150
+ ```
151
+
152
+ | Field | Default | Meaning |
153
+ |---|---|---|
154
+ | `agents` | `3` | number of independent reviewers, 1–8 |
155
+ | `roles` | correctness, architecture, tests | roles for the reviewers; a shorter list is repeated to reach `agents` |
156
+
157
+ Available roles:
158
+
159
+ | Role | Focus | Criteria.md |
160
+ |---|---|---|
161
+ | `correctness` | logic, edge cases, errors, async and state | §6, §10 |
162
+ | `architecture` | layers, responsibility, coupling, precedents, ADRs | §3–§5, §7 |
163
+ | `tests` | coverage, assertions, missing cases, flakiness | §8 |
164
+ | `security` | authorization, validation, secrets, injections, shell | §10 |
165
+ | `performance` | complexity, N+1, allocations, blocking work | §10 |
166
+ | `compatibility` | public API, migrations, config and backward compatibility | §6, §7 |
167
+ | `docs` | documentation, configs, CHANGELOG and AI instructions | §9 |
168
+ | `concurrency` | races, locks, idempotency, retries, cancellation | §10 |
169
+ | `ux` | UI states, accessibility, errors, narrow screens | §9, §10 |
170
+ | `data` | schemas, migrations, storage | §3, §10 |
171
+ | `api` | public contracts, versioning, client compatibility | §6, §7 |
172
+ | `dependencies` | versions, licenses, supply chain | §3, §10 |
173
+ | `observability` | logs, metrics, traces, diagnostics | §9, §10 |
174
+ | `build` | CI, build, packaging, reproducibility | §8, §9 |
175
+ | `privacy` | PII, personal data, logs and leaks | §9, §10 |
176
+ | `general` | full review across all sections | §1–§12 |
177
+
178
+ Custom roles live in `review.customRoles`; `roles` may reference built-ins or those keys:
179
+
180
+ ```yaml
181
+ review:
182
+ roles: [correctness, accessibility]
183
+ customRoles:
184
+ accessibility:
185
+ title: "Accessibility"
186
+ description: "Keyboard navigation, ARIA, focus and contrast."
187
+ criteria: ["9", "10"]
188
+ focus: "a11y and keyboard"
189
+ instructions: |
190
+ Report only accessibility problems; do not repeat general architecture findings.
191
+ ```
192
+
193
+ Custom ids cannot override a built-in role. `review.readOnly: true` disables all writes and publishing
194
+ for that review (the UI shows a banner, the daemon rejects mutations).
195
+
196
+ Several MRs can be opened at once with `revdeck open 345 344 556` (or an array in `revdeck_open`); run
197
+ a separate group per review and do not merge findings across MRs.
198
+
199
+ `revdeck context <N> --role <role> --shard i/N` renders a worker context with only its files (and threads
200
+ for those files), plus a reminder not to write findings. The MCP tool accepts the same `role` and `shard`
201
+ arguments. The lead agent should collect the workers' JSON, deduplicate by `file:line:title`, and only
202
+ then call `revdeck_set_summary` / `revdeck_draft_findings`.
203
+
59
204
  ## rules
60
205
 
61
206
  - `sources` — exact document paths (optional `#section`), not glob patterns. Use `map.match` to select
@@ -101,6 +246,48 @@ rules:
101
246
  If `rules.sources`/`rules.map` are set, auto-discovery is disabled; a missing explicit document then
102
247
  produces its own warning instead. Empty `sources: []` keeps auto-discovery enabled.
103
248
 
249
+ ### Change groups
250
+
251
+ ```yaml
252
+ review:
253
+ groups:
254
+ - id: auth
255
+ title: "Authorization"
256
+ match: ["src/auth/**", "src/security/**"]
257
+ ```
258
+
259
+ Explicit groups are applied first; other files are grouped by kind (docs, tests, config, styles,
260
+ generated) and by top-level module. Groups are shown in Overview and in the agent context.
261
+
262
+ ### Secret scan
263
+
264
+ Off by default:
265
+
266
+ ```yaml
267
+ review:
268
+ secrets:
269
+ enabled: true
270
+ scan: diff # diff | files | both
271
+ includeTests: false
272
+ allowlist: ["test/fixtures/**", "rule:generic-secret"]
273
+ ```
274
+
275
+ The scanner looks for AWS/GitHub/GitLab/Stripe/OpenAI keys, private keys and generic secret
276
+ assignments. Only a masked preview is returned; raw values are never stored in the review or sent to the
277
+ agent. `revdeck scan <N>` returns the same list.
278
+
279
+ ### Version history
280
+
281
+ ```yaml
282
+ review:
283
+ history:
284
+ enabled: true
285
+ keep: 20
286
+ ```
287
+
288
+ Each refresh with a changed head/diff stores a version (head/base SHA, diff hash, counts and review
289
+ snapshot). `revdeck versions <N>` lists them; Overview shows the timeline. Versions are pruned to `keep`.
290
+
104
291
  ### Document selectors
105
292
 
106
293
  | Selector | What is included |
@@ -133,7 +320,8 @@ string would allow arbitrary code to be executed during a review.
133
320
  | `consent` | requires explicit confirmation (default `true`) |
134
321
  | `timeoutMs` | timeout (default 300,000) |
135
322
 
136
- Running: `revdeck checks <N> --run --yes`. The MCP tool only shows the plan.
323
+ Running: `revdeck checks <N> --run --yes`, or **Run matching** in the Rules tab with an explicit
324
+ confirmation. Read-only reviews disable the runner. The MCP tool only shows the plan.
137
325
 
138
326
  ## publish
139
327
 
@@ -151,6 +339,7 @@ Running: `revdeck checks <N> --run --yes`. The MCP tool only shows the plan.
151
339
  | `REVDECK_DEV_CONTAINER=1` | do not start a local daemon; fail with a host-daemon hint instead |
152
340
  | `REVDECK_UI_HOST` | host used by `revdeck ui` from a container (for example `host.docker.internal`) |
153
341
  | `REVDECK_ROOT` | project root for the MCP server |
342
+ | `REVDECK_FEATURE` | feature id for a feature-scoped MCP session; the current project must be a member |
154
343
  | `REVDECK_LANG` | CLI/MCP/daemon language: `ru` or `en` (default: system locale) |
155
344
  | `REVDECK_GLAB` | absolute path to `glab` when the daemon PATH does not contain it |
156
345
  | `REVDECK_GH` | absolute path to `gh` when the daemon PATH does not contain it |
@@ -159,3 +348,9 @@ Running: `revdeck checks <N> --run --yes`. The MCP tool only shows the plan.
159
348
 
160
349
  `revdeck config --json` shows the effective config, the path where it was found, and warnings.
161
350
  `revdeck rules --explain src/app.ts` shows which documents and sections were selected for the file.
351
+
352
+ ## Example configurations
353
+
354
+ Runnable examples live in [examples](../examples/): `simple.yml`, `monorepo.yml` and
355
+ `analytics-platform.yml`. The test suite parses every example, checks its path map and checks, and
356
+ verifies that each example selects at least one check for a changed source file.
@@ -75,6 +75,8 @@ For Claude Code, add the tools to `.claude/settings.local.json` (personal) or `.
75
75
  "mcp__revdeck__revdeck_diff",
76
76
  "mcp__revdeck__revdeck_rules",
77
77
  "mcp__revdeck__revdeck_notes",
78
+ "mcp__revdeck__revdeck_feature",
79
+ "mcp__revdeck__revdeck_feature_note",
78
80
  "mcp__revdeck__revdeck_set_summary",
79
81
  "mcp__revdeck__revdeck_draft_findings",
80
82
  "mcp__revdeck__revdeck_draft_reply",
@@ -173,6 +175,39 @@ Fallbacks:
173
175
  with the daemon started on the host with `--host 0.0.0.0`.
174
176
  2. `revdeck export <N>` on the host and `revdeck import <N>` in the container — a file bridge.
175
177
 
178
+ ## Several projects and devcontainers
179
+
180
+ Each repository is its own project. A `.mcp.json` (or `.cursor/mcp.json`) inside the repository pins
181
+ the MCP server to that repository; the server resolves the project from its root and lists only that
182
+ project's reviews. With one devcontainer per repository, each container mounts the same host daemon
183
+ bridge and stays scoped to its own working copy.
184
+
185
+ For a multi-root workspace with several repositories, add one MCP server entry per project with an
186
+ explicit `REVDECK_ROOT` and a unique server name. The server does not accept a `root` or project
187
+ override from the agent, so one session cannot open another project's review. `revdeck projects`
188
+ lists the registry; `revdeck projects add <path>` registers a repository before its first review.
189
+
190
+ Cross-project work goes through an explicit feature (above); outside a feature a foreign review is
191
+ rejected with a hint to open a separate session. See [capabilities](capabilities.md#features).
192
+
193
+ ## Feature sessions
194
+
195
+ A project session is scoped to one repository. To let one agent review a feature that spans several
196
+ projects, start the MCP server from a repository that is a feature member with:
197
+
198
+ ```bash
199
+ REVDECK_FEATURE=ft-a1b2c3 revdeck mcp
200
+ ```
201
+
202
+ In an MCP config this is the `REVDECK_FEATURE` value in the `revdeck` server's `env`. The server
203
+ validates that the current project is a member and expands the scope only to the feature's reviews. Drafts may be written to any member; publishing still needs a separate human approval for
204
+ each review. Feature membership is created by the human in the UI or CLI, never by the agent.
205
+
206
+ In a devcontainer the same rule applies: the container's repository must be a feature member, and the
207
+ server talks to the host daemon over the same bridge. The combined context is review data plus the
208
+ declared `context.sources` profile files from member checkouts; symlinked paths outside a member root
209
+ are rejected. Arbitrary source trees of other repositories are not read.
210
+
176
211
  ## Verification
177
212
 
178
213
  ```bash