revdeck 0.5.0 → 0.7.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 (60) hide show
  1. package/CHANGELOG.md +105 -2
  2. package/README.md +102 -22
  3. package/README.ru.md +105 -29
  4. package/SECURITY.md +1 -1
  5. package/dist/cli.js +1484 -593
  6. package/dist/cli.js.map +4 -4
  7. package/dist/daemon.js +1768 -283
  8. package/dist/daemon.js.map +4 -4
  9. package/dist/mcp.js +980 -117
  10. package/dist/mcp.js.map +4 -4
  11. package/dist/ui/assets/index-BIVPy49b.css +1 -0
  12. package/dist/ui/assets/index-BcvEWwhI.js +18 -0
  13. package/dist/ui/favicon.svg +8 -3
  14. package/dist/ui/icon-128.png +0 -0
  15. package/dist/ui/icon-32.png +0 -0
  16. package/dist/ui/index.html +4 -2
  17. package/docs/README.md +4 -1
  18. package/docs/architecture.md +60 -11
  19. package/docs/assets/brand/README.md +49 -0
  20. package/docs/assets/brand/icon-1024.png +0 -0
  21. package/docs/assets/brand/icon-128.png +0 -0
  22. package/docs/assets/brand/icon-256.png +0 -0
  23. package/docs/assets/brand/icon-32.png +0 -0
  24. package/docs/assets/brand/icon-512.png +0 -0
  25. package/docs/assets/brand/icon-64.png +0 -0
  26. package/docs/assets/brand/icon.svg +9 -0
  27. package/docs/assets/brand/logo-dark.png +0 -0
  28. package/docs/assets/brand/logo-dark.svg +13 -0
  29. package/docs/assets/brand/logo.png +0 -0
  30. package/docs/assets/brand/logo.svg +13 -0
  31. package/docs/capabilities.md +238 -0
  32. package/docs/configuration.md +87 -8
  33. package/docs/integrations.md +52 -14
  34. package/docs/protocol.md +85 -14
  35. package/docs/ru/README.md +4 -1
  36. package/docs/ru/architecture.md +60 -10
  37. package/docs/ru/capabilities.md +240 -0
  38. package/docs/ru/configuration.md +74 -6
  39. package/docs/ru/integrations.md +52 -14
  40. package/docs/ru/protocol.md +83 -13
  41. package/docs/ru/threat-model.md +34 -5
  42. package/docs/screenshot.png +0 -0
  43. package/docs/screenshot.ru.png +0 -0
  44. package/docs/threat-model.md +36 -5
  45. package/examples/analytics-platform.yml +40 -0
  46. package/examples/monorepo.yml +1 -1
  47. package/package.json +1 -1
  48. package/skills/revdeck/en/Feature.md +61 -0
  49. package/skills/revdeck/en/Feedback.md +3 -2
  50. package/skills/revdeck/en/Review.md +3 -2
  51. package/skills/revdeck/en/SKILL.md +17 -1
  52. package/skills/revdeck/ru/Feature.md +61 -0
  53. package/skills/revdeck/ru/Feedback.md +3 -2
  54. package/skills/revdeck/ru/Review.md +2 -2
  55. package/skills/revdeck/ru/SKILL.md +18 -1
  56. package/dist/ui/assets/index-CcmcJhhu.css +0 -1
  57. package/dist/ui/assets/index-CuvK5owY.js +0 -10
  58. package/docs/adr/0001-daemon-first.md +0 -65
  59. package/docs/ru/adr/0001-daemon-first.md +0 -63
  60. package/examples/web-chat-core.yml +0 -45
@@ -1,4 +1,9 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
- <rect width="64" height="64" rx="14" fill="#3b6ef5"/>
3
- <path d="M17 33.5l10 10 20-21" fill="none" stroke="#fff" stroke-width="6" stroke-linecap="round" stroke-linejoin="round"/>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
2
+ <rect width="64" height="64" rx="14" fill="#3B6EF5"/>
3
+ <rect x="22" y="12" width="26" height="33" rx="4.5" fill="#7C5CFF"/>
4
+ <rect x="17.5" y="16.5" width="26" height="33" rx="4.5" fill="#D7E3FF"/>
5
+ <rect x="13" y="21.5" width="28" height="32" rx="5" fill="#FFFFFF"/>
6
+ <rect x="18" y="29.2" width="12" height="2.6" rx="1.3" fill="#3B6EF5"/>
7
+ <rect x="18" y="34.6" width="17.5" height="2.6" rx="1.3" fill="#3B6EF5"/>
8
+ <rect x="18" y="40" width="8.5" height="2.6" rx="1.3" fill="#3B6EF5"/>
4
9
  </svg>
Binary file
Binary file
@@ -6,9 +6,11 @@
6
6
  <meta name="color-scheme" content="light dark" />
7
7
  <meta name="referrer" content="no-referrer" />
8
8
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
9
+ <link rel="icon" href="/icon-32.png" type="image/png" sizes="32x32" />
10
+ <link rel="apple-touch-icon" href="/icon-128.png" />
9
11
  <title>revdeck</title>
