revdeck 0.16.0 → 0.17.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.
@@ -9,8 +9,8 @@
9
9
  <link rel="icon" href="/icon-32.png" type="image/png" sizes="32x32" />
10
10
  <link rel="apple-touch-icon" href="/icon-128.png" />
11
11
  <title>revdeck</title>
12
- <script type="module" crossorigin src="/assets/index-CEUJuQzA.js"></script>
13
- <link rel="stylesheet" crossorigin href="/assets/index-pbZQ6bv_.css">
12
+ <script type="module" crossorigin src="/assets/index-DNyhbjYn.js"></script>
13
+ <link rel="stylesheet" crossorigin href="/assets/index-Bd7WadZ2.css">
14
14
  </head>
15
15
  <body>
16
16
  <div id="app"></div>
@@ -30,7 +30,8 @@ agent (MCP/CLI) ──▶ revdeck daemon ──glab/gh──▶ GitLab/GitHub
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
  full file content at a commit, threads, replies, resolution, comment creation, review verdicts and
33
- platform checks/approvals.
33
+ platform checks/approvals. `auth.ts` serves platform access for the UI: status via `GET /user`, and a
34
+ token hand-off to `glab`/`gh` on stdin without keeping a copy.
34
35
  - `src/daemon/service.ts` — orchestrator: review refresh, drafts, decisions, publication plan,
35
36
  approval, idempotent writes, background sync, merge readiness and CODEOWNERS.
36
37
  - `src/daemon/update.ts` — optional npm update check: daily cache, short error backoff, no telemetry.
@@ -23,11 +23,15 @@ The core guarantees:
23
23
  approves the exact plan in the UI or CLI on the host; the daemon then posts it. The devcontainer
24
24
  bridge has no `publish.approve`/`publish.commit` (`CAPABILITY`), so an agent cannot create an approval.
25
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.
26
+ and are scrubbed from child environments. A token pasted in Settings is verified with `GET /user` and
27
+ forwarded to `glab`/`gh` on stdin; the CLI stores it, revdeck keeps no copy, and `auth.status` returns
28
+ only the host, the account and a hint.
27
29
  - **Project rules are explicit.** For changed paths revdeck selects repository documents and exact
28
30
  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
+ - **One local database.** Reviews, projects, features, drafts, approvals, audit and UI preferences
32
+ (theme, language, hidden sections, auto-refresh, notifications) live in SQLite in the user's state
33
+ directory. The daemon picks a new port on every start, so browser `localStorage` cannot be the
34
+ source of truth for settings — the UI reads them from the daemon before the first paint.
31
35
  - **Agent work is review-only.** Checks are planned by the agent and run by a human in the UI or the
32
36
  host CLI; the bridge denies `checks.run`. Publishing, resolving and approvals remain human actions.
33
37
 
@@ -43,7 +47,8 @@ The core guarantees:
43
47
  such as Rules, Analytics and Diff are not restarted on every SSE/poll tick. SSE heartbeats gate the
44
48
  polling fallback, and review, feature and project events reload only their own scope.
45
49
  - The review header can also be collapsed manually with a header button. While hidden, a restore
46
- button in the tabs row brings it back; manual collapse is not reopened by the scroll timer.
50
+ button in the tabs row brings it back; manual collapse stays pinned across scrolling, wheel/touch
51
+ input and tab switches until that button is pressed.
47
52
  - The review header collapses on downward scroll and smoothly returns on upward scroll; section tabs
48
53
  remain visible. The same content-scroll pattern is used where a large page header is present, and
49
54
  the Diff tab wires its nested scroller (wheel, scrollbar and keyboard) into the same handler.
@@ -255,6 +260,8 @@ path.
255
260
  - `revdeck eject`: inverse operation; plan by default, `--yes` to apply, `--keep-config` to keep the
256
261
  config.
257
262
  - `revdeck doctor`: Node, git, `glab`/`gh` auth, daemon, adapters; knows about devcontainers.
263
+ - Platform access in the UI: Settings lists the GitLab/GitHub hosts from the project registry with their
264
+ `glab`/`gh` state and lets a human paste a token; the daemon verifies it and stores it in the CLI.
258
265
  - Daemon lifecycle: start/stop/restart/status/logs/install/uninstall; systemd user unit on Linux,
259
266
  launchd on macOS.
