dsh-desktop-kit 2.33.0 → 2.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.en.md +22 -6
- package/README.md +31 -10
- package/client.js +1 -1
- package/docs/MEASURED.md +7 -7
- package/docs/TEST-2.34.0.md +36 -0
- package/docs/TEST-2.34.1.md +27 -0
- package/docs/images/hero-2.34.1.png +0 -0
- package/docs/measured.json +9 -9
- package/docs/preview/hero-2.34.1.html +133 -0
- package/package.json +5 -4
- package/plugins/dsh-agent-extensions/index.js +1 -1
- package/plugins/dsh-agent-extensions/lib/agents.js +12 -0
- package/plugins/dsh-agent-extensions/lib/checkpoints.js +63 -17
- package/plugins/dsh-agent-extensions/lib/commands.js +1 -1
- package/plugins/dsh-agent-extensions/lib/instructions.js +17 -2
- package/plugins/dsh-agent-extensions/lib/locks.js +81 -21
- package/plugins/dsh-browser-qa/lib/ui-gate.js +36 -0
- package/plugins/dsh-guardrails/index.js +3 -1
- package/plugins/dsh-guardrails/lib/runtime.js +33 -2
- package/skills/manifest.json +6 -6
- package/skills-baseline.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## 2.34.1 (2026-12-02)
|
|
2
|
+
|
|
3
|
+
**Карточка плагина больше не показывает старую версию.**
|
|
4
|
+
|
|
5
|
+
- `package.json.description` очищен от semver: «DeepSeek Harness desktop kit» без «2.31.0». Версия берётся из `version`; описание в UI DSH и npm обновится после публикации 2.34.1.
|
|
6
|
+
- `check-release-consistency` теперь падает, если в `description` снова появится semver-строка — это ловит именно этот класс дрейфа.
|
|
7
|
+
- README hero пересобран как `docs/images/hero-2.34.1.png` (2400×1260, overflow 0, console 0), alt/H1/ссылки синхронизированы.
|
|
8
|
+
- Пакет: 545 файлов, tarball 2.34.1, `docs/analysis` исключён.
|
|
9
|
+
|
|
10
|
+
## 2.34.0 (2026-12-02)
|
|
11
|
+
|
|
12
|
+
**Надёжность: locks без гонки, test runner, release polling, atomic checkpoints, UI coverage.**
|
|
13
|
+
|
|
14
|
+
- **Locks:** атомарный захват `wx`, heartbeat 30 с, проверка PID, stale-lock takeover; release останавливает heartbeat. Тест: чужой owner, истёкший lock, повторный захват.
|
|
15
|
+
- **Test runner:** `npm test` → `node tools/run-tests.mjs`; шаги из `test:steps` запускаются напрямую через Node, без PowerShell-обёртки; точный failing step и exit code.
|
|
16
|
+
- **Release:** `tools/release.mjs --publish` ждёт появления версии в registry до 10 минут (`--wait-seconds`), различает published/still processing/staged; `verify-release` больше не запускается в окно асинхронной публикации.
|
|
17
|
+
- **Checkpoints:** snapshot в `<id>.tmp-*` → `rename`; скан файлов до 512 КБ через guardrails secret scanner, секретные файлы пропускаются; retention 20.
|
|
18
|
+
- **UI coverage:** `.dsh/quality/ui.json` со списком критических сценариев; strict-гейт требует отдельный passing `interact` на каждый сценарий, а не один любой.
|
|
19
|
+
- **Runtime:** снапшот ask/deny сохраняется в `~/.dsh/agent-extensions/runtime.json` (bounded, без текста команд); `loaded/persisted` в ответе.
|
|
20
|
+
- **Роли:** `max_turns`/`skills` уходят в prompt роли как advisory-бюджет; `isolation: worktree` автоматически создаёт worktree для одиночного запуска; контрактный тест парсинга/промпта.
|
|
21
|
+
- **Instruction validator:** сверка навыков с `skills/manifest.json` + пользовательские навыки из `DSH_HOME`; тест stale/valid.
|
|
22
|
+
- **Release consistency:** `skills/manifest.json` версия теперь проверяется вместе с package/README/CHANGELOG/measured.
|
|
23
|
+
- **Проверки:** полный набор 43 шага; guardrails 44 теста; UI gate, agent extensions, instructions, memory, quality, smoke.
|
|
24
|
+
|
|
1
25
|
## 2.33.0 (2026-12-02)
|
|
2
26
|
|
|
3
27
|
**Approval runtime, валидатор инструкций, health проекта и writer locks.**
|
package/README.en.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# DSH Desktop Kit 2.
|
|
1
|
+
# DSH Desktop Kit 2.34.1
|
|
2
2
|
|
|
3
3
|
[Русский](README.md) · **English**
|
|
4
4
|
|
|
@@ -6,13 +6,29 @@
|
|
|
6
6
|
|
|
7
7
|
21 plugins and 35 skills in one npm package: a quality mission with phases and G0..G13 gates, browser QA with interactions/accessibility/performance, 14 project roles (ui-critic, a11y, cms-ops, release-ops, builder in a worktree), phase-aware skill routing with a token budget, a read-only swarm with a shared board, a research ledger with source checks, MCP with OAuth 2.1 / sampling / elicitation, a local marketplace, an IDE bridge, guardrails, project memory, checkpoints, `/kit doctor|plan|tune`, and a Russian-first UI.
|
|
8
8
|
|
|
9
|
-