10
- <script type="module" crossorigin src="/assets/index-CuvK5owY.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-CcmcJhhu.css">
12
+ <script type="module" crossorigin src="/assets/index-BcvEWwhI.js"></script>
13
+ <link rel="stylesheet" crossorigin href="/assets/index-BIVPy49b.css">
12
14
  </head>
13
15
  <body>
14
16
  <div id="app"></div>
package/docs/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ <p align="center"><img src="assets/brand/icon-128.png" alt="revdeck" width="72"></p>
2
+
1
3
  # revdeck documentation
2
4
 
3
5
  [English](README.md) | [Русский](ru/README.md)
@@ -7,11 +9,12 @@ slightly behind.
7
9
 
8
10
  | Document | English | Русский |
9
11
  |---|---|---|
12
+ | Capabilities and decisions | [capabilities.md](capabilities.md) | [ru/capabilities.md](ru/capabilities.md) |
10
13
  | Overview and design | [architecture.md](architecture.md) | [ru/architecture.md](ru/architecture.md) |
11
14
  | Configuration and rules | [configuration.md](configuration.md) | [ru/configuration.md](ru/configuration.md) |
12
15
  | RPC and HTTP protocol | [protocol.md](protocol.md) | [ru/protocol.md](ru/protocol.md) |
13
16
  | Threat model | [threat-model.md](threat-model.md) | [ru/threat-model.md](ru/threat-model.md) |
14
17
  | 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) |
18
+ | Brand assets | [assets/brand/README.md](assets/brand/README.md) | [(EN)](assets/brand/README.md) |
16
19
 
17
20
  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,35 +26,40 @@ 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
- - `src/daemon/bridge.ts` — an additional RPC socket in a stable home-based directory for devcontainers.
39
- - `src/daemon/http.ts` — UI and `/api/*`, SSE events, cookie session with a one-time token.
38
+ - `src/daemon/bridge.ts` — an additional agent-scoped RPC socket in a stable home-based directory for devcontainers (no publish/checks/admin, no UI token).
39
+ - `src/daemon/http.ts` — UI and `/api/*`, SSE events, cookie session with a launch token (not mounted into containers).
40
40
  - `src/cli` — commands, `init`, `doctor`, export/import of the old file format.
41
41
  - `src/mcp` — MCP server: tools and prompts, a thin wrapper over RPC.
42
42
  - `ui` — Svelte 5 SPA, built into `dist/ui`.
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
50
50
  for changed paths), snippets, threads, and findings.
51
51
  4. The agent writes drafts (`drafts.put`, `findings.put`, `summary.put`, `notes.update`).
52
- 5. A human in the UI calls `publish.preview` → sees the exact plan and hash → `publish.approve` →
53
- `publish.commit`. The daemon executes only the items included in the approved plan.
52
+ 5. A human in the UI or host CLI calls `publish.preview` → sees the exact plan and hash →
53
+ `publish.approve` → `publish.commit`. The bridge has no approve/commit (`CAPABILITY`); the daemon
54
+ executes only the items included in the approved plan.
54
55
  6. Background sync every 2 minutes refreshes open reviews and broadcasts SSE events to the UI.
55
56
 
56
57
  ## Data model
57
58
 
59
+ - `Project` — a repository: `key = platform:host/project` (normalized for comparison), display values,
60
+ and one or more working-copy roots. Reviews carry the same `projectKey`.
61
+ - `Feature` — an explicit bundle of reviews with a brief, contract and notes; `FeatureReview` adds a
62
+ role and order; `FeatureNote` holds non-published cross-project notes/findings.
58
63
  - `ReviewRef` — platform, host, project, number. `reviewId` — `platform:host/project!number`.
59
64
  - `DiffFile`/`Hunk`/`DiffLine` — line numbers in the old and new versions; a finding's `line` always
60
65
  refers to the new file.
@@ -64,6 +69,49 @@ agent (MCP/CLI) ──▶ revdeck daemon ──glab/gh──▶ GitLab/GitHub
64
69
  - `Approval` — a one-time id tied to `hash = sha256(canonicalJson({reviewId, kind, items}))`,
65
70
  with a 10-minute TTL.
66
71
 