260
267
  - Devcontainer bridge: stable socket/state mounts; host-side `glab`/`gh`; no daemon in the container.
@@ -366,6 +366,11 @@ reviews disable the runner. The agent can only show the plan; the bridge returns
366
366
  | `REVDECK_GLAB` | absolute path to `glab` when the daemon PATH does not contain it |
367
367
  | `REVDECK_GH` | absolute path to `gh` when the daemon PATH does not contain it |
368
368
 
369
+ Platform credentials are not part of `.revdeck.yml`. `glab`/`gh` read them from their own
370
+ configuration (`~/.config/glab-cli`, `~/.config/gh`, or the OS keyring). Sign in with the CLI, or paste a
371
+ token in the UI **Settings → GitLab and GitHub access**: the daemon verifies it with `GET /user`, passes
372
+ it to the CLI on stdin, and keeps no copy.
373
+
369
374
  ## Validation
370
375
 
371
376
  `revdeck config --json` shows the effective config, the path where it was found, and warnings.
package/docs/protocol.md CHANGED
@@ -45,6 +45,10 @@ bridge is authorized by transport capability: `agent` may read and draft, but hu
45
45
  | Method | Parameters | Result |
46
46
  |---|---|---|
47
47
  | `ping` | — | version, protocol, pid |
48
+ | `auth.status` | — / `platform`, `host` | `glab`/`gh` state per host from the project registry (or one explicit host): binary, authenticated, account, hint. Never returns a token |
49
+ | `auth.login` | `platform`, `host`, `token` | checks the token with `GET /user`, stores it via `glab`/`gh` stdin, returns the new state; the token is not kept or echoed (human-only) |
50
+ | `settings.get` | — | UI preferences stored on the daemon: theme, locale, hidden sections, auto-refresh, notifications |
51
+ | `settings.put` | `patch` | merges one or more preference keys and returns the full set (human-only) |
48
52
  | `projects.list` | — | registered projects with review counts and roots |
49
53
  | `projects.register` | `root` | project resolved from that working copy |
50
54
  | `projects.update` | `project`, `title?`, `roots?` | rename a project or replace its working-copy roots |
@@ -103,7 +107,8 @@ bridge is authorized by transport capability: `agent` may read and draft, but hu
103
107
 
104
108
  Human-only methods return `CAPABILITY` on the bridge: `publish.approve`, `publish.commit`,
105
109
  `checks.run`, `decisions.put`, `comments.update/delete`, `reactions.*`, `attachments.upload`,
106
- `reviews.remove`, `projects.register/update/remove`, and feature administration
110
+ `reviews.remove`, `projects.register/update/remove`, `auth.status`/`auth.login`,
111
+ `settings.get`/`settings.put`, and feature administration
107
112
  (`features.create/update/delete/addReviews/removeReview/reorder`).
108
113
 
109
114
  ## Project scope
@@ -29,7 +29,8 @@ agent (MCP/CLI) ──▶ revdeck daemon ──glab/gh──▶ GitLab/GitHub
29
29
  санитайзер публикации, редакция секретов, безопасный запуск процессов.
30
30
  - `src/providers` — единственное место, знающее о платформах. `Provider` нормализует MR/PR, diff,
31
31
  полное содержимое файла на коммите, треды, ответы, резолв, создание комментариев, вердикт ревью и
32
- платформенные checks/approvals.
32
+ платформенные checks/approvals. `auth.ts` обслуживает доступ к платформам для UI: статус через
33
+ `GET /user` и передачу токена в `glab`/`gh` через stdin без хранения копии.
33
34
  - `src/daemon/service.ts` — оркестратор: обновление ревью, черновики, решения, план публикации,
34
35
  approval, идемпотентная запись, фоновый sync, готовность к мержу и CODEOWNERS.
35
36
  - `src/daemon/update.ts` — необязательная проверка обновлений в npm: суточный кеш, короткий backoff
@@ -24,11 +24,15 @@ agent (MCP/CLI) ──unix socket──▶ revdeck daemon ──glab/gh──▶
24
24
  devcontainer нет `publish.approve`/`publish.commit` (`CAPABILITY`), поэтому агент не может создать
25
25
  approval.
26
26
  - **Токены остаются на хосте.** Демон вызывает `glab`/`gh`; токены платформ не передаются по RPC и