|
|
10
10
|
|
|
11
11
|
> The Russian [README.md](README.md) is the canonical document. This page is a compact English map for npm and GitHub readers.
|
|
12
12
|
|
|
13
|
+
## What's new in 2.34.1
|
|
14
|
+
|
|
15
|
+
- **Package description has no hardcoded version.** The DSH plugin card shows the real `version` (2.34.1) instead of a stale "2.31.0" in `description`; release consistency now rejects a semver string in the description.
|
|
16
|
+
- **New 2.34.1 hero** (`docs/images/hero-2.34.1.png`, 2400×1260, no overflow, no console errors) and synchronized H1/alt/docs.
|
|
17
|
+
|
|
18
|
+
## What's new in 2.34.0
|
|
19
|
+
|
|
20
|
+
- **Race-free writer locks:** O_EXCL acquire, 30s heartbeat, PID liveness and stale-lock takeover; two `project_agent` writers can no longer start in one root.
|
|
21
|
+
- **Reliable test runner:** `npm test` runs `node tools/run-tests.mjs`, so no PowerShell/`&&` wrapper hides the failing step.
|
|
22
|
+
- **Release waits for the registry:** `release.mjs --publish` polls the packument for up to 10 minutes and distinguishes visible / still-processing / staged instead of treating npm exit 0 as live.
|
|
23
|
+
- **Atomic checkpoints with secret scan:** snapshot goes to a temporary directory and is renamed; files with detected secrets are skipped; the last 20 snapshots are kept.
|
|
24
|
+
- **Critical-scenario coverage:** with `.dsh/quality/ui.json`, one passing `interact` is not enough; each listed scenario needs its own run.
|
|
25
|
+
- **Runtime survives restart:** `guardrails action=runtime` persists a bounded snapshot in `~/.dsh/agent-extensions/runtime.json`; command text is still not stored.
|
|
26
|
+
- **Role budget/isolation:** `max_turns` and `skills` are injected into the role prompt; `isolation: worktree` creates a worktree for a single run.
|
|
27
|
+
- **Manifest version gate:** release consistency now checks `skills/manifest.json` against `package.json`.
|
|
28
|
+
|
|
13
29
|
## What's new in 2.33.0
|
|
14
30
|
|
|
15
|
-
- **`guardrails action=runtime`** classifies a call (`read/write/external/destructive/credential`) and records
|
|
31
|
+
- **`guardrails action=runtime`** classifies a call (`read/write/external/destructive/credential`) and records ask/deny decisions (level, mode, rule, fingerprint); command text is never stored.
|
|
16
32
|
- **Instruction validator** checks `AGENTS.md`/`CLAUDE.md` for broken `@import`, stale skills, duplicate root files and size; warnings appear in `<instructions-warning>`, and `/instructions` prints the report.
|
|
17
33
|
- **`project_memory action=health`** reports git, `.dsh`, `PROJECT.md`, AGENTS/CLAUDE, scan warnings and scan age.
|
|
18
34
|
- **Writer locks** stop two `project_agent` writers from starting in the same root: lock under `~/.dsh/agent-extensions/locks`, 15-minute TTL, another owner cannot release it.
|
|
@@ -52,7 +68,7 @@ The kit is a bundle for [DeepSeek Harness](https://deepseek.com) (DSH) that inst
|
|
|
52
68
|
From npm:
|
|
53
69
|
|
|
54
70
|
```powershell
|
|
55
|
-
dsh plugin --profile desktop add dsh-desktop-kit@2.
|
|
71
|
+
dsh plugin --profile desktop add dsh-desktop-kit@2.34.1
|
|
56
72
|
```
|
|
57
73
|
|
|
58
74
|
From a local clone, with the interactive installer (Windows):
|
|
@@ -86,7 +102,7 @@ npm run skills:check # every skill core stays under the 6 000-token
|
|
|
86
102
|
npm run measure # refresh docs/measured.json + docs/MEASURED.md
|
|
87
103
|
npm run measure -- --check # the stored measurements match package.json
|
|
88
104
|
npm run check:release # versions agree across READMEs, measured.json and CHANGELOG
|
|
89
|
-
npm run verify:release -- 2.
|
|
105
|
+
npm run verify:release -- 2.34.1 # verify the published npm artifact (after publishing)
|
|
90
106
|
```
|
|
91
107
|
|
|
92
108
|
## Measured, not claimed
|
|
@@ -115,4 +131,4 @@ Every number in [docs/MEASURED.md](docs/MEASURED.md) is reproducible: the comman
|
|
|
115
131
|
|
|
116
132
|
MIT. Built for DeepSeek Harness; no external runtime dependencies and no telemetry.
|
|
117
133
|
|
|
118
|
-
**2.
|
|
134
|
+
**2.34.1** · 21 plugins · 35 skills · 14 roles · 7 presets · 14 gates · Windows 11 · DSH 0.2.x
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# DSH Desktop Kit 2.
|
|
1
|
+
# DSH Desktop Kit 2.34.1
|
|
2
2
|
|
|
3
3
|
**Русский** · [English](README.en.md)
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
`21 плагин` · `35 навыков` · `14 ролей` · `7 пресетов` · `14 гейтов` · `0 внешних runtime-зависимостей`
|
|
8
8
|
|
|
9
|
-

|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
## Быстрый старт
|
|
26
26
|
|
|
27
27
|
```powershell
|
|
28
|
-
# в DSH: Плагины → Add plugin → dsh-desktop-kit@2.
|
|
28
|
+
# в DSH: Плагины → Add plugin → dsh-desktop-kit@2.34.1
|
|
29
29
|
# или из терминала:
|
|
30
|
-
dsh plugin --profile desktop add dsh-desktop-kit@2.
|
|
30
|
+
dsh plugin --profile desktop add dsh-desktop-kit@2.34.1
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
После установки перезапустите окно DSH (`Ctrl+R`). Проверка:
|
|
@@ -44,11 +44,30 @@ node tools/e2e-http.mjs # живой web + API
|
|
|
44
44
|
|
|
45
45
|
---
|
|
46
46
|
|
|
47
|
+
## Что нового в 2.34.1
|
|
48
|
+
|
|
49
|
+
- **Описание пакета без версии.** В карточке плагина больше не висит «desktop kit 2.31.0» при версии 2.34.1: версия живёт в `version`, а не в `description`.
|
|
50
|
+
- **Гейт релиза** теперь падает, если в `description` снова появится semver-строка.
|
|
51
|
+
- README hero/alt и docs-ссылки синхронизированы с 2.34.1.
|
|
52
|
+
|
|
53
|
+
## Что нового в 2.34.0
|
|
54
|
+
|
|
55
|
+
| Что | Зачем |
|
|
56
|
+
|---|---|
|
|
57
|
+
| **Lock без гонки** | Атомарный `wx`-захват, heartbeat 30 с, проверка PID и stale-lock. Два writer-агента больше не могут одновременно стартовать в одном корне. |
|
|
58
|
+
| **Надёжный test runner** | `npm test` → `node tools/run-tests.mjs`: шаги запускаются без PowerShell/`&&`-обёртки, виден точный упавший шаг. |
|
|
59
|
+
| **Release ждёт registry** | `release.mjs --publish` опрашивает packument до 10 минут и различает «опубликовано / ещё обрабатывается / staged». Ноль от npm больше не выдаётся за live. |
|
|
60
|
+
| **Checkpoint: atomic + secret scan** | Snapshot пишется во временную папку и переименовывается атомарно; файлы с секретами пропускаются; хранятся последние 20 snapshot. |
|
|
61
|
+
| **Coverage критических сценариев** | Если есть `.dsh/quality/ui.json`, одного passing `interact` уже недостаточно: нужен отдельный прогон на каждый сценарий. |
|
|
62
|
+
| **Runtime переживает рестарт** | `guardrails action=runtime` сохраняет bounded-снапшот в `~/.dsh/agent-extensions/runtime.json`; текст команд по-прежнему не хранится. |
|
|
63
|
+
| **Роли: budget и isolation** | `max_turns` и `skills` попадают в prompt роли; `isolation: worktree` автоматически создаёт worktree для одиночного запуска. |
|
|
64
|
+
| **Manifest-версия в гейте** | `check-release-consistency` теперь сверяет `skills/manifest.json` с `package.json`, чтобы каталог навыков не отставал от релиза. |
|
|
65
|
+
|
|
47
66
|
## Что нового в 2.33.0
|
|
48
67
|
|
|
49
68
|
| Что | Зачем |
|
|
50
69
|
|---|---|
|
|
51
|
-
| **`guardrails action=runtime`** | Consequence-классификатор (`read/write/external/destructive/credential`) и
|
|
70
|
+
| **`guardrails action=runtime`** | Consequence-классификатор (`read/write/external/destructive/credential`) и snapshot последних ask/deny: видно, что именно DSH попросил подтвердить, без хранения текста команды. |
|
|
52
71
|
| **Валидатор инструкций** | AGENTS.md/CLAUDE.md проверяются на битые `@import`, устаревшие навыки, дубли корня и размер; предупреждение попадает в `<instructions-warning>`, команда `/instructions` показывает отчёт. |
|
|
53
72
|
| **`project_memory action=health`** | Сканер проекта: git, `.dsh`, `PROJECT.md`, AGENTS/CLAUDE, предупреждения автоскана, свежесть. |
|
|
54
73
|
| **Writer locks** | Два `project_agent`-писателя не стартуют в одном корне одновременно: lock в `~/.dsh/agent-extensions/locks`, TTL 15 минут, чужой owner не снимает. |
|
|
@@ -92,7 +111,7 @@ node tools/e2e-http.mjs # живой web + API
|
|
|
92
111
|
|
|
93
112
|
## Что внутри
|
|
94
113
|
|
|
95
|
-

|
|
96
115
|
|
|
97
116
|
*Один пакет закрывает полный контур: качество, агенты, навыки, ops, знания, безопасность и платформу.*
|
|
98
117
|
|
|
@@ -110,7 +129,7 @@ node tools/e2e-http.mjs # живой web + API
|
|
|
110
129
|
|
|
111
130
|
## Миссия качества
|
|
112
131
|
|
|
113
|
-

|
|
114
133
|
|
|
115
134
|
`quality_gate` превращает «сделай премиально» в исполняемое состояние:
|
|
116
135
|
|
|
@@ -262,7 +281,7 @@ i18n_sync action=check lang=ar
|
|
|
262
281
|
|
|
263
282
|
MCP: GitHub (official remote), Filesystem и свои серверы; OAuth 2.1 + PKCE; sampling через approval-карточку DSH; elicitation через Accept/Decline; tools/resources/prompts, health и статусы. Секреты — в `~/.dsh/mcp.secrets.json`, trust — только вручную.
|
|
264
283
|
|
|
265
|
-

|
|
266
285
|
|
|
267
286
|
*Настройки → MCP: серверы, health, tools и ручной trust.*
|
|
268
287
|
|
|
@@ -285,7 +304,7 @@ MCP: GitHub (official remote), Filesystem и свои серверы; OAuth 2.1
|
|
|
285
304
|
- **Sandbox** — Job Objects; файловая/сетевая изоляция не заявляется.
|
|
286
305
|
- **Данные** — `.dsh/` в проекте; транскрипты `0600`; PII и секреты не попадают в board.
|
|
287
306
|
|
|
288
|
-

|
|
289
308
|
|
|
290
309
|
*Настройки → Права: эффективные правила, защищённые пути и статус hooks.*
|
|
291
310
|
|
|
@@ -361,6 +380,8 @@ node tools/e2e-http.mjs
|
|
|
361
380
|
## Документация
|
|
362
381
|
|
|
363
382
|
- [CHANGELOG.md](CHANGELOG.md)
|
|
383
|
+
- [docs/TEST-2.34.1.md](docs/TEST-2.34.1.md)
|
|
384
|
+
- [docs/TEST-2.34.0.md](docs/TEST-2.34.0.md)
|
|
364
385
|
- [docs/TEST-2.33.0.md](docs/TEST-2.33.0.md)
|
|
365
386
|
- [docs/TEST-2.32.0.md](docs/TEST-2.32.0.md)
|
|
366
387
|
- [docs/TEST-2.31.0.md](docs/TEST-2.31.0.md)
|
|
@@ -383,4 +404,4 @@ node tools/e2e-http.mjs
|
|
|
383
404
|
|
|
384
405
|
MIT. Сделано для DeepSeek Harness; без внешних зависимостей и телеметрии.
|
|
385
406
|
|
|
386
|
-
**2.
|
|
407
|
+
**2.34.1** · 21 плагин · 35 навыков · 14 ролей · 7 пресетов · 14 гейтов · Windows 11 · DSH 0.2.x
|
package/client.js
CHANGED
|
@@ -8374,7 +8374,7 @@ var(--dsw-alias-bg-layer-1,#fff);box-shadow:inset 0 1px 0 color-mix(in srgb,#fff
|
|
|
8374
8374
|
if (__kitErrors.length <= 5) console.error("[dsh-desktop-kit] registration failed:", label, message);
|
|
8375
8375
|
};
|
|
8376
8376
|
try {
|
|
8377
|
-
window.__DSH_DESKTOP_KIT__ = { version: "2.
|
|
8377
|
+
window.__DSH_DESKTOP_KIT__ = { version: "2.34.1", parts: __partNames, errors: __kitErrors, ready: false };
|
|
8378
8378
|
} catch {}
|
|
8379
8379
|
const __inject = [];
|
|
8380
8380
|
for (const __part of __parts) {
|
package/docs/MEASURED.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
Отрицательный результат тоже результат: если метрика ухудшилась, она остаётся в таблице — с новой датой и честным объяснением, а не удаляется.
|
|
8
8
|
|
|
9
9
|
<!-- MEASURED:START -->
|
|
10
|
-
Версия **2.
|
|
10
|
+
Версия **2.34.1** · замер 2026-12-02T12:17:36.852Z · Windows_NT 10.0.26200 · AMD Ryzen 7 4800H with Radeon Graphics · 16 потоков · 7.4 ГБ RAM · Node v24.20.0.
|
|
11
11
|
|
|
12
12
|
| Метрика | Значение | Как измерено |
|
|
13
13
|
|---|---:|---|
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
| Каталог навыков, токенов | 53460 | node tools/skill-cost.mjs |
|
|
17
17
|
| references, токенов | 224412 | node tools/skill-cost.mjs |
|
|
18
18
|
| Самое тяжёлое ядро | 2417 (web-build) | бюджет 6000 токенов |
|
|
19
|
-
| Документов в docs/ |
|
|
20
|
-
| README.md, байт |
|
|
21
|
-
| README.en.md, байт |
|
|
22
|
-
| Tarball, байт |
|
|
23
|
-
| Файлов в tarball |
|
|
24
|
-
| Распакованный размер, байт |
|
|
19
|
+
| Документов в docs/ | 86 | tools/measure.mjs → docs/**/*.md |
|
|
20
|
+
| README.md, байт | 32332 | stat README.md |
|
|
21
|
+
| README.en.md, байт | 9263 | stat README.en.md |
|
|
22
|
+
| Tarball, байт | 13830807 | npm pack --dry-run --json |
|
|
23
|
+
| Файлов в tarball | 550 | npm pack --dry-run --json |
|
|
24
|
+
| Распакованный размер, байт | 18018367 | npm pack --dry-run --json |
|
|
25
25
|
<!-- MEASURED:END -->
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# TEST 2.34.0 — locks, runner, release polling, checkpoints, UI coverage
|
|
2
|
+
|
|
3
|
+
Дата: 2026-12-02 · Windows 11 · Node v24.20.0 · DSH 0.2.x.
|
|
4
|
+
|
|
5
|
+
## Что проверялось
|
|
6
|
+
|
|
7
|
+
- **Locks:** атомарный захват, чужой owner, stale takeover, heartbeat/release.
|
|
8
|
+
- **Test runner:** шаги из `test:steps` без PowerShell/`&&`-обёртки; failing step.
|
|
9
|
+
- **Release:** polling packument и сообщение об асинхронной/staged публикации.
|
|
10
|
+
- **Checkpoints:** atomic temp→rename, secret scan, retention, restore.
|
|
11
|
+
- **UI coverage:** `.dsh/quality/ui.json`, отдельный interact на сценарий.
|
|
12
|
+
- **Runtime:** persistence в `runtime.json`, отсутствие текста команд.
|
|
13
|
+
- **Roles:** parsing/prompt `max_turns`/`skills`/`isolation`.
|
|
14
|
+
- **Instructions:** catalog + user skills, stale/valid.
|
|
15
|
+
- **Release consistency:** `skills/manifest.json`.
|
|
16
|
+
|
|
17
|
+
## Команды и результаты
|
|
18
|
+
|
|
19
|
+
| Команда | Результат |
|
|
20
|
+
|---|---|
|
|
21
|
+
| `node tools/run-tests.mjs` | 43/43 шага |
|
|
22
|
+
| `node plugins/dsh-guardrails/tools/guardrails-tests.mjs` | 44 tests OK |
|
|
23
|
+
| `node tools/agent-extensions-tests.mjs` | OK |
|
|
24
|
+
| `node tools/instructions-tests.mjs` | OK |
|
|
25
|
+
| `node tools/ui-gate-tests.mjs` | OK |
|
|
26
|
+
| `node tools/memory-tests.mjs` | OK |
|
|
27
|
+
| `node tools/quality-pipeline-tests.mjs` | 27 groups OK |
|
|
28
|
+
| `node tools/check-release-consistency.mjs` | OK для 2.34.0 |
|
|
29
|
+
|
|
30
|
+
## Ограничения
|
|
31
|
+
|
|
32
|
+
- `max_turns` остаётся **advisory**: DSH subagent API не принимает лимит шагов; роль получает бюджет в prompt и должна остановиться сама. Жёсткое принуждение потребует API DSH.
|
|
33
|
+
- Locks advisory для не-`project_agent` инструментов; heartbeat 30 с, TTL 15 мин.
|
|
34
|
+
- File checkpoint сканирует только файлы ≤512 КБ; крупные бинарники копируются без content-скана.
|
|
35
|
+
- Store snapshot/retention не дедуплицирует содержимое: 20 полных копий проекта могут занимать место.
|
|
36
|
+
- Release polling ограничен 10 минутами; staged-публикация всё ещё требует 2FA-подтверждения владельца.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# TEST 2.34.1 — версия в description и hero
|
|
2
|
+
|
|
3
|
+
Дата: 2026-12-02 · Windows 11 · Node 24.20.
|
|
4
|
+
|
|
5
|
+
## Причина патча
|
|
6
|
+
|
|
7
|
+
В карточке плагина DSH отображалось: **«DeepSeek Harness desktop kit 2.31.0»** при версии 2.34.0. Источник — `package.json.description`, в который когда-то вписали версию. `version` была 2.34.0, строка описания — 2.31.0.
|
|
8
|
+
|
|
9
|
+
## Что исправлено
|
|
10
|
+
|
|
11
|
+
- `description` очищен от semver: «DeepSeek Harness desktop kit — 21 plugins and 35 skills…».
|
|
12
|
+
- `check-release-consistency` теперь проверяет, что в `description` нет `X.Y.Z`; регрессия не пройдёт релизный гейт.
|
|
13
|
+
- Hero README пересобран: `docs/images/hero-2.34.1.png`, 2400×1260, alt/H1/ссылки 2.34.1.
|
|
14
|
+
- README/CHANGELOG/docs синхронизированы с 2.34.1.
|
|
15
|
+
|
|
16
|
+
## Проверки
|
|
17
|
+
|
|
18
|
+
| Команда | Результат |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `node tools/check-release-consistency.mjs` | OK для 2.34.1 |
|
|
21
|
+
| `node tools/run-tests.mjs` | 43/43 |
|
|
22
|
+
| `browser_qa shot` hero | 2400×1260, overflow 0, console 0 |
|
|
23
|
+
| npm pack | 545 файлов, `docs/analysis` отсутствует |
|
|
24
|
+
|
|
25
|
+
## Ограничение
|
|
26
|
+
|
|
27
|
+
Версия 2.34.0 immutable: исправление описания требует 2.34.1, перезаписать 2.34.0 нельзя.
|
|
Binary file
|
package/docs/measured.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"version": "2.
|
|
4
|
-
"measuredAt": "2026-12-
|
|
3
|
+
"version": "2.34.1",
|
|
4
|
+
"measuredAt": "2026-12-02T12:17:36.852Z",
|
|
5
5
|
"command": "npm run measure",
|
|
6
6
|
"machine": {
|
|
7
7
|
"platform": "win32 x64",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"skillCoreBudget": 6000,
|
|
20
20
|
"skillCoreMaxTokens": 2417,
|
|
21
21
|
"skillCoreMaxName": "web-build",
|
|
22
|
-
"docsFiles":
|
|
23
|
-
"readmeBytes":
|
|
24
|
-
"readmeEnBytes":
|
|
25
|
-
"tarballBytes":
|
|
26
|
-
"unpackedBytes":
|
|
27
|
-
"tarballEntries":
|
|
28
|
-
"tarballName": "dsh-desktop-kit-2.
|
|
22
|
+
"docsFiles": 86,
|
|
23
|
+
"readmeBytes": 32332,
|
|
24
|
+
"readmeEnBytes": 9263,
|
|
25
|
+
"tarballBytes": 13830807,
|
|
26
|
+
"unpackedBytes": 18018367,
|
|
27
|
+
"tarballEntries": 550,
|
|
28
|
+
"tarballName": "dsh-desktop-kit-2.34.1.tgz"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="ru">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=2400, initial-scale=1">
|
|
6
|
+
<title>DSH Desktop Kit 2.34.1 — hero</title>
|
|
7
|
+
<link rel="stylesheet" href="readme-visuals.css">
|
|
8
|
+
<style>
|
|
9
|
+
.hero { width: 2400px; height: 1260px; padding: 58px 96px 42px; display: flex; flex-direction: column; }
|
|
10
|
+
.top { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
|
|
11
|
+
.brand { display: flex; align-items: center; gap: 18px; font-family: var(--mono); font-size: 21px; letter-spacing: 0.13em; color: var(--muted); }
|
|
12
|
+
.brand b { color: var(--text); font-weight: 500; letter-spacing: 0.18em; }
|
|
13
|
+
.brand .ver { padding: 5px 10px; border: 1px solid #2e6a55; color: var(--mint); border-radius: 6px; letter-spacing: 0.06em; }
|
|
14
|
+
.brand .mark { width: 16px; height: 16px; border: 1.5px solid var(--mint); border-radius: 3px; position: relative; }
|
|
15
|
+
.brand .mark::after { content: ""; position: absolute; inset: 4px; background: var(--mint); border-radius: 1px; }
|
|
16
|
+
.meta { color: var(--dim); font-family: var(--mono); font-size: 17px; letter-spacing: 0.08em; }
|
|
17
|
+
.main { flex: 1; display: grid; grid-template-columns: 1340px 1fr; gap: 64px; padding-top: 56px; min-height: 0; }
|
|
18
|
+
.copy { display: flex; flex-direction: column; min-width: 0; }
|
|
19
|
+
h1 { font-size: 101px; line-height: 1.04; letter-spacing: -0.035em; max-width: 1240px; }
|
|
20
|
+
h1 em { font-style: normal; color: var(--mint); }
|
|
21
|
+
.lead { margin-top: 28px; max-width: 1080px; color: var(--muted); font-size: 31px; line-height: 1.42; }
|
|
22
|
+
.lead b { color: var(--text); font-weight: 500; }
|
|
23
|
+
.stats { margin-top: 46px; display: flex; gap: 54px; padding-top: 26px; border-top: 1px solid var(--line); }
|
|
24
|
+
.stat b { display: block; font-family: "Unbounded", sans-serif; font-weight: 500; font-size: 54px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
|
|
25
|
+
.stat span { display: block; margin-top: 10px; color: var(--dim); font-family: var(--mono); font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
|
|
26
|
+
.install { margin-top: 30px; display: flex; align-items: center; gap: 16px; width: fit-content; max-width: 100%; padding: 18px 22px; border: 1px solid var(--line); background: #0b110e; border-radius: 8px; font-family: var(--mono); font-size: 21px; color: var(--muted); }
|
|
27
|
+
.points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 34px; max-width: 1240px; }
|
|
28
|
+
.point { border-top: 1px solid var(--line-strong); padding-top: 12px; display: flex; flex-direction: column; gap: 5px; }
|
|
29
|
+
.point span { color: var(--dim); font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; }
|
|
30
|
+
.point b { font-size: 19px; font-weight: 500; color: var(--text); }
|
|
31
|
+
.point small { color: var(--muted); font-size: 15px; line-height: 1.35; }
|
|
32
|
+
.prework { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
|
|
33
|
+
.pw-head { color: var(--dim); font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; margin-bottom: 8px; }
|
|
34
|
+
.pw-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
35
|
+
.pw { border: 1px solid var(--line-strong); color: var(--muted); border-radius: 4px; padding: 4px 8px; font-size: 13px; font-family: var(--mono); }
|
|
36
|
+
.rules { margin-top: 12px; color: var(--copper); font-size: 13px; font-family: var(--mono); letter-spacing: 0.02em; }
|
|
37
|
+
.accept { margin-top: 14px; border: 1px solid #2d5c4a; background: #0c1a14; border-radius: 7px; padding: 12px 14px; }
|
|
38
|
+
.accept-head { display: flex; justify-content: space-between; color: var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; margin-bottom: 7px; }
|
|
39
|
+
.accept-head b { color: var(--mint); font-weight: 500; }
|
|
40
|
+
.accept p { color: var(--muted); font-size: 13px; line-height: 1.55; }
|
|
41
|
+
.accept p b { color: var(--mint); font-weight: 500; }
|
|
42
|
+
.install .prompt { color: var(--mint); }
|
|
43
|
+
.install code { color: var(--text); font-family: inherit; white-space: nowrap; }
|
|
44
|
+
.mission { min-width: 0; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(17, 26, 22, 0.96), rgba(9, 14, 11, 0.96)); border-radius: 12px; padding: 26px 28px 24px; display: flex; flex-direction: column; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35); }
|
|
45
|
+
.mission-head { display: flex; justify-content: space-between; align-items: center; color: var(--dim); font-family: var(--mono); font-size: 15px; letter-spacing: 0.1em; }
|
|
46
|
+
.mission-title { margin-top: 10px; font-family: "Unbounded", sans-serif; font-size: 29px; font-weight: 500; letter-spacing: -0.02em; }
|
|
47
|
+
.mission-sub { margin-top: 6px; color: var(--dim); font-size: 16px; }
|
|
48
|
+
.phases { margin-top: 20px; border-top: 1px solid var(--line); }
|
|
49
|
+
.phase { display: grid; grid-template-columns: 126px 1fr; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid rgba(36, 51, 44, 0.72); }
|
|
50
|
+
.ph-name { color: var(--muted); font-family: var(--mono); font-size: 15px; letter-spacing: 0.04em; padding-top: 4px; }
|
|
51
|
+
.ph-name small { display: block; color: var(--dim); font-size: 12px; margin-top: 3px; letter-spacing: 0.02em; }
|
|
52
|
+
.gate-row { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
53
|
+
.chip { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 27px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
|
|
54
|
+
.chip.done { color: var(--mint); border-color: #2d5c4a; background: #10251d; }
|
|
55
|
+
.chip.active { color: #0a1510; border-color: var(--mint); background: var(--mint); font-weight: 600; }
|
|
56
|
+
.chip.lock { color: #6d7d74; border-color: #26332c; background: #0b100d; }
|
|
57
|
+
.chip.warn { color: var(--copper); border-color: #5a452d; background: #21170f; }
|
|
58
|
+
.phase.active { background: rgba(115, 230, 187, 0.045); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 4px; }
|
|
59
|
+
.phase.active .ph-name { color: var(--text); }
|
|
60
|
+
.evidence { margin-top: 18px; border: 1px solid var(--line); border-radius: 7px; padding: 13px 15px; background: #0a100d; }
|
|
61
|
+
.ev-head { display: flex; justify-content: space-between; color: var(--dim); font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; margin-bottom: 8px; }
|
|
62
|
+
.ev-head b { color: var(--mint); font-weight: 500; }
|
|
63
|
+
.evidence p { color: var(--muted); font-size: 14px; line-height: 1.55; }
|
|
64
|
+
.evidence p b { color: var(--text); font-weight: 500; }
|
|
65
|
+
.footer { display: flex; justify-content: space-between; align-items: center; padding-top: 18px; color: var(--dim); font-family: var(--mono); font-size: 15px; letter-spacing: 0.05em; }
|
|
66
|
+
.sig { color: var(--mint); letter-spacing: 0.1em; }
|
|
67
|
+
</style>
|
|
68
|
+
</head>
|
|
69
|
+
<body>
|
|
70
|
+
<div class="page hero">
|
|
71
|
+
<header class="top">
|
|
72
|
+
<div class="brand"><span class="mark"></span><b>DSH DESKTOP KIT</b><span class="ver">2.34.1</span></div>
|
|
73
|
+
<div class="meta">21 PLUGINS · 35 SKILLS · 14 ROLES · 7 PRESETS</div>
|
|
74
|
+
</header>
|
|
75
|
+
|
|
76
|
+
<main class="main">
|
|
77
|
+
<section class="copy">
|
|
78
|
+
<p class="kicker">Quality mission · diagnostics · browser QA</p>
|
|
79
|
+
<h1>Качество, которое нельзя закрыть без <em>доказательств.</em></h1>
|
|
80
|
+
<p class="lead">Миссия с гейтами <b>G0–G13</b>, браузерная проверка <b>interact / a11y / perf</b>, диагностика <b>/kit doctor</b> и замеры — в одном npm-пакете для DeepSeek Harness.</p>
|
|
81
|
+
<div class="stats">
|
|
82
|
+
<div class="stat"><b>21</b><span>плагин</span></div>
|
|
83
|
+
<div class="stat"><b>35</b><span>навыков</span></div>
|
|
84
|
+
<div class="stat"><b>14</b><span>ролей</span></div>
|
|
85
|
+
<div class="stat"><b>14</b><span>гейтов</span></div>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="points">
|
|
88
|
+
<div class="point"><span>01</span><b>Миссия качества</b><small>7 фаз · 14 гейтов · evidence ≥ 12</small></div>
|
|
89
|
+
<div class="point"><span>02</span><b>Browser QA</b><small>18 действий · матрица 4/4 · a11y и perf</small></div>
|
|
90
|
+
<div class="point"><span>03</span><b>Диагностика и замеры</b><small>/kit doctor · plan · tune · measured</small></div>
|
|
91
|
+
</div>
|
|
92
|
+
<div class="install"><span class="prompt">$</span><code>dsh plugin --profile desktop add dsh-desktop-kit@2.34.1</code></div>
|
|
93
|
+
</section>
|
|
94
|
+
|
|
95
|
+
<aside class="mission" aria-label="Схема миссии качества">
|
|
96
|
+
<div class="mission-head"><span>MISSION / QUALITY</span><span class="tag mint">turnkey</span></div>
|
|
97
|
+
<div class="mission-title">Редизайн клиники</div>
|
|
98
|
+
<div class="mission-sub">Схема: фазы · гейты · evidence</div>
|
|
99
|
+
<div class="phases">
|
|
100
|
+
<div class="phase"><span class="ph-name">research<small>бриф + замеры</small></span><div class="gate-row"><span class="chip done">G0</span><span class="chip done">G1</span></div></div>
|
|
101
|
+
<div class="phase"><span class="ph-name">plan<small>DAG + риски</small></span><div class="gate-row"><span class="chip done">G2</span></div></div>
|
|
102
|
+
<div class="phase"><span class="ph-name">system<small>токены + палитра</small></span><div class="gate-row"><span class="chip done">G3</span></div></div>
|
|
103
|
+
<div class="phase active"><span class="ph-name">build<small>единица работы</small></span><div class="gate-row"><span class="chip active">G4</span><span class="chip lock">G5</span><span class="chip lock">G6</span></div></div>
|
|
104
|
+
<div class="phase"><span class="ph-name">verify<small>5 проверок</small></span><div class="gate-row"><span class="chip lock">G5</span><span class="chip lock">G6</span><span class="chip lock">G7</span><span class="chip lock">G8</span><span class="chip lock">G9</span><span class="chip lock">G10</span></div></div>
|
|
105
|
+
<div class="phase"><span class="ph-name">fix<small>возврат в build</small></span><div class="gate-row"><span class="chip warn">loop</span></div></div>
|
|
106
|
+
<div class="phase"><span class="ph-name">handoff<small>приёмка + релиз</small></span><div class="gate-row"><span class="chip lock">G11</span><span class="chip lock">G12</span><span class="chip lock">G13</span></div></div>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="evidence">
|
|
109
|
+
<div class="ev-head"><span>evidence.jsonl</span><b>42 записи</b></div>
|
|
110
|
+
<p><b>G4</b> audit matrix=full · overflow 0 · console 0</p>
|
|
111
|
+
<p><b>G5/G6</b> interact 7/7 · a11y serious 0</p>
|
|
112
|
+
<p><b>G7</b> LCP 740 ms · INP 96 ms · CLS 0.01</p>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="accept">
|
|
115
|
+
<div class="accept-head"><span>ACCEPTANCE</span><b>PASS</b></div>
|
|
116
|
+
<p><b>PASS</b> audit matrix=full · overflow 0 · a11y serious 0</p>
|
|
117
|
+
<p><b>PASS</b> LCP 740 ms · INP 96 ms · CLS 0.01</p>
|
|
118
|
+
</div>
|
|
119
|
+
<div class="prework">
|
|
120
|
+
<div class="pw-head">PRE-WORK · ДО КОДА</div>
|
|
121
|
+
<div class="pw-chips"><span class="pw">product</span><span class="pw">references</span><span class="pw">IA</span><span class="pw">plan</span><span class="pw">brief</span></div>
|
|
122
|
+
<div class="rules">2 падения одного гейта → escalate, а не третий круг</div>
|
|
123
|
+
</div>
|
|
124
|
+
</aside>
|
|
125
|
+
</main>
|
|
126
|
+
|
|
127
|
+
<footer class="footer">
|
|
128
|
+
<span>Windows 11 · DSH 0.2.x · npm dsh-desktop-kit@2.34.1</span>
|
|
129
|
+
<span class="sig">G0 — G13</span>
|
|
130
|
+
</footer>
|
|
131
|
+
</div>
|
|
132
|
+
</body>
|
|
133
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-desktop-kit",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "DeepSeek Harness desktop kit
|
|
3
|
+
"version": "2.34.1",
|
|
4
|
+
"description": "DeepSeek Harness desktop kit — 21 plugins and 35 skills: quality mission with phases, gates G0..G13, a pre-work layer (product brief, measured references, IA/content inventory, plan with dependencies, risks and blockers), an art-direction brief with variants, a release pipeline and remote_ops (typed ssh/scp with host state diff), units of work and an evidence trail; browser QA with 18 actions (interaction scenarios, accessibility WCAG 2.2 AA, performance budgets, element locate, pixel-diff baselines, palette contrast matrix, cross-page consistency, interactive-state and content checks, design report, reference take), plus an i18n dictionary pipeline; 14 project agents including ui-critic, a11y, cms-ops and a worktree builder; phase-aware skill routing with a token budget; MCP with OAuth 2.1, sampling and elicitation; read-only/writer swarm with a shared board; token lab, Skills Studio, project memory, guardrails, repo map, checkpoints, plan mode, GitHub review, hooks/commands, Russian UI and profile transfer. Includes local marketplace, localhost IDE bridge and an honest sandbox audit.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
7
7
|
"dsh",
|
|
@@ -92,13 +92,14 @@
|
|
|
92
92
|
"build:client": "node tools/build-client.mjs",
|
|
93
93
|
"build:skills": "node tools/build-skill-manifest.mjs",
|
|
94
94
|
"check:client": "node tools/check-client.mjs client.js",
|
|
95
|
-
"test": "node tools/
|
|
95
|
+
"test": "node tools/run-tests.mjs",
|
|
96
96
|
"skills:cost": "node tools/skill-cost.mjs",
|
|
97
97
|
"skills:check": "node tools/skill-cost.mjs --check",
|
|
98
98
|
"release": "node tools/release.mjs",
|
|
99
99
|
"verify:release": "node tools/verify-release.mjs",
|
|
100
100
|
"measure": "node tools/measure.mjs",
|
|
101
|
-
"check:release": "node tools/check-release-consistency.mjs"
|
|
101
|
+
"check:release": "node tools/check-release-consistency.mjs",
|
|
102
|
+
"test:steps": "node tools/integrations-tests.mjs && node tools/smoke-tests.mjs && node tools/memory-tests.mjs && node tools/skills-sync-tests.mjs && node tools/kit-upgrade-tests.mjs && node plugins/dsh-profile-transfer/test/transfer.test.mjs && node --test plugins/dsh-memory-bridge/test/bridge.test.mjs plugins/dsh-memory-bridge/test/github.test.mjs plugins/dsh-memory-bridge/test/merge.test.mjs plugins/dsh-memory-bridge/test/user-specific.test.mjs && node tools/repo-map-tests.mjs && node tools/checkpoints-tests.mjs && node tools/plan-mode-tests.mjs && node tools/quality-pipeline-tests.mjs && node tools/remote-ops-tests.mjs && node tools/i18n-tests.mjs && node tools/autopilot-route-tests.mjs && node tools/browser-qa-tests.mjs && node tools/browser-qa-extras-tests.mjs && node tools/ui-gate-tests.mjs && node tools/agent-extensions-tests.mjs && node tools/research-ledger-tests.mjs && node tools/research-eval.mjs && node tools/citation-eval.mjs && node tools/mcp-manager-tests.mjs && node tools/github-review-tests.mjs && node tools/mcp-catalog-tests.mjs && node tools/mcp-bootstrap-tests.mjs && node tools/instructions-tests.mjs && node tools/mcp-elicitation-tests.mjs && node tools/mcp-sampling-tests.mjs && node tools/mcp-oauth-tests.mjs && node tools/worktrees-tests.mjs && node tools/transcripts-tests.mjs && node tools/team-messages-tests.mjs && node tools/rc3-compat-tests.mjs && node tools/swarm-tests.mjs && node tools/team-presets-tests.mjs && node tools/team-board-tests.mjs && node tools/team-agents-tests.mjs && node tools/background-agents-tests.mjs && node tools/permissions-ui-tests.mjs && node plugins/dsh-guardrails/tools/guardrails-tests.mjs && node tools/kit-diagnostics-tests.mjs && node tools/onboarding-tests.mjs && node tools/check-release-consistency.mjs"
|
|
102
103
|
},
|
|
103
104
|
"engines": {
|
|
104
105
|
"node": ">=20"
|
|
@@ -174,7 +174,7 @@ function toolDefinition(ctx) {
|
|
|
174
174
|
if (!definition) return { ok: false, text: `project_agent: unknown agent "${name}"` };
|
|
175
175
|
let worktree = null;
|
|
176
176
|
try {
|
|
177
|
-
const requested = input?.worktree;
|
|
177
|
+
const requested = input?.worktree ?? (definition.isolation === "worktree" ? "auto" : false);
|
|
178
178
|
if (requested) {
|
|
179
179
|
const auto = requested === true || String(requested).toLowerCase() === "auto";
|
|
180
180
|
const slug = auto ? `${safeSlug(name)}-${Date.now().toString(36).slice(-4)}` : String(requested);
|
|
@@ -39,6 +39,17 @@ function remember(record, activation, projectRoot, signal, onAbort) {
|
|
|
39
39
|
background.set(record.id, { record, activation, projectRoot, signal, onAbort });
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
export function rolePrompt(definition = {}) {
|
|
43
|
+
const lines = [];
|
|
44
|
+
if (definition.maxTurns > 0) {
|
|
45
|
+
lines.push(`Turn budget (advisory): ${definition.maxTurns}. Stop when the deliverable is done; if blocked, report the blocker instead of looping.`);
|
|
46
|
+
}
|
|
47
|
+
if (definition.skills) {
|
|
48
|
+
lines.push(`Available skills: ${definition.skills}. Load exactly the ones you need with the skill tool.`);
|
|
49
|
+
}
|
|
50
|
+
return lines.join("\n");
|
|
51
|
+
}
|
|
52
|
+
|
|
42
53
|
export async function runProjectAgent(ctx, exec, definition, task, options = {}) { const subagents = ctx.get("subagents");
|
|
43
54
|
if (!subagents || typeof subagents.startActivation !== "function") {
|
|
44
55
|
throw new Error("subagents service is unavailable");
|
|
@@ -82,6 +93,7 @@ export async function runProjectAgent(ctx, exec, definition, task, options = {})
|
|
|
82
93
|
const prompt = [
|
|
83
94
|
`<project-agent name="${definition.name}">`,
|
|
84
95
|
definition.body,
|
|
96
|
+
rolePrompt(definition),
|
|
85
97
|
"</project-agent>",
|
|
86
98
|
options.teamId ? `<team id="${options.teamId}">Use team_board action=post/read with teamId=${options.teamId} to share findings; use add-task/claim/done for work items. Use team_message to=\"parent\" for a live message to the lead; sibling live messaging is not available — the board is the shared channel.</team>` : "",
|
|
87
99
|
options.leadContext ? `<team-lead>You coordinate this team. Members: ${options.leadContext}. Read the board first; assign/claim tasks with acceptance criteria and non-overlapping scopes; use team_message to=<run-id> for live directions and team_message to=\"parent\" to report to the parent. Finish with a PASS/FAIL synthesis, blockers and unresolved risks.</team-lead>` : "",
|
|
@@ -11,6 +11,7 @@ import fs from "node:fs";
|
|
|
11
11
|
import os from "node:os";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { spawnSync } from "node:child_process";
|
|
14
|
+
import { scanTextForSecrets } from "../../dsh-guardrails/lib/secrets.js";
|
|
14
15
|
|
|
15
16
|
function git(cwd, args, env, allowFail = false) {
|
|
16
17
|
const result = spawnSync("git", args, {
|
|
@@ -50,6 +51,8 @@ function fileCheckpointDir(root, home) {
|
|
|
50
51
|
const FILE_SKIP = /(?:^|[\\/])(?:node_modules|\.git|\.dsh|dist|build|coverage|\.cache|vendor|\.next|target|\.ssh|\.aws|\.azure|\.gnupg)(?:[\\/]|$)|(?:^|[\\/])\.env(?:\.|$)|(?:^|[\\/])(?:\.npmrc|\.git-credentials|credentials)(?:[\\/]|$)|\.(?:pem|key|pfx|p12|kdbx)$/iu;
|
|
51
52
|
const FILE_LIMIT = 5000;
|
|
52
53
|
const BYTE_LIMIT = 200 * 1024 * 1024;
|
|
54
|
+
const SECRET_SCAN_BYTES = 512 * 1024;
|
|
55
|
+
const RETENTION = 20;
|
|
53
56
|
|
|
54
57
|
function resolveRoot(cwd) {
|
|
55
58
|
try {
|
|
@@ -80,33 +83,76 @@ function walkFiles(root, relative = "", state = { files: [], bytes: 0 }) {
|
|
|
80
83
|
return state;
|
|
81
84
|
}
|
|
82
85
|
|
|
83
|
-
function copyFiles(root, destination, files) {
|
|
86
|
+
function copyFiles(root, destination, files, { scanSecrets = false } = {}) {
|
|
87
|
+
const skipped = [];
|
|
84
88
|
for (const rel of files) {
|
|
89
|
+
const source = path.join(root, rel);
|
|
90
|
+
if (scanSecrets) {
|
|
91
|
+
try {
|
|
92
|
+
if (fs.statSync(source).size <= SECRET_SCAN_BYTES) {
|
|
93
|
+
const text = fs.readFileSync(source, "utf8");
|
|
94
|
+
if (scanTextForSecrets(text, { maxFindings: 1 }).length > 0) {
|
|
95
|
+
skipped.push(rel);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} catch {
|
|
100
|
+
skipped.push(rel);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
85
104
|
const target = path.join(destination, rel);
|
|
86
105
|
fs.mkdirSync(path.dirname(target), { recursive: true, mode: 0o700 });
|
|
87
|
-
fs.copyFileSync(
|
|
106
|
+
fs.copyFileSync(source, target);
|
|
88
107
|
}
|
|
108
|
+
return { skipped };
|
|
89
109
|
}
|
|
90
110
|
|
|
91
111
|
function createFileCheckpoint({ cwd, label, home }) {
|
|
92
112
|
const root = path.resolve(cwd || process.cwd());
|
|
93
113
|
const id = `cp-${new Date().toISOString().replace(/[-:T.Z]/gu, "").slice(0, 14)}-${crypto.randomBytes(3).toString("hex")}`;
|
|
94
114
|
const state = walkFiles(root);
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
115
|
+
const parent = fileCheckpointDir(root, home);
|
|
116
|
+
const finalDirectory = path.join(parent, id);
|
|
117
|
+
const temporary = path.join(parent, `${id}.tmp-${process.pid}-${crypto.randomBytes(3).toString("hex")}`);
|
|
118
|
+
let copied;
|
|
119
|
+
try {
|
|
120
|
+
fs.mkdirSync(path.join(temporary, "files"), { recursive: true, mode: 0o700 });
|
|
121
|
+
copied = copyFiles(root, path.join(temporary, "files"), state.files, { scanSecrets: true });
|
|
122
|
+
const meta = {
|
|
123
|
+
id,
|
|
124
|
+
kind: "files",
|
|
125
|
+
label: String(label ?? ""),
|
|
126
|
+
createdAt: new Date().toISOString(),
|
|
127
|
+
root,
|
|
128
|
+
files: state.files.length - copied.skipped.length,
|
|
129
|
+
skippedSecrets: copied.skipped.length,
|
|
130
|
+
bytes: state.bytes,
|
|
131
|
+
snapshot: path.join(finalDirectory, "files"),
|
|
132
|
+
};
|
|
133
|
+
fs.writeFileSync(path.join(temporary, "meta.json"), `${JSON.stringify(meta, null, 2)}\n`, { mode: 0o600 });
|
|
134
|
+
fs.renameSync(temporary, finalDirectory);
|
|
135
|
+
pruneFileCheckpoints(root, home);
|
|
136
|
+
return meta;
|
|
137
|
+
} catch (error) {
|
|
138
|
+
try { fs.rmSync(temporary, { recursive: true, force: true }); } catch { /* best effort */ }
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function pruneFileCheckpoints(root, home) {
|
|
144
|
+
const directory = fileCheckpointDir(root, home);
|
|
145
|
+
if (!fs.existsSync(directory)) return;
|
|
146
|
+
const entries = fs.readdirSync(directory)
|
|
147
|
+
.filter((name) => /^cp-[^\\/]+$/u.test(name))
|
|
148
|
+
.map((name) => {
|
|
149
|
+
try { return { name, at: fs.statSync(path.join(directory, name)).mtimeMs }; } catch { return null; }
|
|
150
|
+
})
|
|
151
|
+
.filter(Boolean)
|
|
152
|
+
.sort((left, right) => right.at - left.at);
|
|
153
|
+
for (const entry of entries.slice(RETENTION)) {
|
|
154
|
+
try { fs.rmSync(path.join(directory, entry.name), { recursive: true, force: true }); } catch { /* best effort */ }
|
|
155
|
+
}
|
|
110
156
|
}
|
|
111
157
|
|
|
112
158
|
function listFileCheckpoints(root, home) {
|
|
@@ -119,7 +119,7 @@ function statusText(ctx) {
|
|
|
119
119
|
`Checkpoints: ${checkpoints.length}`,
|
|
120
120
|
`Instructions: ${instructions.files.length} файлов · ${instructions.bytes} байт · предупреждений ${instructions.findings.length}`,
|
|
121
121
|
...instructions.findings.slice(0, 5).map((item) => ` ! ${item.code}: ${item.message}`),
|
|
122
|
-
`Locks: ${locks.length}${locks.length ? ` · ${locks.map((lock) => `${lock.root} (${lock.owner})`).join("; ")}` : ""}`,
|
|
122
|
+
`Locks: ${locks.length}${locks.length ? ` · ${locks.slice(0, 5).map((lock) => `${lock.root} (${lock.owner})`).join("; ")}${locks.length > 5 ? " …" : ""}` : ""}`,
|
|
123
123
|
`Quality: ${quality ? `${quality.profile} · ${quality.phase} · гейтов ${Object.values(quality.gates ?? {}).filter((gate) => gate.status === "passed").length}/${Object.keys(quality.gates ?? {}).length}` : "миссии нет (/quality start)"}`,
|
|
124
124
|
].join("\n");
|
|
125
125
|
}
|
|
@@ -115,12 +115,27 @@ function dshSkillsDir() {
|
|
|
115
115
|
return path.join(process.env.DSH_HOME || path.join(os.homedir(), ".dsh"), "skills");
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
function kitSkillCatalog() {
|
|
119
|
+
try {
|
|
120
|
+
const manifest = JSON.parse(fs.readFileSync(path.resolve(import.meta.dirname, "../../../skills/manifest.json"), "utf8"));
|
|
121
|
+
const raw = manifest?.skills;
|
|
122
|
+
if (raw && typeof raw === "object" && !Array.isArray(raw)) return new Set(Object.keys(raw).map((name) => name.toLowerCase()));
|
|
123
|
+
if (Array.isArray(raw)) return new Set(raw.map((item) => String(item?.name ?? "").toLowerCase()).filter(Boolean));
|
|
124
|
+
return null;
|
|
125
|
+
} catch {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const KIT_SKILLS = kitSkillCatalog();
|
|
131
|
+
|
|
118
132
|
function skillExists(name) {
|
|
119
133
|
try {
|
|
120
|
-
|
|
134
|
+
if (fs.existsSync(path.join(dshSkillsDir(), name, "SKILL.md"))) return true;
|
|
121
135
|
} catch {
|
|
122
|
-
|
|
136
|
+
/* fall through to the kit catalog */
|
|
123
137
|
}
|
|
138
|
+
return Boolean(KIT_SKILLS?.has(name));
|
|
124
139
|
}
|
|
125
140
|
|
|
126
141
|
/** Extract explicit skill references, not every hyphenated word. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Advisory writer locks for project agents.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* The lock is acquired atomically with O_EXCL (`wx`), refreshed by a heartbeat,
|
|
5
|
+
* and released by the owner. It is still advisory: other tools can edit the
|
|
6
|
+
* project; the value is that two `project_agent` writers do not start on the
|
|
7
|
+
* same root by accident. A dead PID or an expired heartbeat makes a lock
|
|
8
|
+
* stealable, so a crashed agent cannot block the project forever.
|
|
9
9
|
*/
|
|
10
10
|
import crypto from "node:crypto";
|
|
11
11
|
import fs from "node:fs";
|
|
@@ -13,6 +13,8 @@ import os from "node:os";
|
|
|
13
13
|
import path from "node:path";
|
|
14
14
|
|
|
15
15
|
const DEFAULT_TTL_MS = 15 * 60 * 1000;
|
|
16
|
+
const HEARTBEAT_MS = 30 * 1000;
|
|
17
|
+
const heartbeats = new Map();
|
|
16
18
|
|
|
17
19
|
function homeDirectory(home) {
|
|
18
20
|
return home || process.env.DSH_HOME || path.join(os.homedir(), ".dsh");
|
|
@@ -35,34 +37,69 @@ function readLock(file) {
|
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
function processAlive(pid) {
|
|
41
|
+
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
42
|
+
try {
|
|
43
|
+
process.kill(pid, 0);
|
|
44
|
+
return true;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
return error?.code === "EPERM";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
function isStale(lock, now = Date.now()) {
|
|
39
51
|
const heartbeat = Date.parse(lock?.heartbeatAt ?? lock?.createdAt ?? "");
|
|
40
52
|
const ttl = Number(lock?.ttlMs) > 0 ? Number(lock.ttlMs) : DEFAULT_TTL_MS;
|
|
41
|
-
|
|
53
|
+
if (!Number.isFinite(heartbeat) || now - heartbeat > ttl) return true;
|
|
54
|
+
return !processAlive(Number(lock?.pid));
|
|
42
55
|
}
|
|
43
56
|
|
|
44
|
-
function
|
|
45
|
-
fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
|
|
57
|
+
function atomicWrite(file, value) {
|
|
46
58
|
const temporary = `${file}.${process.pid}.${Date.now()}.tmp`;
|
|
47
59
|
fs.writeFileSync(temporary, `${JSON.stringify(value, null, 2)}\n`, { mode: 0o600 });
|
|
48
60
|
fs.renameSync(temporary, file);
|
|
49
61
|
}
|
|
50
62
|
|
|
63
|
+
function createExclusive(file, value) {
|
|
64
|
+
fs.mkdirSync(path.dirname(file), { recursive: true, mode: 0o700 });
|
|
65
|
+
const fd = fs.openSync(file, "wx", 0o600);
|
|
66
|
+
try {
|
|
67
|
+
fs.writeFileSync(fd, `${JSON.stringify(value, null, 2)}\n`);
|
|
68
|
+
} finally {
|
|
69
|
+
fs.closeSync(fd);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function stopHeartbeat(file) {
|
|
74
|
+
const timer = heartbeats.get(file);
|
|
75
|
+
if (timer) clearInterval(timer);
|
|
76
|
+
heartbeats.delete(file);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function startHeartbeat(file, owner) {
|
|
80
|
+
stopHeartbeat(file);
|
|
81
|
+
const timer = setInterval(() => {
|
|
82
|
+
try {
|
|
83
|
+
const current = readLock(file);
|
|
84
|
+
if (!current || String(current.owner) !== String(owner)) {
|
|
85
|
+
stopHeartbeat(file);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
atomicWrite(file, { ...current, heartbeatAt: new Date().toISOString() });
|
|
89
|
+
} catch {
|
|
90
|
+
stopHeartbeat(file);
|
|
91
|
+
}
|
|
92
|
+
}, HEARTBEAT_MS);
|
|
93
|
+
timer.unref?.();
|
|
94
|
+
heartbeats.set(file, timer);
|
|
95
|
+
}
|
|
96
|
+
|
|
51
97
|
export function acquireLock({ cwd, owner, scope = "writer", ttlMs = DEFAULT_TTL_MS, home } = {}) {
|
|
52
98
|
if (!cwd) throw new Error("lock: cwd is required");
|
|
53
99
|
if (!owner) throw new Error("lock: owner is required");
|
|
54
100
|
const root = path.resolve(cwd);
|
|
55
101
|
const file = lockFile(root, home);
|
|
56
102
|
const now = new Date().toISOString();
|
|
57
|
-
const existing = readLock(file);
|
|
58
|
-
if (existing && !isStale(existing)) {
|
|
59
|
-
if (String(existing.owner) === String(owner)) {
|
|
60
|
-
const refreshed = { ...existing, heartbeatAt: now };
|
|
61
|
-
safeWrite(file, refreshed);
|
|
62
|
-
return { ok: true, lock: refreshed, refreshed: true };
|
|
63
|
-
}
|
|
64
|
-
return { ok: false, holder: existing, file };
|
|
65
|
-
}
|
|
66
103
|
const lock = {
|
|
67
104
|
id: crypto.randomUUID(),
|
|
68
105
|
root,
|
|
@@ -73,16 +110,38 @@ export function acquireLock({ cwd, owner, scope = "writer", ttlMs = DEFAULT_TTL_
|
|
|
73
110
|
heartbeatAt: now,
|
|
74
111
|
ttlMs: Number(ttlMs) > 0 ? Number(ttlMs) : DEFAULT_TTL_MS,
|
|
75
112
|
};
|
|
76
|
-
|
|
77
|
-
|
|
113
|
+
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
114
|
+
try {
|
|
115
|
+
createExclusive(file, lock);
|
|
116
|
+
startHeartbeat(file, owner);
|
|
117
|
+
return { ok: true, lock, refreshed: false, stop: () => stopHeartbeat(file) };
|
|
118
|
+
} catch (error) {
|
|
119
|
+
if (error?.code !== "EEXIST") throw error;
|
|
120
|
+
const existing = readLock(file);
|
|
121
|
+
if (!existing) continue;
|
|
122
|
+
if (String(existing.owner) === String(owner)) {
|
|
123
|
+
const refreshed = { ...existing, heartbeatAt: now };
|
|
124
|
+
atomicWrite(file, refreshed);
|
|
125
|
+
startHeartbeat(file, owner);
|
|
126
|
+
return { ok: true, lock: refreshed, refreshed: true, stop: () => stopHeartbeat(file) };
|
|
127
|
+
}
|
|
128
|
+
if (!isStale(existing)) return { ok: false, holder: existing, file };
|
|
129
|
+
try { fs.rmSync(file, { force: true }); } catch { /* another contender may win */ }
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return { ok: false, holder: readLock(file) ?? null, file };
|
|
78
133
|
}
|
|
79
134
|
|
|
80
135
|
export function releaseLock({ cwd, owner, home } = {}) {
|
|
81
136
|
if (!cwd || !owner) return { ok: false, reason: "cwd and owner are required" };
|
|
82
137
|
const file = lockFile(cwd, home);
|
|
83
138
|
const existing = readLock(file);
|
|
84
|
-
if (!existing)
|
|
139
|
+
if (!existing) {
|
|
140
|
+
stopHeartbeat(file);
|
|
141
|
+
return { ok: true, released: false };
|
|
142
|
+
}
|
|
85
143
|
if (String(existing.owner) !== String(owner)) return { ok: false, reason: "lock belongs to another owner", holder: existing };
|
|
144
|
+
stopHeartbeat(file);
|
|
86
145
|
fs.rmSync(file, { force: true });
|
|
87
146
|
return { ok: true, released: true };
|
|
88
147
|
}
|
|
@@ -92,7 +151,7 @@ export function refreshLock({ cwd, owner, home } = {}) {
|
|
|
92
151
|
const existing = readLock(file);
|
|
93
152
|
if (!existing || String(existing.owner) !== String(owner)) return { ok: false, reason: "lock not held by owner" };
|
|
94
153
|
const refreshed = { ...existing, heartbeatAt: new Date().toISOString() };
|
|
95
|
-
|
|
154
|
+
atomicWrite(file, refreshed);
|
|
96
155
|
return { ok: true, lock: refreshed };
|
|
97
156
|
}
|
|
98
157
|
|
|
@@ -112,3 +171,4 @@ export function lockCount({ home } = {}) {
|
|
|
112
171
|
}
|
|
113
172
|
|
|
114
173
|
export const LOCK_TTL_MS = DEFAULT_TTL_MS;
|
|
174
|
+
export const LOCK_HEARTBEAT_MS = HEARTBEAT_MS;
|
|
@@ -27,6 +27,29 @@ const SHELL_WRITE = /(?:^|[\s"'=])(?:>|>>|Set-Content|Add-Content|Out-File|Copy-
|
|
|
27
27
|
const MAX_REMINDERS = 4;
|
|
28
28
|
const MAX_PATHS = 12;
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Optional critical-scenario coverage: `.dsh/quality/ui.json` with
|
|
32
|
+
* `{ "scenarios": ["menu", "checkout"] }`. When present, a single passing
|
|
33
|
+
* interact is no longer enough; distinct interact runs must cover the list.
|
|
34
|
+
*/
|
|
35
|
+
export function readUiCoverage(cwd) {
|
|
36
|
+
if (!cwd) return [];
|
|
37
|
+
for (const name of ["ui.json", "ui-coverage.json"]) {
|
|
38
|
+
try {
|
|
39
|
+
const raw = JSON.parse(fs.readFileSync(path.join(cwd, ".dsh", "quality", name), "utf8"));
|
|
40
|
+
const scenarios = Array.isArray(raw?.scenarios) ? raw.scenarios : [];
|
|
41
|
+
return scenarios
|
|
42
|
+
.map((item) => (typeof item === "string" ? item : item?.name))
|
|
43
|
+
.filter((item) => typeof item === "string" && item.trim().length > 0)
|
|
44
|
+
.map((item) => item.trim())
|
|
45
|
+
.slice(0, 20);
|
|
46
|
+
} catch {
|
|
47
|
+
/* optional */
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
|
|
30
53
|
function shellUiPath(command) {
|
|
31
54
|
const match = String(command).match(/(?:[A-Za-z]:[\\/]|\.{0,2}[\\/])?[^\s"'<>|;]+\.(?:html?|xhtml|css|scss|sass|less|jsx|tsx|vue|svelte|astro|mdx)/iu);
|
|
32
55
|
return match?.[0] ?? "";
|
|
@@ -217,6 +240,8 @@ export function createUiGate(ctx) {
|
|
|
217
240
|
a11y: null,
|
|
218
241
|
interactAt: 0,
|
|
219
242
|
interact: null,
|
|
243
|
+
interactRuns: new Set(),
|
|
244
|
+
coverage: [],
|
|
220
245
|
paths: new Set(),
|
|
221
246
|
reminders: 0,
|
|
222
247
|
};
|
|
@@ -238,6 +263,8 @@ export function createUiGate(ctx) {
|
|
|
238
263
|
state.clean = false;
|
|
239
264
|
state.a11y = null;
|
|
240
265
|
state.interact = null;
|
|
266
|
+
state.interactRuns.clear();
|
|
267
|
+
state.coverage = readUiCoverage(cwdOf(ctx, actor));
|
|
241
268
|
state.lastEditAt = Date.now();
|
|
242
269
|
state.reminders = 0;
|
|
243
270
|
state.paths.add(file);
|
|
@@ -272,6 +299,11 @@ export function createUiGate(ctx) {
|
|
|
272
299
|
if (!parsed) return;
|
|
273
300
|
state.interactAt = Date.now();
|
|
274
301
|
state.interact = parsed;
|
|
302
|
+
if (parsed.pass === true) {
|
|
303
|
+
const steps = exec?.arguments?.steps ?? exec?.args?.steps ?? exec?.input?.steps ?? [];
|
|
304
|
+
const digest = crypto.createHash("sha1").update(JSON.stringify(steps)).digest("hex").slice(0, 12);
|
|
305
|
+
state.interactRuns.add(digest);
|
|
306
|
+
}
|
|
275
307
|
}
|
|
276
308
|
|
|
277
309
|
/** What still blocks the turn, in the order the model should fix it. */
|
|
@@ -284,6 +316,7 @@ export function createUiGate(ctx) {
|
|
|
284
316
|
else if (Number(state.a11y?.serious ?? 0) > 0) missing.push("a11y-issues");
|
|
285
317
|
if (!state.interactAt || state.interactAt < state.lastEditAt) missing.push("interact-missing");
|
|
286
318
|
else if (state.interact && state.interact.pass !== true) missing.push("interact-fail");
|
|
319
|
+
else if ((state.coverage?.length ?? 0) > 0 && (state.interactRuns?.size ?? 0) < state.coverage.length) missing.push("interact-coverage");
|
|
287
320
|
return missing;
|
|
288
321
|
}
|
|
289
322
|
|
|
@@ -314,6 +347,9 @@ export function createUiGate(ctx) {
|
|
|
314
347
|
if (missing.includes("interact-fail")) {
|
|
315
348
|
lines.push("Сценарий browser_qa action=interact упал: элемент перекрыт, невидим или не прошло ожидание. Почини и прогони сценарий заново.");
|
|
316
349
|
}
|
|
350
|
+
if (missing.includes("interact-coverage")) {
|
|
351
|
+
lines.push(`Нужно покрытие критических сценариев (${(state.coverage ?? []).join(", ")}): сейчас пройдено ${state.interactRuns?.size ?? 0}/${state.coverage?.length ?? 0}. Прогони отдельный interact для каждого сценария из .dsh/quality/ui.json.`);
|
|
352
|
+
}
|
|
317
353
|
lines.push("</ui-gate>");
|
|
318
354
|
return lines.join("\n");
|
|
319
355
|
}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* `<DSH_HOME>/guardrails.json`.
|
|
19
19
|
*/
|
|
20
20
|
import fs from "node:fs";
|
|
21
|
+
import os from "node:os";
|
|
21
22
|
import path from "node:path";
|
|
22
23
|
|
|
23
24
|
import { createGuard, createHookState, registerHooks } from "./lib/hooks.js";
|
|
@@ -339,7 +340,8 @@ export function apply(ctx) {
|
|
|
339
340
|
const env = process.env;
|
|
340
341
|
const logger = ctx?.logger;
|
|
341
342
|
const hookState = createHookState();
|
|
342
|
-
const
|
|
343
|
+
const runtimeFile = path.join(env.DSH_HOME || path.join(os.homedir(), ".dsh"), "agent-extensions", "runtime.json");
|
|
344
|
+
const runtime = createRuntimeState({ persistPath: runtimeFile });
|
|
343
345
|
const guard = createGuard({ env, logger, runtime, modeFor: (agent) => resolveMode(ctx, agent) });
|
|
344
346
|
try {
|
|
345
347
|
registerHooks(ctx, guard, hookState);
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* `/guardrails action=runtime`. Command text is never stored; only a hash.
|
|
8
8
|
*/
|
|
9
9
|
import crypto from "node:crypto";
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import path from "node:path";
|
|
10
12
|
|
|
11
13
|
const DESTRUCTIVE = /\b(?:rm\s+-rf|rmdir\s+\/s|rd\s+\/s|del\s+\/[sfq]|git\s+(?:reset\s+--hard|clean\s+-[a-z]*f|push\s+(?:--force|-f)|checkout\s+--\s+\.)|drop\s+(?:table|database|schema)|truncate\s+table|delete\s+from|format\s+[a-z]:|shutdown|Stop-Computer|Remove-Item\b[^\n]*-Recurse|migrate:fresh|migrate:refresh|db:wipe|pg_dropcluster)\b/iu;
|
|
12
14
|
const EXTERNAL = /\b(?:git\s+push|npm\s+publish|pnpm\s+publish|gh\s+release|gh\s+pr\s+(?:create|merge)|ssh\b|scp\b|remote_ops|curl\b[^\n]*(?:-X\s*(?:POST|PUT|DELETE)|--data)|Invoke-WebRequest\b[^\n]*-Method\s*(?:Post|Put|Delete)|wget\b[^\n]*--post)/iu;
|
|
@@ -74,12 +76,37 @@ export function classifyConsequence(exec, cwd = "") {
|
|
|
74
76
|
const MAX_DECISIONS = 80;
|
|
75
77
|
|
|
76
78
|
/**
|
|
77
|
-
* Bounded
|
|
79
|
+
* Bounded runtime. No command text, no secrets. When `persistPath` is set the
|
|
80
|
+
* snapshot survives a DSH restart, which makes `/guardrails runtime` useful for
|
|
81
|
+
* "what did I approve an hour ago" instead of only the current process.
|
|
78
82
|
*/
|
|
79
|
-
export function createRuntimeState({ limit = MAX_DECISIONS } = {}) {
|
|
83
|
+
export function createRuntimeState({ limit = MAX_DECISIONS, persistPath = "" } = {}) {
|
|
80
84
|
const decisions = [];
|
|
81
85
|
let asks = 0;
|
|
82
86
|
let denies = 0;
|
|
87
|
+
let loaded = false;
|
|
88
|
+
if (persistPath) {
|
|
89
|
+
try {
|
|
90
|
+
const raw = JSON.parse(fs.readFileSync(persistPath, "utf8"));
|
|
91
|
+
if (Array.isArray(raw?.decisions)) decisions.push(...raw.decisions.slice(-limit));
|
|
92
|
+
asks = Number(raw?.asks) || 0;
|
|
93
|
+
denies = Number(raw?.denies) || 0;
|
|
94
|
+
loaded = true;
|
|
95
|
+
} catch {
|
|
96
|
+
/* no previous runtime */
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function persist() {
|
|
100
|
+
if (!persistPath) return;
|
|
101
|
+
try {
|
|
102
|
+
fs.mkdirSync(path.dirname(persistPath), { recursive: true, mode: 0o700 });
|
|
103
|
+
const temporary = `${persistPath}.${process.pid}.tmp`;
|
|
104
|
+
fs.writeFileSync(temporary, `${JSON.stringify({ updatedAt: new Date().toISOString(), asks, denies, decisions }, null, 2)}\n`, { mode: 0o600 });
|
|
105
|
+
fs.renameSync(temporary, persistPath);
|
|
106
|
+
} catch {
|
|
107
|
+
/* diagnostics are best effort */
|
|
108
|
+
}
|
|
109
|
+
}
|
|
83
110
|
return {
|
|
84
111
|
record(exec, decision, { mode, rule } = {}) {
|
|
85
112
|
if (!decision || (decision.kind !== "ask" && decision.kind !== "deny")) return;
|
|
@@ -101,11 +128,14 @@ export function createRuntimeState({ limit = MAX_DECISIONS } = {}) {
|
|
|
101
128
|
if (decisions.length > limit) decisions.splice(0, decisions.length - limit);
|
|
102
129
|
if (decision.kind === "ask") asks += 1;
|
|
103
130
|
else denies += 1;
|
|
131
|
+
persist();
|
|
104
132
|
return item;
|
|
105
133
|
},
|
|
106
134
|
snapshot() {
|
|
107
135
|
return {
|
|
108
136
|
ok: true,
|
|
137
|
+
persisted: Boolean(persistPath),
|
|
138
|
+
loaded,
|
|
109
139
|
count: decisions.length,
|
|
110
140
|
asks,
|
|
111
141
|
denies,
|
|
@@ -117,6 +147,7 @@ export function createRuntimeState({ limit = MAX_DECISIONS } = {}) {
|
|
|
117
147
|
decisions.length = 0;
|
|
118
148
|
asks = 0;
|
|
119
149
|
denies = 0;
|
|
150
|
+
persist();
|
|
120
151
|
},
|
|
121
152
|
};
|
|
122
153
|
}
|
package/skills/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"kitVersion": "2.
|
|
4
|
-
"generatedAt": "2026-12-
|
|
3
|
+
"kitVersion": "2.34.1",
|
|
4
|
+
"generatedAt": "2026-12-02T12:17:32.780Z",
|
|
5
5
|
"skills": {
|
|
6
6
|
"a11y-audit": {
|
|
7
7
|
"hash": "707659a5cc1207b478bcf45012b06ba46ba88e795ef7e482799f415072fc47b2",
|
|
@@ -109,9 +109,9 @@
|
|
|
109
109
|
"bytes": 4257
|
|
110
110
|
},
|
|
111
111
|
"seo": {
|
|
112
|
-
"hash": "
|
|
112
|
+
"hash": "ed48ebc4c1278f857ff430f9a5ec55f638c2f9ba07cc406185cfb94be18ee80d",
|
|
113
113
|
"files": 29,
|
|
114
|
-
"bytes":
|
|
114
|
+
"bytes": 386169
|
|
115
115
|
},
|
|
116
116
|
"service-desk-conventions": {
|
|
117
117
|
"hash": "22ae6c29b7debb0154d183bc732795b67557aeaa0ac906d7b038134aea8ba39a",
|
|
@@ -174,9 +174,9 @@
|
|
|
174
174
|
"bytes": 14150
|
|
175
175
|
},
|
|
176
176
|
"wow-design": {
|
|
177
|
-
"hash": "
|
|
177
|
+
"hash": "81139f32fc759f438a36eb4c0212ed3ea17df9d8075e909580e12bc47a0848dd",
|
|
178
178
|
"files": 52,
|
|
179
|
-
"bytes":
|
|
179
|
+
"bytes": 913669
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
}
|
package/skills-baseline.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"requirements-and-planning": "16f3235a9dcdcd1858112806854ef03d76f77588b56434bbacab803bd204f005",
|
|
24
24
|
"research-first": "ea5e3684d20529fca65a233044e914ba5b7be56a3d93ce283d8632e87904c23e",
|
|
25
25
|
"security-review": "8665b2c469de8e83aca670021d5c335fa8c9b93b8dc6bb866759e6062b1abde4",
|
|
26
|
-
"seo": "
|
|
26
|
+
"seo": "ed48ebc4c1278f857ff430f9a5ec55f638c2f9ba07cc406185cfb94be18ee80d",
|
|
27
27
|
"service-desk-conventions": "22ae6c29b7debb0154d183bc732795b67557aeaa0ac906d7b038134aea8ba39a",
|
|
28
28
|
"service-desk-db-safety": "672c08d25e0a9262aeb0eec27b6daa2a619fade6ff3269bc2b9dc27e22c83d28",
|
|
29
29
|
"service-desk-release": "1bd0c03f772bf4b79ec4e887f5d0ebd564653bafd3d0d33d70f6c934afdcce47",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"web-build": "9e8aa571f28e6974f8ba25a5004ba983efedd7def9daa865a39c78cecd16d55c",
|
|
37
37
|
"web-quality": "9cffe064faac7ec5763d4644c52e28e7993adca633e0ad92bbd4a88c67ceee23",
|
|
38
38
|
"web-research": "9bf4d8ba6d2a0fc39c241cdd9f5fe54835af28872473aa617941589c526387c8",
|
|
39
|
-
"wow-design": "
|
|
39
|
+
"wow-design": "81139f32fc759f438a36eb4c0212ed3ea17df9d8075e909580e12bc47a0848dd"
|
|
40
40
|
},
|
|
41
41
|
"2.2.0": {
|
|
42
42
|
"code-review-checklist": "e665bf72cfbfb77948a3cd6df6ebced38777f9aff543d7b9c80b2ced8cccc662",
|