72
+ ## Projects and isolation
73
+
74
+ One daemon serves several repositories. A **project** is one repository, identified by
75
+ `platform:host/project`; a review stores its project key and its own working-copy root. The daemon
76
+ registry (`projects`, `project_roots`) is populated when a review is opened or when a project is
77
+ registered explicitly (`revdeck projects add <path>`).
78
+
79
+ - The UI selects one project at a time: a switcher, a projects home, and a review queue scoped to the
80
+ selection. The selection is kept in the URL and in local storage. The projects home registers a
81
+ working copy, edits the display title and roots, and deletes a project with its cached reviews;
82
+ project deletion never calls the platform.
83
+ - The MCP server is the isolation point. It resolves its project from `REVDECK_ROOT` (or the current
84
+ directory), lists only that project, and rejects review ids/URLs from other projects. The agent gets
85
+ no `root` or project overrides.
86
+ - `reviews.list` accepts `project` or `root`; this is a filter for the UI/CLI, not a security boundary.
87
+ One daemon and one database remain; a process with access to the user's home can read the database.
88
+ - Cross-project work is not implicit. A human-created feature links reviews from several projects; a
89
+ foreign review is rejected outside it. See [capabilities](capabilities.md#project-scopes) and [Features](#features).
90
+
91
+ ## Features
92
+
93
+ A **feature** is a human-created bundle of reviews across projects. It is not a project and not a
94
+ permanent project link: projects appear in it only while at least one of their reviews is a member.
95
+ The `features` table holds the title, Markdown brief, a separate Markdown/OpenAPI contract, status
96
+ and human/agent feature notes; `feature_reviews` holds membership, a free-form role and order. Several
97
+ reviews from one project are allowed. OpenAPI contracts are parsed into operations and schemas, and
98
+ the context marks which changed reviews mention each operation. Application profiles are background
99
+ documents declared in `context.sources` of each repository (`context.maxBytes` caps them).
100
+
101
+ - The UI and CLI create/edit features; MCP exposes read-only discovery/context and, in a feature session,
102
+ `revdeck_feature_note` for agent-authored notes (never published).
103
+ - A **project session** sees features that include its project, may read the combined context, and
104
+ writes only in its project.
105
+ - A **feature session** is explicit (`REVDECK_FEATURE=<id>`): the current repository must be a member,
106
+ the scope covers only members, and drafts may be written to any member. Publishing remains per
107
+ review and requires human approval.
108
+ - The combined context contains the brief, the contract (parsed OpenAPI or raw Markdown), application
109
+ profiles, feature notes, an overview matrix and one section per review with its own project rules.
110
+ Rules are never merged. The budget is split across reviews.
111
+ - There is no feature-level publish. Findings and summaries belong to reviews; feature notes/findings
112
+ are a non-published cross-project scratchpad. The feature aggregates reviews for navigation. See
113
+ [capabilities](capabilities.md#features).
114
+
67
115
  ## Idempotency and concurrency
68
116
 
69
117
  - Draft and finding writes go through a single process; SQLite in WAL mode.
@@ -83,7 +131,8 @@ agent (MCP/CLI) ──▶ revdeck daemon ──glab/gh──▶ GitLab/GitHub
83
131
  Harnesses without MCP use the CLI.
84
132
  - **Rules**: `rules.map`/`rules.sources` in `.revdeck.yml`; rule packs can be distributed as a regular
85
133
  configuration file.
86
- - **Checks**: `checks` with argv, no shell; run only on explicit confirmation.
134
+ - **Checks**: `checks` with argv; the agent only plans, a human runs them in the UI or host CLI;
135
+ the bridge denies `checks.run`.
87
136
 
88
137
  ## Performance
89
138
 
@@ -0,0 +1,49 @@
1
+ # revdeck brand assets
2
+
3
+ Logo and icon files used by the README, documentation and the web UI.
4
+
5
+ ## Logo (wordmark)
6
+
7
+ | File | Use |
8
+ |---|---|
9
+ | `logo.svg` | light backgrounds, README/docs |
10
+ | `logo-dark.svg` | dark backgrounds (`prefers-color-scheme: dark`) |
11
+ | `logo.png` | 1819×512 raster fallback, light backgrounds |
12
+ | `logo-dark.png` | 1819×512 raster fallback, dark backgrounds |
13
+
14
+ The SVG wordmark uses outlined Inter glyphs (SIL Open Font License 1.1). Keep the icon and the
15
+ wordmark together; do not stretch, recolor or add effects.
16
+
17
+ ## Icon
18
+
19
+ | File | Use |
20
+ |---|---|
21
+ | `icon.svg` | favicon and scalable UI icon (64×64 viewBox) |
22
+ | `icon-32.png` | 32×32 favicon fallback |
23
+ | `icon-64.png` | 64×64 UI |
24
+ | `icon-128.png` | 128×128 UI / Apple touch icon |
25
+ | `icon-256.png` | 256×256 |
26
+ | `icon-512.png` | 512×512 |
27
+ | `icon-1024.png` | 1024×1024 source asset |
28
+
29
+ ## Palette
30
+
31
+ | Token | Value |
32
+ |---|---|
33
+ | blue | `#3B6EF5` |
34
+ | violet | `#7C5CFF` |
35
+ | pale blue | `#D7E3FF` |
36
+ | light text | `#16191D` |
37
+ | dark text | `#E6E9EE` |
38
+
39
+ Clear space around the mark: at least half the icon's corner radius. Minimum icon size: 24 px.
40
+
41
+ ## Where it is used
42
+
43
+ - `README.md` / `README.ru.md` — centered logo with a dark-mode variant;
44
+ - `docs/README.md` / `docs/ru/README.md` — icon in the documentation index;
45
+ - `ui/public/favicon.svg`, `ui/public/icon-32.png`, `ui/public/icon-128.png` — browser tab,
46
+ bookmarks and Apple touch icon;
47
+ - `ui/src/App.svelte` — sidebar brand icon.
48
+
49
+ The assets are part of the package through the `docs` and `dist/ui` entries in `package.json`.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="none">
2
+ <rect width="64" height="64" rx="14" fill="#3B6EF5"/>
3
+ <rect x="22" y="12" width="26" height="33" rx="4.5" fill="#7C5CFF"/>
4
+ <rect x="17.5" y="16.5" width="26" height="33" rx="4.5" fill="#D7E3FF"/>
5
+ <rect x="13" y="21.5" width="28" height="32" rx="5" fill="#FFFFFF"/>
6
+ <rect x="18" y="29.2" width="12" height="2.6" rx="1.3" fill="#3B6EF5"/>
7
+ <rect x="18" y="34.6" width="17.5" height="2.6" rx="1.3" fill="#3B6EF5"/>
8
+ <rect x="18" y="40" width="8.5" height="2.6" rx="1.3" fill="#3B6EF5"/>
9
+ </svg>
Binary file
@@ -0,0 +1,13 @@
1
+ <!-- revdeck logo. Wordmark outlines are from Inter, SIL Open Font License 1.1. -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 227.43 64" fill="none">
3
+ <rect width="64" height="64" rx="14" fill="#3B6EF5"/>
4
+ <rect x="22" y="12" width="26" height="33" rx="4.5" fill="#7C5CFF"/>
5
+ <rect x="17.5" y="16.5" width="26" height="33" rx="4.5" fill="#D7E3FF"/>
6
+ <rect x="13" y="21.5" width="28" height="32" rx="5" fill="#FFFFFF"/>
7
+ <rect x="18" y="29.2" width="12" height="2.6" rx="1.3" fill="#3B6EF5"/>
8
+ <rect x="18" y="34.6" width="17.5" height="2.6" rx="1.3" fill="#3B6EF5"/>
9
+ <rect x="18" y="40" width="8.5" height="2.6" rx="1.3" fill="#3B6EF5"/>
10
+ <g transform="translate(78.00 47.03) scale(1 -1)">
11
+ <path fill="#E6E9EE" d="M2.26 0.00L2.26 21.66L7.42 21.66L7.42 18.04L7.48 18.04Q8.08 19.93 9.35 20.89Q10.63 21.85 12.74 21.85Q13.26 21.85 13.69 21.83Q14.13 21.80 14.44 21.78L14.44 17.08Q14.15 17.11 13.44 17.17Q12.74 17.22 11.97 17.22Q10.75 17.22 9.76 16.66Q8.76 16.10 8.19 14.98Q7.61 13.85 7.61 12.16L7.61 0.00ZM25.94 -0.49Q22.69 -0.49 20.30 0.96Q17.91 2.41 16.61 4.97Q15.31 7.53 15.31 10.80Q15.31 14.11 16.64 16.67Q17.98 19.23 20.32 20.69Q22.67 22.15 25.72 22.15Q28.08 22.15 29.99 21.33Q31.91 20.52 33.29 19.01Q34.67 17.51 35.42 15.44Q36.16 13.38 36.16 10.89L36.16 9.44L17.38 9.44L17.38 13.07L33.51 13.07L31.11 12.12Q31.11 13.91 30.46 15.22Q29.81 16.52 28.63 17.23Q27.44 17.94 25.81 17.94Q24.20 17.94 23.02 17.23Q21.84 16.52 21.19 15.22Q20.54 13.91 20.54 12.12L20.54 9.79Q20.54 7.97 21.19 6.59Q21.84 5.21 23.08 4.44Q24.31 3.67 26.07 3.67Q27.35 3.67 28.33 4.05Q29.32 4.43 29.98 5.12Q30.64 5.81 30.92 6.72L35.90 6.72Q35.50 4.59 34.11 2.97Q32.71 1.34 30.60 0.43Q28.49 -0.49 25.94 -0.49ZM44.23 0.00L36.11 21.66L41.77 21.66L45.64 10.49Q46.25 8.67 46.80 6.85Q47.36 5.03 47.90 3.21L46.62 3.21Q47.16 5.03 47.70 6.85Q48.24 8.67 48.83 10.49L52.64 21.66L58.22 21.66L50.10 0.00ZM67.63 -0.44Q64.82 -0.44 62.70 0.97Q60.59 2.39 59.42 4.93Q58.26 7.47 58.26 10.84Q58.26 14.18 59.43 16.72Q60.61 19.25 62.72 20.68Q64.83 22.10 67.60 22.10Q69.02 22.10 70.23 21.72Q71.44 21.33 72.42 20.56Q73.40 19.79 74.08 18.60L74.12 18.60L74.12 30.56L79.47 30.56L79.47 0.00L74.20 0.00L74.20 3.31L74.17 3.31Q73.50 2.05 72.51 1.22Q71.52 0.38 70.29 -0.03Q69.06 -0.44 67.63 -0.44ZM68.92 4.00Q70.58 4.00 71.82 4.85Q73.05 5.70 73.73 7.24Q74.40 8.78 74.40 10.84Q74.40 12.92 73.73 14.46Q73.05 15.99 71.82 16.84Q70.58 17.68 68.92 17.68Q67.36 17.68 66.17 16.89Q64.98 16.09 64.33 14.57Q63.67 13.05 63.67 10.84Q63.67 8.65 64.33 7.13Q64.98 5.60 66.17 4.80Q67.36 4.00 68.92 4.00ZM92.82 -0.49Q89.57 -0.49 87.18 0.96Q84.79 2.41 83.49 4.97Q82.20 7.53 82.20 10.80Q82.20 14.11 83.53 16.67Q84.86 19.23 87.21 20.69Q89.56 22.15 92.61 22.15Q94.96 22.15 96.88 21.33Q98.79 20.52 100.17 19.01Q101.56 17.51 102.30 15.44Q103.04 13.38 103.04 10.89L103.04 9.44L84.27 9.44L84.27 13.07L100.39 13.07L97.99 12.12Q97.99 13.91 97.34 15.22Q96.70 16.52 95.51 17.23Q94.33 17.94 92.70 17.94Q91.09 17.94 89.90 17.23Q88.72 16.52 88.07 15.22Q87.43 13.91 87.43 12.12L87.43 9.79Q87.43 7.97 88.07 6.59Q88.72 5.21 89.96 4.44Q91.20 3.67 92.95 3.67Q94.23 3.67 95.22 4.05Q96.20 4.43 96.86 5.12Q97.52 5.81 97.81 6.72L102.79 6.72Q102.39 4.59 100.99 2.97Q99.59 1.34 97.48 0.43Q95.37 -0.49 92.82 -0.49ZM115.34 -0.49Q112.16 -0.49 109.76 0.94Q107.36 2.38 106.03 4.92Q104.69 7.47 104.69 10.80Q104.69 14.15 106.03 16.71Q107.36 19.27 109.76 20.71Q112.16 22.15 115.34 22.15Q117.40 22.15 119.14 21.54Q120.88 20.92 122.18 19.81Q123.49 18.70 124.28 17.18Q125.07 15.67 125.24 13.84L120.01 13.84Q119.87 14.70 119.51 15.42Q119.14 16.13 118.55 16.64Q117.97 17.16 117.18 17.44Q116.40 17.72 115.41 17.72Q113.75 17.72 112.56 16.87Q111.37 16.03 110.74 14.47Q110.10 12.92 110.10 10.80Q110.10 8.71 110.74 7.16Q111.37 5.62 112.56 4.78Q113.75 3.93 115.41 3.93Q116.40 3.93 117.17 4.21Q117.94 4.48 118.50 5.00Q119.07 5.51 119.43 6.24Q119.80 6.96 119.97 7.85L125.24 7.85Q125.10 6.05 124.32 4.53Q123.55 3.01 122.23 1.88Q120.91 0.75 119.16 0.13Q117.41 -0.49 115.34 -0.49ZM132.73 6.66L132.73 12.98L133.26 12.98L141.52 21.66L147.91 21.66L137.91 10.93L136.80 10.93ZM127.85 0.00L127.85 30.56L133.20 30.56L133.20 0.00ZM142.07 0.00L134.70 9.75L138.28 13.48L148.43 0.00Z"/>
12
+ </g>
13
+ </svg>
Binary file
@@ -0,0 +1,13 @@
1
+ <!-- revdeck logo. Wordmark outlines are from Inter, SIL Open Font License 1.1. -->
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 227.43 64" fill="none">
3
+ <rect width="64" height="64" rx="14" fill="#3B6EF5"/>
4
+ <rect x="22" y="12" width="26" height="33" rx="4.5" fill="#7C5CFF"/>
5
+ <rect x="17.5" y="16.5" width="26" height="33" rx="4.5" fill="#D7E3FF"/>
6
+ <rect x="13" y="21.5" width="28" height="32" rx="5" fill="#FFFFFF"/>
7
+ <rect x="18" y="29.2" width="12" height="2.6" rx="1.3" fill="#3B6EF5"/>
8
+ <rect x="18" y="34.6" width="17.5" height="2.6" rx="1.3" fill="#3B6EF5"/>
9
+ <rect x="18" y="40" width="8.5" height="2.6" rx="1.3" fill="#3B6EF5"/>
10
+ <g transform="translate(78.00 47.03) scale(1 -1)">
11
+ <path fill="#16191D" d="M2.26 0.00L2.26 21.66L7.42 21.66L7.42 18.04L7.48 18.04Q8.08 19.93 9.35 20.89Q10.63 21.85 12.74 21.85Q13.26 21.85 13.69 21.83Q14.13 21.80 14.44 21.78L14.44 17.08Q14.15 17.11 13.44 17.17Q12.74 17.22 11.97 17.22Q10.75 17.22 9.76 16.66Q8.76 16.10 8.19 14.98Q7.61 13.85 7.61 12.16L7.61 0.00ZM25.94 -0.49Q22.69 -0.49 20.30 0.96Q17.91 2.41 16.61 4.97Q15.31 7.53 15.31 10.80Q15.31 14.11 16.64 16.67Q17.98 19.23 20.32 20.69Q22.67 22.15 25.72 22.15Q28.08 22.15 29.99 21.33Q31.91 20.52 33.29 19.01Q34.67 17.51 35.42 15.44Q36.16 13.38 36.16 10.89L36.16 9.44L17.38 9.44L17.38 13.07L33.51 13.07L31.11 12.12Q31.11 13.91 30.46 15.22Q29.81 16.52 28.63 17.23Q27.44 17.94 25.81 17.94Q24.20 17.94 23.02 17.23Q21.84 16.52 21.19 15.22Q20.54 13.91 20.54 12.12L20.54 9.79Q20.54 7.97 21.19 6.59Q21.84 5.21 23.08 4.44Q24.31 3.67 26.07 3.67Q27.35 3.67 28.33 4.05Q29.32 4.43 29.98 5.12Q30.64 5.81 30.92 6.72L35.90 6.72Q35.50 4.59 34.11 2.97Q32.71 1.34 30.60 0.43Q28.49 -0.49 25.94 -0.49ZM44.23 0.00L36.11 21.66L41.77 21.66L45.64 10.49Q46.25 8.67 46.80 6.85Q47.36 5.03 47.90 3.21L46.62 3.21Q47.16 5.03 47.70 6.85Q48.24 8.67 48.83 10.49L52.64 21.66L58.22 21.66L50.10 0.00ZM67.63 -0.44Q64.82 -0.44 62.70 0.97Q60.59 2.39 59.42 4.93Q58.26 7.47 58.26 10.84Q58.26 14.18 59.43 16.72Q60.61 19.25 62.72 20.68Q64.83 22.10 67.60 22.10Q69.02 22.10 70.23 21.72Q71.44 21.33 72.42 20.56Q73.40 19.79 74.08 18.60L74.12 18.60L74.12 30.56L79.47 30.56L79.47 0.00L74.20 0.00L74.20 3.31L74.17 3.31Q73.50 2.05 72.51 1.22Q71.52 0.38 70.29 -0.03Q69.06 -0.44 67.63 -0.44ZM68.92 4.00Q70.58 4.00 71.82 4.85Q73.05 5.70 73.73 7.24Q74.40 8.78 74.40 10.84Q74.40 12.92 73.73 14.46Q73.05 15.99 71.82 16.84Q70.58 17.68 68.92 17.68Q67.36 17.68 66.17 16.89Q64.98 16.09 64.33 14.57Q63.67 13.05 63.67 10.84Q63.67 8.65 64.33 7.13Q64.98 5.60 66.17 4.80Q67.36 4.00 68.92 4.00ZM92.82 -0.49Q89.57 -0.49 87.18 0.96Q84.79 2.41 83.49 4.97Q82.20 7.53 82.20 10.80Q82.20 14.11 83.53 16.67Q84.86 19.23 87.21 20.69Q89.56 22.15 92.61 22.15Q94.96 22.15 96.88 21.33Q98.79 20.52 100.17 19.01Q101.56 17.51 102.30 15.44Q103.04 13.38 103.04 10.89L103.04 9.44L84.27 9.44L84.27 13.07L100.39 13.07L97.99 12.12Q97.99 13.91 97.34 15.22Q96.70 16.52 95.51 17.23Q94.33 17.94 92.70 17.94Q91.09 17.94 89.90 17.23Q88.72 16.52 88.07 15.22Q87.43 13.91 87.43 12.12L87.43 9.79Q87.43 7.97 88.07 6.59Q88.72 5.21 89.96 4.44Q91.20 3.67 92.95 3.67Q94.23 3.67 95.22 4.05Q96.20 4.43 96.86 5.12Q97.52 5.81 97.81 6.72L102.79 6.72Q102.39 4.59 100.99 2.97Q99.59 1.34 97.48 0.43Q95.37 -0.49 92.82 -0.49ZM115.34 -0.49Q112.16 -0.49 109.76 0.94Q107.36 2.38 106.03 4.92Q104.69 7.47 104.69 10.80Q104.69 14.15 106.03 16.71Q107.36 19.27 109.76 20.71Q112.16 22.15 115.34 22.15Q117.40 22.15 119.14 21.54Q120.88 20.92 122.18 19.81Q123.49 18.70 124.28 17.18Q125.07 15.67 125.24 13.84L120.01 13.84Q119.87 14.70 119.51 15.42Q119.14 16.13 118.55 16.64Q117.97 17.16 117.18 17.44Q116.40 17.72 115.41 17.72Q113.75 17.72 112.56 16.87Q111.37 16.03 110.74 14.47Q110.10 12.92 110.10 10.80Q110.10 8.71 110.74 7.16Q111.37 5.62 112.56 4.78Q113.75 3.93 115.41 3.93Q116.40 3.93 117.17 4.21Q117.94 4.48 118.50 5.00Q119.07 5.51 119.43 6.24Q119.80 6.96 119.97 7.85L125.24 7.85Q125.10 6.05 124.32 4.53Q123.55 3.01 122.23 1.88Q120.91 0.75 119.16 0.13Q117.41 -0.49 115.34 -0.49ZM132.73 6.66L132.73 12.98L133.26 12.98L141.52 21.66L147.91 21.66L137.91 10.93L136.80 10.93ZM127.85 0.00L127.85 30.56L133.20 30.56L133.20 0.00ZM142.07 0.00L134.70 9.75L138.28 13.48L148.43 0.00Z"/>
12
+ </g>
13
+ </svg>
@@ -0,0 +1,238 @@
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 on the host; the daemon then posts it. The devcontainer
24
+ bridge has no `publish.approve`/`publish.commit` (`CAPABILITY`), so an agent cannot create an 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 by a human in the UI or the
32
+ host CLI; the bridge denies `checks.run`. 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, path scoping; the agent only plans, a human runs them in the UI or host CLI with the full command shown.
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. The projects home can add a project, edit its
86
+ display title and working-copy roots, and delete the project with its cached reviews. Deletion never
87
+ touches MRs/PRs or comments on the platform.
88
+ - An MCP server is scoped to the repository it runs in: status/list/open only see that project, and a
89
+ review id or URL from another project is rejected. `REVDECK_ROOT` supports multi-root workspaces.
90
+ - Devcontainers mount a stable bridge to the host daemon; the container never starts its own daemon.
91
+ - Cross-project work is possible only through an explicit feature.
92
+
93
+ ## Features
94
+
95
+ A feature is a human-created bundle of reviews from one or more projects. It is not a project and not
96
+ a permanent project link; a project appears in a feature while at least one of its reviews is a member.
97
+
98
+ - Title, Markdown brief (goal, non-goals, rollout order, acceptance criteria), separate Markdown or
99
+ OpenAPI contract, status (`open`/`archived`).
100
+ - Ordered reviews with free-form roles (`api`, `ui`, `worker`, `mobile`); several reviews from one
101
+ project are allowed.
102
+ - **OpenAPI contract:** parsed into operations, parameters, request bodies, responses and schemas. The
103
+ feature context marks which changed reviews mention each operation path.
104
+ - **Application profiles:** `context.sources` / `context.maxBytes` in each repository; included once
105
+ per project as background, never as review criteria.
106
+ - **Feature notes/findings:** cross-project notes stored on the feature, visible in the UI and context.
107
+ They are never published. Humans write them in the UI/CLI; an agent may write them only in a feature
108
+ session through `revdeck_feature_note`, and may change/delete only notes authored by an agent.
109
+ Note and profile text is treated as data, not instructions.
110
+ - **Project session:** sees its project and features that include it; may read the combined feature
111
+ context, but writes drafts only in its own project.
112
+ - **Feature session:** started explicitly with `REVDECK_FEATURE=<id>`. The current repository must be a
113
+ member; the scope covers only members. Drafts may be written to any member. Publishing remains per
114
+ review and requires human approval. Feature notes may be written.
115
+ - Feature membership is revalidated on tool calls: removing the current project/review revokes access.
116
+ - Combined context contains the brief, parsed contract or raw Markdown, application profiles, feature
117
+ notes, an overview matrix and one section per review with its own project rules. Rules are never
118
+ merged; the budget is split across reviews.
119
+ - UI: feature list, feature page with project groups, roles, contract, notes, context preview, agent
120
+ command, archive, delete, reorder and add-review flows.
121
+ - CLI: `revdeck feature list|create|get|add|remove|reorder|notes|note|note-delete|context|update|archive|delete`.
122
+ - MCP: `revdeck_feature` (read-only list/get/context/notes) and `revdeck_feature_note` (feature session
123
+ only, never published).
124
+ - Removing a tracked review that belongs to a feature is blocked until it is removed from the feature.
125
+ - There is no feature-level publish; findings and summaries belong to their reviews.
126
+
127
+ ## User interface
128
+
129
+ - Local Svelte 5 SPA served by the daemon with a launch token (rotated with the daemon) and cookie session.
130
+ - Project switcher, projects home (add/edit/delete project), feature list and feature page.
131
+ - Review tabs: Overview, Threads, Findings, Diff, Rules, Analytics.
132
+ - Keyboard shortcuts (`1`–`5`, `o`, `r`, `s`, `p`, `?`, `h`), command palette, deep links to threads,
133
+ findings and diff lines with browser Back/Forward.
134
+ - Command reference page (`#/help`): searchable CLI usage, common flags and UI shortcuts, with
135
+ click-to-copy commands. Reachable from the sidebar and by `h`.
136
+ - Markdown preview, attachment button, reactions, line comments, publish dialog with exact plan.
137
+ - Russian and English interface; language is independent from the language of review output.
138
+ - Responsive sidebar and mobile backdrop; dark/light theme via CSS variables.
139
+
140
+ ## Security and trust
141
+
142
+ - Unix socket with `0700` directory and `0600` socket; loopback UI only; `Host`/`Origin` checks,
143
+ `HttpOnly` `SameSite=Strict` cookie, CSP.
144
+ - The devcontainer bridge is agent-scoped (`read`/`draft`): `publish.*`, `checks.run`, decisions,
145
+ platform writes and feature/project administration return `CAPABILITY`. The UI token is not mounted
146
+ into the container.
147
+ - Rule and profile documents must be git-tracked, have a safe extension and are denied for local
148
+ secrets (`.env*`, `.git/config`, `.npmrc`, `.revdeck.local.*`, keys); reads verify the opened fd's
149
+ realpath to close symlink TOCTOU.
150
+ - Platform CLI calls without a shell, outside the working copy, with a scrubbed environment; secrets
151
+ redacted in logs and errors.
152
+ - MR text, comments and diff are untrusted data; the skill and context say so.
153
+ - Comment sanitizer blocks HTML, control/bidi characters, GitLab quick actions and mass mentions;
154
+ external images are links, not loads.
155
+ - Approvals are random, single-use, TTL-bound and tied to the review and plan hash.
156
+ - Project and feature scopes are **context isolation**, not a security boundary: one daemon and one
157
+ database remain. The bridge limits writes, but read methods still see the local database; a process
158
+ with access to the user's home can read it.
159
+ - Hard isolation would require a separate daemon/state directory under another user/container; that is
160
+ outside the current model and breaks cross-project review.
161
+
162
+ ## Configuration
163
+
164
+ `.revdeck.yml` (or `.revdeck.yaml`) at the repository root, with personal `.revdeck.local.yml`
165
+ overrides:
166
+
167
+ - `version`, `provider` (`type`, `host`, `project`, `base`), `output.language`.
168
+ - `review`: agents, roles, custom roles, groups, secrets, history, readOnly.
169
+ - `context`: application-profile sources and `maxBytes`.
170
+ - `rules`: sources, path map, ignore, document/total limits.
171
+ - `checks`: id, name, argv, path conditions, consent, timeout.
172
+ - `publish`: approval requirement, max comments.
173
+
174
+ Explicit CLI arguments override config, config overrides the git remote; this prevents redirecting a
175
+ review by tampering with `.git/config`. The schema is validated by zod and unknown fields fail with a
176
+ path.
177
+
178
+ ## Operations
179
+
180
+ - `revdeck init`: config, skill, harness adapters and MCP config; idempotent, never overwrites foreign
181
+ keys.
182
+ - `revdeck eject`: inverse operation; plan by default, `--yes` to apply, `--keep-config` to keep the
183
+ config.
184
+ - `revdeck doctor`: Node, git, `glab`/`gh` auth, daemon, adapters; knows about devcontainers.
185
+ - Daemon lifecycle: start/stop/restart/status/logs/install/uninstall; systemd user unit on Linux,
186
+ launchd on macOS.
187
+ - Devcontainer bridge: stable socket/state mounts; host-side `glab`/`gh`; no daemon in the container.
188
+ - HTTP transport for containers where the socket is not forwarded (`REVDECK_URL`, `REVDECK_TOKEN`).
189
+ - Export/import for sandboxes without a socket.
190
+ - Linux and macOS autostart; Windows runs manually.
191
+
192
+ ## Architecture decisions
193
+
194
+ ### Daemon-first
195
+
196
+ A long-lived user-owned daemon holds credentials, SQLite, providers, RPC, HTTP/SSE and the UI. CLI and
197
+ MCP are thin clients. The alternative — an MCP process per session without a daemon — was rejected
198
+ because the UI would not survive the session, agents would compete for state, tokens would end up in
199
+ the agent process and containers would still need a host process. File exchange remains only as
200
+ `export`/`import`.
201
+
202
+ Consequences: daemon lifecycle, socket permissions, a bridge for containers, version-matched clients,
203
+ background sync and SSE. One daemon serves several repositories; `root` is passed on open and config is
204
+ read from that root.
205
+
206
+ ### Project scopes
207
+
208
+ A project is a repository. The key is `platform:host/project`; reviews carry it and the daemon keeps a
209
+ registry with working-copy roots. The UI and CLI are project-scoped; the MCP server is scoped to the
210
+ repository it runs in. A per-project daemon/database was rejected: it breaks cross-project review,
211
+ adds ports/services/backups and is still not a security boundary against the same user.
212
+
213
+ Consequences: migration/backfill, project-scoped MCP errors, multi-root workspace configuration, and
214
+ explicit context-only isolation.
215
+
216
+ ### Explicit features
217
+
218
+ Because projects are isolated, cross-project work needs an explicit human-created feature. The feature
219
+ is the only door: membership is chosen per task; project sessions read the combined context but write
220
+ only in their project; a feature session may write across members, with per-review publishing. A
221
+ permanent project link or automatic cross-project discovery was rejected because it leaks contexts into
222
+ unrelated tasks.
223
+
224
+ Consequences: feature notes are non-published, contracts and profiles are human-provided, feature
225
+ sessions are explicit, and removing membership revokes access on the next tool call.
226
+
227
+ ## Non-goals and limitations
228
+
229
+ - Replacing the native GitLab/GitHub diff viewer; the UI is for triage and approval.
230
+ - Built-in static analysis; checks are delegated to the project's tools.
231
+ - A multi-user server or role-based authorization.
232
+ - Hard security isolation between projects; see the caveat above.
233
+ - Native draft notes/pending reviews (providers are ready, publishing uses regular comments).
234
+ - GitHub attachment upload via public API.
235
+ - Automatic OpenAPI-based static validation of client code: the contract is parsed and given to the
236
+ agent; the agent validates the implementation.
237
+ - Feature-level publishing or automatically publishing a whole feature.
238
+ - Source checkout of other repositories in a feature context: only review data, profiles and contracts.