27
- вычищаются из окружения дочерних процессов.
27
+ вычищаются из окружения дочерних процессов. Токен, вставленный в «Настройках», проверяется запросом
28
+ `GET /user` и уходит в `glab`/`gh` через stdin; сохраняет его CLI, revdeck копию не держит, а
29
+ `auth.status` возвращает только хост, аккаунт и подсказку.
28
30
  - **Правила проекта явные.** Для изменённых путей revdeck выбирает документы репозитория и конкретные
29
31
  секции (`AGENTS.md`, архитектура, гайды, ADR).
30
- - **Одна локальная база.** Ревью, проекты, фичи, черновики, approvals и аудит лежат в SQLite в
31
- state-каталоге пользователя.
32
+ - **Одна локальная база.** Ревью, проекты, фичи, черновики, approvals, аудит и настройки интерфейса
33
+ (тема, язык, скрытые разделы, автообновление, уведомления) лежат в SQLite в state-каталоге
34
+ пользователя. Порт демона выбирается заново при каждом запуске, поэтому `localStorage` в браузере
35
+ не может быть источником правды: UI читает настройки у демона до первого кадра.
32
36
  - **Работа агента — только ревью.** Проверки агент только планирует; запускает человек в UI или CLI
33
37
  на хосте, мост запрещает `checks.run`. Публикация, резолв и approve остаются за человеком.
34
38
 
@@ -43,7 +47,8 @@ agent (MCP/CLI) ──unix socket──▶ revdeck daemon ──glab/gh──▶
43
47
  каждый SSE/поллинг. Heartbeat'ы SSE отключают поллинг-страховку, а события review/feature/project
44
48
  обновляют только свою часть.
45
49
  - Шапку можно свернуть вручную кнопкой в шапке. Пока она скрыта, кнопка возврата в строке вкладок
46
- показывает её обратно; таймер авто-скрытия не раскрывает ручное сворачивание.
50
+ показывает её обратно; ручное сворачивание остаётся закреплённым при скролле, wheel/touch и смене
51
+ вкладки, пока не нажать эту кнопку.
47
52
  - Шапка ревью сворачивается при прокрутке вниз и плавно возвращается вверх; вкладки разделов
48
53
  остаются видимыми. Тот же паттерн используется там, где есть большой хедер страницы; вкладка Diff
49
54
  подключает свой вложенный скроллер (колесо, скроллбар и клавиатура) к тому же обработчику.
@@ -256,6 +261,8 @@ agent (MCP/CLI) ──unix socket──▶ revdeck daemon ──glab/gh──▶
256
261
  - `revdeck eject`: обратная операция; по умолчанию план, `--yes` для применения, `--keep-config`
257
262
  оставляет конфиг.
258
263
  - `revdeck doctor`: Node, git, авторизация `glab`/`gh`, демон, адаптеры; знает про devcontainer.
264
+ - Доступ к платформам в UI: «Настройки» показывает хосты GitLab/GitHub из реестра проектов с их
265
+ состоянием в `glab`/`gh` и позволяет вставить токен; демон проверяет его и сохраняет в CLI.
259
266
  - Жизненный цикл демона: start/stop/restart/status/logs/install/uninstall; systemd user unit на Linux,
260
267
  launchd на macOS.
261
268
  - Мост devcontainer: стабильные mounts сокета/state; `glab`/`gh` на хосте; демон в контейнере не
@@ -361,6 +361,11 @@ argv) или выполняет `revdeck checks <N> --run --yes` на хосте
361
361
  | `REVDECK_GLAB` | абсолютный путь к `glab`, если его нет в PATH демона |
362
362
  | `REVDECK_GH` | абсолютный путь к `gh`, если его нет в PATH демона |
363
363
 
364
+ Учётные данные платформ не входят в `.revdeck.yml`. `glab`/`gh` читают их из своей конфигурации
365
+ (`~/.config/glab-cli`, `~/.config/gh` или keyring ОС). Войдите через CLI или вставьте токен в UI
366
+ **Настройки → Доступ к GitLab и GitHub**: демон проверит его запросом `GET /user`, передаст CLI через
367
+ stdin и копию не сохранит.
368
+
364
369
  ## Валидация
365
370
 
366
371
  `revdeck config --json` показывает эффективный конфиг, найденный путь и предупреждения.
@@ -45,6 +45,10 @@
45
45
  | Метод | Параметры | Результат |
46
46
  |---|---|---|
47
47
  | `ping` | — | версия, протокол, pid |
48
+ | `auth.status` | — / `platform`, `host` | состояние `glab`/`gh` по хостам из реестра проектов (или по одному явному хосту): бинарник, авторизация, аккаунт, подсказка. Токен не возвращается |
49
+ | `auth.login` | `platform`, `host`, `token` | проверяет токен запросом `GET /user`, сохраняет его через stdin `glab`/`gh`, возвращает новое состояние; токен не сохраняется и не возвращается (human-only) |
50
+ | `settings.get` | — | настройки UI, сохранённые демоном: тема, язык, скрытые разделы, автообновление, уведомления |
51
+ | `settings.put` | `patch` | сливает один или несколько ключей настроек и возвращает полный набор (human-only) |
48
52
  | `projects.list` | — | зарегистрированные проекты с числом ревью и root'ами |
49
53
  | `projects.register` | `root` | проект, определённый по рабочей копии |
50
54
  | `projects.update` | `project`, `title?`, `roots?` | переименовать проект или заменить root'ы |
@@ -103,7 +107,8 @@
103
107
 
104
108
  Human-only методы возвращают `CAPABILITY` на мосту: `publish.approve`, `publish.commit`,
105
109
  `checks.run`, `decisions.put`, `comments.update/delete`, `reactions.*`, `attachments.upload`,
106
- `reviews.remove`, `projects.register/update/remove` и администрирование фич
110
+ `reviews.remove`, `projects.register/update/remove`, `auth.status`/`auth.login`,
111
+ `settings.get`/`settings.put` и администрирование фич
107
112
  (`features.create/update/delete/addReviews/removeReview/reorder`).
108
113
 
109
114
  ## Скоуп проекта
@@ -4,7 +4,8 @@
4
4
 
5
5
  ## Активы
6
6
 
7
- 1. Токены GitLab/GitHub (в конфигурации `glab`/`gh` на хосте).
7
+ 1. Токены GitLab/GitHub (в конфигурации `glab`/`gh` на хосте; токен из UI передаётся CLI и в revdeck
8
+ не остаётся).
8
9
  2. Код и diff ревьюируемого репозитория, включая приватный.
9
10
  3. Треды и комментарии, включая персональные данные.
10
11
  4. Право публикации от имени пользователя.
@@ -29,6 +30,9 @@
29
30
  | Prompt injection из комментариев/diff | Инструкции в тексте помечены как данные; агент не публикует сам; публикация требует approval человека; санитайзер блокирует скрытые символы и быстрые команды | Модель всё равно может предложить вредный текст — его увидит человек в плане |
30
31
  | Случайная публикация не того текста | План с точными телами и хешем; `approve` сверяет хеш; `commit` выполняет только пункты плана; повторная отправка пропускается | Человек может подтвердить не глядя — UI показывает полный текст |
31
32
  | Межсайтовые запросы к loopback (DNS rebinding, CSRF) | Только `127.0.0.1`/`localhost` в `Host`; проверка `Origin` для POST; cookie `HttpOnly`, `SameSite=Strict`; launch-токен; CSP | Локальный процесс другого пользователя с доступом к сокету — вне модели (права 0600/0700) |
33
+ | Вредоносная страница отправляет токен через `auth.login` | Токен принимается только в авторизованной сессии UI (проверки `Host`/`Origin`, launch-cookie, CSP); `auth.login` human-only; UI отключает форму, если страница открыта не с `127.0.0.1` | Страница, умеющая действовать от имени сессии браузера, получает власть человека |
34
+ | Введённый токен утекает в логи, argv или RPC | Токен уходит в `glab`/`gh` через stdin, никогда не аргументом (нет видимости в `ps`); не пишется в SQLite, не возвращается `auth.status`, ошибки CLI редактируются до попадания в UI | Токен лежит в конфигурации CLI, которую может прочитать любой процесс пользователя |
35
+ | Агент переписывает учётные данные платформы | `auth.*` нет в наборе агентских методов: мост и агентский HTTP-токен получают `CAPABILITY` | Агент с shell-доступом к `$HOME` может сам выполнить `gh auth login` — тот же остаточный риск, что и раньше |
32
36
  | Символическая ссылка/TOCTOU в рабочем каталоге | Состояние хранится в приватном каталоге, запись атомарная; правила/профили читаются только из git-отслеживаемых безопасных документов; realpath уже открытого fd проверяется внутри корня на Linux (`/proc/self/fd`); macOS/Windows используют path + inode | На macOS/Windows остаётся узкая гонка path/inode; она не даёт прав публикации |
33
37
  | Локальные секреты через rules/профили | `rules.sources`/`context.sources` должны быть отслеживаемы git, иметь безопасное расширение и не быть `.env*`, `.git/**`, `.npmrc`, `.revdeck.local.*`, ключами; tracked `.revdeck.local.yml` игнорируется | В отслеживаемом документе могут быть секреты, закоммиченные в репозиторий — это содержимое MR, а не локальный файл ревьюера |
34
38
  | Вредоносный `.revdeck.yml` исполняет код | Мост запрещает `checks.run` (`CAPABILITY`); проверки запускает человек в UI или CLI на хосте, который показывает полный argv; CLI в devcontainer отказывает `--run` | Человек всё ещё может запустить вредоносную команду из чужого MR в UI/CLI — читайте argv; host-checks пока не в песочнице |
@@ -4,7 +4,8 @@
4
4
 
5
5
  ## Assets
6
6
 
7
- 1. GitLab/GitHub tokens (in the `glab`/`gh` configuration on the host).
7
+ 1. GitLab/GitHub tokens (in the `glab`/`gh` configuration on the host; a token pasted in the UI is
8
+ passed to the CLI and is not kept by revdeck).
8
9
  2. The code and diff of the repository under review, including private repositories.
9
10
  3. Threads and comments, including personal data.
10
11
  4. The right to publish on the user's behalf.
@@ -30,6 +31,9 @@
30
31
  | Prompt injection from comments/diff | Instructions in the text are marked as data; the agent does not publish on its own; publishing requires human approval; the sanitizer blocks hidden characters and quick actions | The model can still propose harmful text — a human sees it in the plan |
31
32
  | Accidental publication of the wrong text | A plan with the exact bodies and a hash; `approve` verifies the hash; `commit` executes only the plan items; a repeat send is skipped | A human may approve without looking — the UI shows the full text |
32
33
  | Cross-site requests to loopback (DNS rebinding, CSRF) | Only `127.0.0.1`/`localhost` in `Host`; an `Origin` check for POST; `HttpOnly`, `SameSite=Strict` cookies; a launch token; CSP | A local process of another user with access to the socket is out of scope (permissions 0600/0700) |
34
+ | A malicious page submits a credential through `auth.login` | The token is accepted only in the authenticated UI session (`Host`/`Origin` checks, launch cookie, CSP); `auth.login` is human-only; the UI disables the form when it is not served from `127.0.0.1` | A page that can act as the browser session has the same authority as the human |
35
+ | An entered token leaks into logs, argv or RPC | The token goes to `glab`/`gh` on stdin, never as an argument (no `ps` exposure); it is never written to SQLite, never returned by `auth.status`, and CLI errors are redacted before they reach the UI | The token lives in the CLI config, which any process of the user can read |
36
+ | The agent rewrites platform credentials | `auth.*` is not in the agent method set: the bridge and an agent-scoped HTTP token get `CAPABILITY` | An agent with shell access to `$HOME` can run `gh auth login` itself — the same residual risk as before |
33
37
  | Symlink/TOCTOU in the working directory | State is stored in a private directory, writes are atomic; rules/profiles are read only from git-tracked safe documents; the opened fd's realpath is checked inside the root on Linux (`/proc/self/fd`); macOS/Windows use a path + inode comparison | macOS/Windows keep a narrow path/inode race; it does not grant publish rights |
34
38
  | Local secrets via rules/profiles | `rules.sources`/`context.sources` must be git-tracked, have a safe extension and are denied for `.env*`, `.git/**`, `.npmrc`, `.revdeck.local.*` and key files; a tracked `.revdeck.local.yml` is ignored | A tracked document can still contain secrets committed to the repository — that is the MR content, not the reviewer's local file |
35
39
  | A malicious `.revdeck.yml` executes code | The bridge denies `checks.run` (`CAPABILITY`); checks are run by a human in the UI or the host CLI, which shows the full argv; the CLI refuses `--run` inside a devcontainer | A human may still run a malicious command from someone else's MR in the UI/host CLI — read the argv; host checks are not sandboxed yet |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdeck",
3
- "version": "0.16.0",
3
+ "version": "0.17.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",