dsh-department 0.0.0-stage → 0.1.2
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/LICENSE +21 -0
- package/README.md +287 -2
- package/README.ru.md +287 -0
- package/assets/bgtiles.png +0 -0
- package/assets/carpet.png +0 -0
- package/assets/chair.png +0 -0
- package/assets/char-analyst-1.png +0 -0
- package/assets/char-analyst-2.png +0 -0
- package/assets/char-artist-1.png +0 -0
- package/assets/char-artist-2.png +0 -0
- package/assets/char-coder-1.png +0 -0
- package/assets/char-coder-2.png +0 -0
- package/assets/char-coder-3.png +0 -0
- package/assets/char-manager-1.png +0 -0
- package/assets/char-manager-2.png +0 -0
- package/assets/char-manager-3.png +0 -0
- package/assets/char-reviewer-1.png +0 -0
- package/assets/char-reviewer-2.png +0 -0
- package/assets/char-reviewer-3.png +0 -0
- package/assets/char-tester-1.png +0 -0
- package/assets/char-tester-2.png +0 -0
- package/assets/char-tester-3.png +0 -0
- package/assets/cubicles.png +0 -0
- package/assets/office-atlas.json +257 -0
- package/assets/office-atlas.png +0 -0
- package/assets/office-tilemap.png +0 -0
- package/client.js +2250 -0
- package/cordis.patch.yml +5 -0
- package/index.js +55 -0
- package/package.json +62 -3
- package/src/activity.js +170 -0
- package/src/attempts.js +95 -0
- package/src/blueprint.js +168 -0
- package/src/browse.js +74 -0
- package/src/commands.js +48 -0
- package/src/compose.js +45 -0
- package/src/documents.js +108 -0
- package/src/gates.js +52 -0
- package/src/git.js +183 -0
- package/src/gui.js +68 -0
- package/src/panel-api.js +278 -0
- package/src/pixelize.js +134 -0
- package/src/png.js +62 -0
- package/src/roles.js +169 -0
- package/src/routes.js +403 -0
- package/src/store.js +931 -0
- package/src/tools.js +1729 -0
- package/src/verify.js +121 -0
- package/src/watchdog.js +164 -0
- package/templates/release.md +44 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.2
|
|
4
|
+
- Исправлено: русские переводы новых ключей (в т.ч. имя офиса в сайдбаре — «ИИ-отдел»).
|
|
5
|
+
- Проверка паритета словарей ru/en (226/226).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## 0.1.1
|
|
9
|
+
- Полная локализация интерфейса ru/en: карточка задачи, вкладки, стадии, события,
|
|
10
|
+
аудит, документы, роли, бюджет, офис, схема проекта, графики, формы.
|
|
11
|
+
- Переключатель языка EN/RU в шапке доски, выбор сохраняется.
|
|
12
|
+
- `dept_start release=true` — шаблон подготовки к релизу.
|
|
13
|
+
- GitHub Actions CI, docs/PUBLISHING.md.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## 0.1.0
|
|
17
|
+
|
|
18
|
+
- Первый публичный релиз: доска задач, карточка задачи, офис, гейты, git, бюджет, роли.
|
|
19
|
+
- Корректировки, вопросы, служебные записки, аудит.
|
|
20
|
+
- Сторож входящих данных и антизалипание.
|
|
21
|
+
- Пауза (снимает только человек), мягкая остановка.
|
|
22
|
+
- Пиксельный офис с чиби-спрайтами (16 вариантов).
|
|
23
|
+
- Релиз как штатная фаза (`dept_start release=true`, `templates/release.md`).
|
|
24
|
+
- Мультиязычный интерфейс (ru/en) — начальный набор строк.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-department contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,288 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-department — AI development department for DeepSeek Harness
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** · [Русский](README.ru.md)
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
The plugin turns DeepSeek Harness into a **development department**: a task goes through
|
|
10
|
+
analysis → concept → specification → plan → stages, and inside each stage — implementation,
|
|
11
|
+
tests, independent review and a tagged commit. The human approves only the concept and the
|
|
12
|
+
specification; everything else the department decides itself under the autonomy policy.
|
|
13
|
+
|
|
14
|
+
## Screenshots
|
|
15
|
+
|
|
16
|
+
| Department panel (EN) | Office: working |
|
|
17
|
+
|---|---|
|
|
18
|
+
|  |  |
|
|
19
|
+
|
|
20
|
+
| Paused: everyone in the lounge | 16 characters |
|
|
21
|
+
|---|---|
|
|
22
|
+
|  |  |
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- **Task board** across projects: stage, progress, gates, last event.
|
|
27
|
+
- **Task card** with tabs: overview, documents, questions, audit, events, corrections,
|
|
28
|
+
roles, budget, git; approval buttons, answers, amendments.
|
|
29
|
+
- **Department office**: who is working, at which desk, what they do; click — project,
|
|
30
|
+
task, files and action history.
|
|
31
|
+
- **Project blueprint**: files and import edges grouped by folders, drill-down to a file.
|
|
32
|
+
- **Budget**: token usage per session, cost by price per 1M, task limit.
|
|
33
|
+
- **Reporting**: `dept_report` — stage, gates, who is busy, open questions.
|
|
34
|
+
- **Questions to the human** (`dept_ask` / `dept_answer`) — the department does not stop.
|
|
35
|
+
- **Spec amendments** (`dept_amend`): human-signed or autonomous (with a limit).
|
|
36
|
+
- **Retries** by the loop data → analysis → plan → changes → tests; retry without analysis
|
|
37
|
+
is blocked; a repeated failure moves the stage to `blocked`.
|
|
38
|
+
- **Git**: stage commit, tag, push branch and tags; commit is blocked without fresh gates.
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
The plugin is installed into a DSH profile as a local (`link:`) package or from the registry:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
dsh plugin add link:/path/to/dsh-department
|
|
46
|
+
# or from npm:
|
|
47
|
+
dsh plugin add dsh-department
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then enable the `dsh-department` bundle in the plugin manager and reload the tab.
|
|
51
|
+
The sidebar shows “Department”, the main window shows the board, office and blueprint.
|
|
52
|
+
|
|
53
|
+
## Model tools
|
|
54
|
+
|
|
55
|
+
| Tool | Purpose |
|
|
56
|
+
|---|---|
|
|
57
|
+
| `dept_start` | create a task: state, branch, task.md |
|
|
58
|
+
| `dept_status` | task state and summary |
|
|
59
|
+
| `dept_stage` | stage transition (except approvals) |
|
|
60
|
+
| `dept_approve` | human approval of concept/spec |
|
|
61
|
+
| `dept_gate` | tests gate (exit code) or review gate (PASS/FAIL) |
|
|
62
|
+
| `dept_verify` | audit: state ↔ artifacts ↔ git |
|
|
63
|
+
| `dept_commit` | stage commit, tag, push |
|
|
64
|
+
| `dept_amend` | document amendment (human-signed or `autonomous`) |
|
|
65
|
+
| `dept_ask` | question to the human without stopping work |
|
|
66
|
+
| `dept_answer` | human answer to a question |
|
|
67
|
+
| `dept_report` | department status report |
|
|
68
|
+
| `dept_health` | “is the department alive”: working / idle / waiting for human / ready to commit |
|
|
69
|
+
| `dept_modules` | module plan and file ownership for parallel work |
|
|
70
|
+
| `dept_art` | draw a pixel sprite and save a PNG |
|
|
71
|
+
| `dept_pixelize` | PNG/JPEG → pixel grid + palette + sprite (for redrawing from a reference) |
|
|
72
|
+
| `dept_compose` | compose a large PNG from small sprites (canvas, background, layers) |
|
|
73
|
+
| `dept_roles` | roles and models (researcher, designer, artist, senior-coder, supervisor, beta-tester, ...) |
|
|
74
|
+
| `dept_bug` | beta-tester bug report (steps, expected/actual, severity) |
|
|
75
|
+
| `dept_browse` | browser: open localhost/file, clicks, typing, screenshot into evidence |
|
|
76
|
+
| `dept_gui` | native app: command, env, timeout, output, screenshot via hook/command |
|
|
77
|
+
|
|
78
|
+
## HTTP API
|
|
79
|
+
|
|
80
|
+
| Route | Method | Purpose |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| `/api/department/tasks` | GET | tasks across projects |
|
|
83
|
+
| `/api/department/task?root=&taskId=` | GET | task card |
|
|
84
|
+
| `/api/department/activity` | GET | live agent activity |
|
|
85
|
+
| `/api/department/approve` | POST | approve a document |
|
|
86
|
+
| `/api/department/answer` | POST | answer a question |
|
|
87
|
+
| `/api/department/amend` | POST | sign an amendment |
|
|
88
|
+
| `/api/department/budget?root=&taskId=` | GET/POST | budget and prices |
|
|
89
|
+
| `/api/department/blueprint?root=` | GET | project blueprint |
|
|
90
|
+
| `/api/department/asset?name=` | GET | office assets |
|
|
91
|
+
|
|
92
|
+
## Process rules
|
|
93
|
+
|
|
94
|
+
1. Stages: `analysis → concept → concept_review → spec → spec_review → executing → done`.
|
|
95
|
+
2. Approvals are human-only (`dept_approve`); the stage moves only through them.
|
|
96
|
+
3. Each stage is closed by a commit tagged `stage-N`; the tag is pushed with the branch.
|
|
97
|
+
4. Gates reset after a commit: a previous stage's pass does not carry over.
|
|
98
|
+
5. A test failure writes `stages/NN/failure.md`; retry is forbidden until “Analysis” and
|
|
99
|
+
“Plan” are filled in.
|
|
100
|
+
6. Autonomous amendments — at most 5 per task, then escalate to the human.
|
|
101
|
+
|
|
102
|
+
## Working together on concept and spec
|
|
103
|
+
|
|
104
|
+
- Each specialist writes their section via `dept_section` (designer — style, artist — what
|
|
105
|
+
to draw, researcher — data and statistics, tester — verification strategy, architect —
|
|
106
|
+
decisions, analyst — requirements).
|
|
107
|
+
- The architect frames contested decisions as ideas (`dept_ideas`): 2–3 options.
|
|
108
|
+
- Specialists review ideas (`dept_critique`): `approve`/`reject` and severity. A hard reject
|
|
109
|
+
(`high`) kills the idea; two approvals without hard criticism accept it. A rejected idea is
|
|
110
|
+
not taken into work — the architect proposes a new one.
|
|
111
|
+
- The researcher can collect statistics and facts on the internet.
|
|
112
|
+
|
|
113
|
+
## Autonomy (goal instead of a timer)
|
|
114
|
+
|
|
115
|
+
- The manager creates a goal: “bring the task to done by plan.md” and does not close it until
|
|
116
|
+
the end. DSH drives the rounds itself — no timer needed.
|
|
117
|
+
- Each round: `dept_health` → if `stalled`, find the cause and call a specialist:
|
|
118
|
+
data — researcher, visuals — designer, images — artist, conflict — supervisor,
|
|
119
|
+
architecture — architect, integration fixes — senior-coder.
|
|
120
|
+
- `waiting_human` does not stop the work: the team decides, the memo waits for the human.
|
|
121
|
+
- Protection from empty rounds: if 2–3 rounds bring no new events — record `blocked` and a
|
|
122
|
+
memo instead of spinning.
|
|
123
|
+
- When a task is done — move to the next one; when all are closed — a party (office banner).
|
|
124
|
+
|
|
125
|
+
## Autonomy
|
|
126
|
+
|
|
127
|
+
- The manager calls `dept_health` after every step and does not stop:
|
|
128
|
+
`stalled` → next plan step, `waiting_human` → decides tactically itself,
|
|
129
|
+
`ready_to_commit` → verify and commit.
|
|
130
|
+
- For long tasks a goal is created so rounds run without human involvement.
|
|
131
|
+
- `supervisor` analyses stagnation and decides as a customer would.
|
|
132
|
+
- `researcher` searches the web, `designer` picks visuals, `artist` draws via `dept_art`.
|
|
133
|
+
- Parallel work: `dept_modules` assigns files to modules, coders do not overlap,
|
|
134
|
+
`senior-coder` assembles and assigns follow-ups.
|
|
135
|
+
|
|
136
|
+
## Testing
|
|
137
|
+
|
|
138
|
+
- **Tester** — automated checks: tests, invariants, exit code. This is the stage gate.
|
|
139
|
+
- **Beta-tester** — plays/works as a user: walks scenarios, catches confusing places,
|
|
140
|
+
broken flows, visual bugs; files a bug report via `dept_bug` (steps, expected/actual,
|
|
141
|
+
severity, evidence). For games/UI it uses `dept_browse`: opens the page, clicks, types and
|
|
142
|
+
attaches a screenshot to the report.
|
|
143
|
+
- Before a release the manager runs a beta test and triages bugs: critical — into work,
|
|
144
|
+
the rest — into the backlog.
|
|
145
|
+
|
|
146
|
+
### Native applications (C++/Qt)
|
|
147
|
+
|
|
148
|
+
- `dept_gui` runs a program with arguments/env and a timeout, captures the output.
|
|
149
|
+
- Screenshot: either the app saves a frame itself by flag (`--screenshot file.png`,
|
|
150
|
+
`QWidget::grab()` / `QQuickWindow::grabWindow()`), or an external command
|
|
151
|
+
(`import -window root shot.png` under Xvfb).
|
|
152
|
+
- Recommended for Qt: a test hook `--scenario`/`--selftest` that walks a scenario and saves
|
|
153
|
+
screenshots; then the beta test is deterministic and works in CI.
|
|
154
|
+
- Interactive GUI automation (mouse clicks) needs Xvfb/xdotool; the current environment does
|
|
155
|
+
not have them, so the bet is on application hooks and Qt Test.
|
|
156
|
+
|
|
157
|
+
## Release preparation (a standard phase)
|
|
158
|
+
|
|
159
|
+
The office does not only build the product but also ships it. A release is not a one-off
|
|
160
|
+
request but a phase after `done`:
|
|
161
|
+
|
|
162
|
+
- `dept_start release=true` — the task brief gets the `templates/release.md` template
|
|
163
|
+
(package, user documentation, QA checklist, changelog, version, tag, handover);
|
|
164
|
+
- artifact: `release/<product>-<version>/` + `.zip`;
|
|
165
|
+
- documentation: `README.md` (run, controls), `MANUAL-QA.md` (manual testing),
|
|
166
|
+
`CHANGELOG.md`, known limitations;
|
|
167
|
+
- verification: project tests, `dept_verify`, beta test by the checklist (`dept_bug`);
|
|
168
|
+
- commit: `dept_commit` with tag `v<version>`, tag pushed to remote;
|
|
169
|
+
- report: where to get it, how to run, what to check by hand.
|
|
170
|
+
|
|
171
|
+
Release acceptance criterion: the human takes the artifact and runs it without hints; the
|
|
172
|
+
documentation answers “how to run”, “what it can do”, “what is limited”.
|
|
173
|
+
|
|
174
|
+
## Document library and event log
|
|
175
|
+
|
|
176
|
+
- The “Documents” tab is like mail: on the left a list of documents (search by title, filter
|
|
177
|
+
by type, sort by date), on the right the content.
|
|
178
|
+
- Types: memo, stage report, review, bug report, specialist section, rework plan, spec,
|
|
179
|
+
concept, plan, backlog.
|
|
180
|
+
- The “Events” tab — list on the left, details of the selected event on the right.
|
|
181
|
+
- Markdown in documents is rendered as markup: headings, lists, tables, inline code and code
|
|
182
|
+
blocks with highlighting (JS/TS/C++/Python keywords).
|
|
183
|
+
- Memos waiting for a decision are marked “REQUIRES DECISION” and raised to the top of the
|
|
184
|
+
list; the board shows a “✍ N” badge on the task, the office shows a yellow marker above the
|
|
185
|
+
manager, the card header shows the memo count.
|
|
186
|
+
|
|
187
|
+
## Goals
|
|
188
|
+
|
|
189
|
+
- Before `update_goal` always call `get_goal` and use the current revision.
|
|
190
|
+
- A `stale goal ref` error means the revision has already changed: re-read `get_goal` and
|
|
191
|
+
retry once with the new revision — do not guess.
|
|
192
|
+
- Pausing the department does not pause the goal: the goal lives separately (that is DSH).
|
|
193
|
+
|
|
194
|
+
## Pause and resume
|
|
195
|
+
|
|
196
|
+
- `dept_pause` (or the button in the card) — the task is paused: gates, commit and amendments
|
|
197
|
+
are blocked, no tokens are spent, the state stays on disk.
|
|
198
|
+
- The watchdog does not wake a paused task.
|
|
199
|
+
- `paused=false` (human signature) — work continues from the same place, including after a
|
|
200
|
+
server shutdown/startup.
|
|
201
|
+
- The office shows the pause: a “department paused” banner and the manager sits in the lounge.
|
|
202
|
+
|
|
203
|
+
## Multilingual UI
|
|
204
|
+
|
|
205
|
+
The panel interface is **Russian and English**:
|
|
206
|
+
|
|
207
|
+
- an **EN/RU** button in the board header; the choice is remembered (`localStorage['dept-lang']`);
|
|
208
|
+
- by default — the browser language, falling back to Russian;
|
|
209
|
+
- translated: navigation, task card, tabs, stages, events, audit, document types, roles,
|
|
210
|
+
budget, office, project blueprint, charts.
|
|
211
|
+
- **Document content** is written by agents in the task language — it is not UI strings; the
|
|
212
|
+
documentation language is set in the brief (`lang` in task.md) or in the prompt.
|
|
213
|
+
|
|
214
|
+
Dictionary: `LOCALES` in `client.js` (ru/en), `dot.case` keys, `{n}` interpolation.
|
|
215
|
+
Roadmap — `docs/I18N.md`.
|
|
216
|
+
|
|
217
|
+
## Incoming-data watchdog
|
|
218
|
+
|
|
219
|
+
- Every 5 minutes the plugin checks department tasks: new corrections (`new`), answers to
|
|
220
|
+
questions (`answered`), remarks on memos (`changes_requested`).
|
|
221
|
+
- If new data appears, it collects a package and wakes the manager (`followup`), once per new
|
|
222
|
+
item; it does not resend the same thing.
|
|
223
|
+
- If the manager is busy, the watchdog waits for the next check.
|
|
224
|
+
- **Anti-stall**: if the task is active (not paused/done/blocked), the agent is idle, and the
|
|
225
|
+
last event is older than 15 minutes — the watchdog wakes the manager with a hint
|
|
226
|
+
(dept_verify/commit or the next step). At most once per 30 minutes per task.
|
|
227
|
+
|
|
228
|
+
## Corrections
|
|
229
|
+
|
|
230
|
+
- The “Corrections” tab is a letter to the manager: what it relates to (concept/spec/plan/
|
|
231
|
+
code/data/interface), subject and text. It is stored in the correction history.
|
|
232
|
+
- `dept_correction` — the manager sees the list, takes it into work (`in_progress`), gathers
|
|
233
|
+
specialists for analysis and closes it (`done`) with a summary.
|
|
234
|
+
- Corrections are used to update the concept, spec and plan (`dept_amend`, `dept_section`).
|
|
235
|
+
|
|
236
|
+
## Questions and memos
|
|
237
|
+
|
|
238
|
+
A question to the human does not stop the work:
|
|
239
|
+
|
|
240
|
+
1. `dept_ask` — the question is recorded, the department continues.
|
|
241
|
+
2. `dept_propose` — the supervisor proposes solution options.
|
|
242
|
+
3. `dept_critique` — specialists critique; the accepted decision is recorded.
|
|
243
|
+
4. `dept_memo` — a memo: question, options, criticism, team decision
|
|
244
|
+
(file `docs/department/<task>/memos/<question>.md`).
|
|
245
|
+
5. `dept_review` — the human approves (`approve`) or writes remarks (`changes`).
|
|
246
|
+
6. `dept_rework` — the architect prepares a rework plan from the remarks
|
|
247
|
+
(`docs/department/<task>/rework/<question>.md`).
|
|
248
|
+
|
|
249
|
+
## Multi-project
|
|
250
|
+
|
|
251
|
+
- The “Projects” tab — aggregates by root: tasks, stages, budget, last event.
|
|
252
|
+
- Each root is a separate department: tasks are created via `dept_start root=...`, the board
|
|
253
|
+
shows all projects, filtering by project.
|
|
254
|
+
- For parallel work inside a project: `dept_modules` (file ownership) + `dept_worktree`
|
|
255
|
+
(isolated directories per module), merging — senior-coder.
|
|
256
|
+
- The limit of concurrent coders is the role's `maxInstances`.
|
|
257
|
+
|
|
258
|
+
## Artist and references
|
|
259
|
+
|
|
260
|
+
- `dept_art` draws on a character grid: input — `rows` (character = pixel) and `palette`
|
|
261
|
+
(character → #rrggbb), output — PNG (RGBA), scale 1–16.
|
|
262
|
+
- `dept_pixelize` takes PNG/JPEG/WebP, downsizes to a grid (4–96), quantizes to a palette
|
|
263
|
+
(2–64 colors or a given one), saves a PNG and returns `rows` + `palette` — the artist edits
|
|
264
|
+
pixels by hand to get a similar but own sprite.
|
|
265
|
+
- A reference is for style (palette, proportions), not for copying someone else's graphics.
|
|
266
|
+
|
|
267
|
+
### The artist works slowly
|
|
268
|
+
|
|
269
|
+
- Speed is not a criterion: quality matters more. The artist draws in parts:
|
|
270
|
+
reference/palette → base shapes → details → check → composition.
|
|
271
|
+
- Each step is a separate checkpoint file (`assets/...png`) that can be reviewed.
|
|
272
|
+
- A large picture is not drawn in one piece: small sprites + `dept_compose`.
|
|
273
|
+
- Role: `reasoning: high`, up to 6 attempts; the manager splits the task into elements
|
|
274
|
+
instead of telling the artist “draw everything”.
|
|
275
|
+
|
|
276
|
+
## Limitations
|
|
277
|
+
|
|
278
|
+
- The office and the blueprint are visualizations of session data; the art is simple.
|
|
279
|
+
- The blueprint builds only static imports (JS/TS/C/C++/Python).
|
|
280
|
+
- Each role has a limit of concurrent instances (`maxInstances`), the coder defaults to 2:
|
|
281
|
+
the manager cannot run more coders than allowed.
|
|
282
|
+
- Roles can be enabled/disabled (except manager/coder/tester); `beta-tester` is disabled by
|
|
283
|
+
default — launching apps and screenshot streams is resource-heavy.
|
|
284
|
+
- The budget counts the usage reported by model adapters; prices are set manually.
|
|
285
|
+
|
|
286
|
+
## License
|
|
287
|
+
|
|
288
|
+
MIT. Office assets (`assets/`) are original and/or CC0; third-party packs are not included.
|
package/README.ru.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# dsh-department — ИИ-отдел разработки для DeepSeek Harness
|
|
2
|
+
|
|
3
|
+
[English](README.md) · **Русский**
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
Плагин превращает DeepSeek Harness в **отдел разработки**: задача проходит анализ →
|
|
10
|
+
концепцию → ТЗ → план → этапы, а внутри этапа — реализацию, тесты, независимое ревью и
|
|
11
|
+
коммит с тегом. Человек утверждает только концепцию и ТЗ, остальное отдел решает сам
|
|
12
|
+
по политике автономии.
|
|
13
|
+
|
|
14
|
+
## Скриншоты
|
|
15
|
+
|
|
16
|
+
| Панель отдела (EN) | Офис: работа |
|
|
17
|
+
|---|---|
|
|
18
|
+
|  |  |
|
|
19
|
+
|
|
20
|
+
| Пауза: все в комнате отдыха | 16 персонажей |
|
|
21
|
+
|---|---|
|
|
22
|
+
|  |  |
|
|
23
|
+
|
|
24
|
+
## Возможности
|
|
25
|
+
|
|
26
|
+
- **Доска задач** по всем проектам: стадия, прогресс, гейты, последнее событие.
|
|
27
|
+
- **Карточка задачи** на вкладках: обзор, документы, вопросы, аудит, события, git;
|
|
28
|
+
кнопки утверждения, ответы на вопросы, поправки к ТЗ.
|
|
29
|
+
- **Офис отдела**: кто работает, за каким столом, что делает; клик — проект, задача,
|
|
30
|
+
файлы и история действий.
|
|
31
|
+
- **Схема проекта**: файлы и связи импортов по группам (папкам), drill-down до файла.
|
|
32
|
+
- **Бюджет**: расход токенов по сессиям, стоимость по ценам за 1M, лимит задачи.
|
|
33
|
+
- **Отчётность**: `dept_report` — этап, гейты, кто чем занят, открытые вопросы.
|
|
34
|
+
- **Вопросы к человеку** (`dept_ask` / `dept_answer`) — отдел не останавливается.
|
|
35
|
+
- **Поправки ТЗ** (`dept_amend`): с подписью человека или автономно (с лимитом).
|
|
36
|
+
- **Повторы по циклу** «данные → анализ → план → изменения → тесты»; повтор без анализа
|
|
37
|
+
блокируется, повторяющийся провал переводит этап в `blocked`.
|
|
38
|
+
- **Git**: коммит этапа, тег, push ветки и тегов; коммит заблокирован без свежих гейтов.
|
|
39
|
+
|
|
40
|
+
## Установка
|
|
41
|
+
|
|
42
|
+
Плагин ставится в профиль DSH как локальный (`link:`) или из репозитория:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
dsh plugin add link:/path/to/dsh-department
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Затем включите bundle `dsh-department` в менеджере плагинов и перезагрузите вкладку.
|
|
49
|
+
В сайдбаре появится «ИИ-отдел», в основном окне — доска, офис и схема.
|
|
50
|
+
|
|
51
|
+
## Инструменты модели
|
|
52
|
+
|
|
53
|
+
| Инструмент | Назначение |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `dept_start` | создать задачу: состояние, ветка, task.md |
|
|
56
|
+
| `dept_status` | состояние задачи и сводка |
|
|
57
|
+
| `dept_stage` | переход стадии (кроме утверждений) |
|
|
58
|
+
| `dept_approve` | утверждение концепции/ТЗ человеком |
|
|
59
|
+
| `dept_gate` | гейт тестов (exit code) или ревью (PASS/FAIL) |
|
|
60
|
+
| `dept_verify` | аудит: состояние ↔ артефакты ↔ git |
|
|
61
|
+
| `dept_commit` | коммит этапа, тег, push |
|
|
62
|
+
| `dept_amend` | поправка к документу (подпись человека или `autonomous`) |
|
|
63
|
+
| `dept_ask` | вопрос человеку без остановки работы |
|
|
64
|
+
| `dept_answer` | ответ человека на вопрос |
|
|
65
|
+
| `dept_report` | отчёт о состоянии отдела |
|
|
66
|
+
| `dept_health` | «жив ли отдел»: работает / стоит / ждёт человека / готов к коммиту |
|
|
67
|
+
| `dept_modules` | план модулей и владение файлами для параллельной работы |
|
|
68
|
+
| `dept_art` | нарисовать пиксельный спрайт и сохранить PNG |
|
|
69
|
+
| `dept_pixelize` | PNG/JPEG → пиксельная сетка + палитра + спрайт (для перерисовки по референсу) |
|
|
70
|
+
| `dept_compose` | собрать большое PNG из маленьких спрайтов (холст, фон, слои) |
|
|
71
|
+
| `dept_roles` | роли и модели (researcher, designer, artist, senior-coder, supervisor, beta-tester, ...) |
|
|
72
|
+
| `dept_bug` | баг-репорт бета-тестера (шаги, ожидаемое/фактическое, критичность) |
|
|
73
|
+
| `dept_browse` | браузер: открыть localhost/file, клики, ввод, скриншот в evidence |
|
|
74
|
+
| `dept_gui` | нативная программа: команда, env, таймаут, вывод, скриншот через хук/команду |
|
|
75
|
+
|
|
76
|
+
## HTTP API
|
|
77
|
+
|
|
78
|
+
| Маршрут | Метод | Назначение |
|
|
79
|
+
|---|---|---|
|
|
80
|
+
| `/api/department/tasks` | GET | задачи по проектам |
|
|
81
|
+
| `/api/department/task?root=&taskId=` | GET | карточка задачи |
|
|
82
|
+
| `/api/department/activity` | GET | живая активность агентов |
|
|
83
|
+
| `/api/department/approve` | POST | утвердить документ |
|
|
84
|
+
| `/api/department/answer` | POST | ответить на вопрос |
|
|
85
|
+
| `/api/department/amend` | POST | подписать поправку |
|
|
86
|
+
| `/api/department/budget?root=&taskId=` | GET/POST | бюджет и цены |
|
|
87
|
+
| `/api/department/blueprint?root=` | GET | схема проекта |
|
|
88
|
+
| `/api/department/asset?name=` | GET | ассеты офиса |
|
|
89
|
+
|
|
90
|
+
## Правила процесса
|
|
91
|
+
|
|
92
|
+
1. Этапы: `analysis → concept → concept_review → spec → spec_review → executing → done`.
|
|
93
|
+
2. Утверждения — только человеком (`dept_approve`), стадия двигается только через них.
|
|
94
|
+
3. Каждый этап закрывается коммитом с тегом `stage-N`; тег пушится вместе с веткой.
|
|
95
|
+
4. Гейты сбрасываются после коммита: pass предыдущего этапа не переезжает.
|
|
96
|
+
5. Провал тестов пишет `stages/NN/failure.md`; повтор запрещён, пока не заполнены
|
|
97
|
+
«Анализ» и «План».
|
|
98
|
+
6. Автономные поправки — не более 5 на задачу, дальше эскалация человеку.
|
|
99
|
+
|
|
100
|
+
## Совместная работа над концепцией и ТЗ
|
|
101
|
+
|
|
102
|
+
- Каждый специалист пишет свой раздел через `dept_section` (дизайнер — стиль,
|
|
103
|
+
художник — что рисуем, исследователь — данные и статистика, тестер — стратегия
|
|
104
|
+
проверки, архитектор — решения, аналитик — требования).
|
|
105
|
+
- Спорные решения архитектор оформляет как идеи (`dept_ideas`): 2–3 варианта.
|
|
106
|
+
- Специалисты рецензируют идеи (`dept_critique`): `approve`/`reject` и severity.
|
|
107
|
+
Жёсткое отклонение (`high`) убивает идею; два одобрения без жёсткой критики
|
|
108
|
+
принимают её. Отклонённую идею в работу не берут — архитектор предлагает новую.
|
|
109
|
+
- Исследователь может собирать статистику и факты в интернете.
|
|
110
|
+
|
|
111
|
+
## Автономность (цель вместо таймера)
|
|
112
|
+
|
|
113
|
+
- Руководитель создаёт цель: «довести задачу до done по plan.md» и не закрывает её
|
|
114
|
+
до конца. DSH сам гоняет раунды — таймер не нужен.
|
|
115
|
+
- Каждый раунд: `dept_health` → если `stalled`, найти причину и позвать специалиста:
|
|
116
|
+
данные — researcher, визуал — designer, картинки — artist, конфликт — supervisor,
|
|
117
|
+
архитектура — architect, сборочные правки — senior-coder.
|
|
118
|
+
- `waiting_human` не останавливает: решение принимает команда, записка ждёт человека.
|
|
119
|
+
- Защита от пустых раундов: если 2–3 раунда нет новых событий — зафиксировать
|
|
120
|
+
`blocked` и служебную записку, а не крутиться.
|
|
121
|
+
- Когда задача done — перейти к следующей; когда закрыты все — вечеринка (баннер в офисе).
|
|
122
|
+
|
|
123
|
+
## Автономность
|
|
124
|
+
|
|
125
|
+
- Руководитель вызывает `dept_health` после каждого шага и не останавливается:
|
|
126
|
+
`stalled` → следующий шаг плана, `waiting_human` → решает тактически сам,
|
|
127
|
+
`ready_to_commit` → проверка и коммит.
|
|
128
|
+
- Для длинных задач создаётся цель (goal), чтобы раунды шли без участия человека.
|
|
129
|
+
- `supervisor` анализирует застой и решает так, как решил бы заказчик.
|
|
130
|
+
- `researcher` ищет в интернете, `designer` подбирает визуал, `artist` рисует через `dept_art`.
|
|
131
|
+
- Параллельная работа: `dept_modules` раздаёт файлы модулям, кодеры не пересекаются,
|
|
132
|
+
`senior-coder` собирает и назначает доработки.
|
|
133
|
+
|
|
134
|
+
## Тестирование
|
|
135
|
+
|
|
136
|
+
- **Тестер** — автоматические проверки: тесты, инварианты, exit code. Это гейт этапа.
|
|
137
|
+
- **Бета-тестер** — играет/работает как пользователь: проходит сценарии, ловит
|
|
138
|
+
непонятные места, сломанные потоки, визуальные баги; пишет баг-репорт через
|
|
139
|
+
`dept_bug` (шаги, ожидаемое/фактическое, критичность, доказательство).
|
|
140
|
+
Для игры/интерфейса использует `dept_browse`: открывает страницу, кликает,
|
|
141
|
+
вводит и прикладывает скриншот к багрепорту.
|
|
142
|
+
- Перед релизом руководитель запускает бета-тест и разбирает баги: критичные —
|
|
143
|
+
в работу, остальные — в backlog.
|
|
144
|
+
|
|
145
|
+
### Нативные приложения (C++/Qt)
|
|
146
|
+
|
|
147
|
+
- `dept_gui` запускает программу с аргументами/env и таймаутом, перехватывает вывод.
|
|
148
|
+
- Скриншот: либо приложение само сохраняет кадр по флагу (`--screenshot file.png`,
|
|
149
|
+
`QWidget::grab()` / `QQuickWindow::grabWindow()`), либо внешняя команда
|
|
150
|
+
(`import -window root shot.png` под Xvfb).
|
|
151
|
+
- Рекомендуемый путь для Qt: тестовый хук `--scenario`/`--selftest`, который проходит
|
|
152
|
+
сценарий и сохраняет скриншоты; тогда бета-тест детерминирован и работает в CI.
|
|
153
|
+
- Интерактивная GUI-автоматизация (клики мышью) требует Xvfb/xdotool; в текущем
|
|
154
|
+
окружении их нет, поэтому ставка на хуки приложения и Qt Test.
|
|
155
|
+
|
|
156
|
+
## Подготовка к релизу (штатная фаза)
|
|
157
|
+
|
|
158
|
+
Офис делает не только продукт, но и его выпуск. Релиз — не разовая просьба, а фаза после `done`:
|
|
159
|
+
|
|
160
|
+
- `dept_start release=true` — бриф задачи получает шаблон `templates/release.md`
|
|
161
|
+
(пакет, документация пользователя, QA-чек-лист, changelog, версия, тег, передача);
|
|
162
|
+
- артефакт: `release/<продукт>-<версия>/` + архив `.zip`;
|
|
163
|
+
- документация: `README.md` (запуск, управление), `MANUAL-QA.md` (ручное тестирование),
|
|
164
|
+
`CHANGELOG.md`, известные ограничения;
|
|
165
|
+
- проверка: тесты проекта, `dept_verify`, бета-тест по чек-листу (`dept_bug`);
|
|
166
|
+
- фиксация: `dept_commit` с тегом `v<версия>`, тег в remote;
|
|
167
|
+
- отчёт: где забрать, как запустить, что проверять руками.
|
|
168
|
+
|
|
169
|
+
Критерий приёмки релиза: человек забирает артефакт и запускает без подсказок;
|
|
170
|
+
документация отвечает на «как запустить», «что умеет», «что ограничено».
|
|
171
|
+
|
|
172
|
+
## Библиотека документов и журнал событий
|
|
173
|
+
|
|
174
|
+
- Вкладка «Документы» — как почта: слева список документов (поиск по названию,
|
|
175
|
+
фильтр по типу, сортировка по дате), справа содержимое.
|
|
176
|
+
- Типы: служебная записка, отчёт этапа, ревью, баг-репорт, раздел специалиста,
|
|
177
|
+
план переработки, ТЗ, концепция, план, бэклог.
|
|
178
|
+
- Вкладка «События» — список слева, подробности выбранного события справа.
|
|
179
|
+
- Markdown в документах отображается как разметка: заголовки, списки, таблицы,
|
|
180
|
+
inline-код и блоки кода с подсветкой (JS/TS/C++/Python-ключевые слова).
|
|
181
|
+
- Служебные записки, ждущие решения, помечены «ТРЕБУЕТ РЕШЕНИЯ» и подняты наверх
|
|
182
|
+
списка; на доске у задачи бейдж «✍ N», в офисе — жёлтый маркер над руководителем,
|
|
183
|
+
в шапке карточки — счётчик записок.
|
|
184
|
+
|
|
185
|
+
## Цели (goal)
|
|
186
|
+
|
|
187
|
+
- Перед `update_goal` всегда вызывай `get_goal` и используй актуальную ревизию.
|
|
188
|
+
- Ошибка `stale goal ref` значит, что ревизия уже сменилась: перечитай `get_goal`
|
|
189
|
+
и повтори один раз с новой ревизией — не угадывай.
|
|
190
|
+
- Пауза отдела не ставит цель на паузу: цель живёт отдельно (это DSH).
|
|
191
|
+
|
|
192
|
+
## Пауза и возобновление
|
|
193
|
+
|
|
194
|
+
- `dept_pause` (или кнопка в карточке) — задача встаёт на паузу: гейты, коммит,
|
|
195
|
+
правки блокируются, токены не тратятся, состояние остаётся на диске.
|
|
196
|
+
- Сторож не будит задачу на паузе.
|
|
197
|
+
- `paused=false` (подпись человека) — работа продолжается с того же места,
|
|
198
|
+
в том числе после выключения/включения сервера.
|
|
199
|
+
- В офисе пауза видна: баннер «отдел на паузе» и руководитель сидит в комнате отдыха.
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
## Мультиязычность
|
|
203
|
+
|
|
204
|
+
Интерфейс панели — **русский и английский**:
|
|
205
|
+
|
|
206
|
+
- кнопка **EN/RU** в шапке доски; выбор запоминается (`localStorage['dept-lang']`);
|
|
207
|
+
- по умолчанию — язык браузера, fallback русский;
|
|
208
|
+
- переводятся: навигация, карточка задачи, вкладки, стадии, события, аудит,
|
|
209
|
+
типы документов, роли, бюджет, офис, схема проекта, графики.
|
|
210
|
+
- **Содержимое документов** пишут агенты на языке задачи — это не UI-строки;
|
|
211
|
+
язык документации задаётся в брифе (`lang` в task.md) или в промпте.
|
|
212
|
+
|
|
213
|
+
Словарь: `LOCALES` в `client.js` (ru/en), ключи `dot.case`, интерполяция `{n}`.
|
|
214
|
+
План развития — `docs/I18N.md`.
|
|
215
|
+
|
|
216
|
+
## Сторож входящих данных
|
|
217
|
+
|
|
218
|
+
- Каждые 5 минут плагин проверяет задачи отделов: новые корректировки (`new`),
|
|
219
|
+
ответы на вопросы (`answered`), замечания к запискам (`changes_requested`).
|
|
220
|
+
- Если появились новые данные — собирает пакет и будит руководителя (`followup`),
|
|
221
|
+
один раз на каждый новый элемент; повторно то же самое не присылает.
|
|
222
|
+
- Руководитель занят — сторож подождёт следующей проверки.
|
|
223
|
+
- **Антизалипание**: если задача активна (не paused/done/blocked), агент простаивает,
|
|
224
|
+
а последнее событие старше 15 минут — сторож будит руководителя подсказкой
|
|
225
|
+
(dept_verify/commit или следующий шаг). Не чаще одного раза в 30 минут на задачу.
|
|
226
|
+
|
|
227
|
+
## Корректировки
|
|
228
|
+
|
|
229
|
+
- Вкладка «Корректировка» — письмо руководителю: к чему относится (концепция/ТЗ/план/
|
|
230
|
+
код/данные/интерфейс), тема и текст. Сохраняется в истории корректировок.
|
|
231
|
+
- `dept_correction` — руководитель видит список, берёт в работу (`in_progress`),
|
|
232
|
+
собирает специалистов на анализ и закрывает (`done`) с итогом.
|
|
233
|
+
- По корректировкам дорабатываются концепция, ТЗ и план (`dept_amend`, `dept_section`).
|
|
234
|
+
|
|
235
|
+
## Вопросы и служебные записки
|
|
236
|
+
|
|
237
|
+
Вопрос к человеку не останавливает работу:
|
|
238
|
+
|
|
239
|
+
1. `dept_ask` — вопрос записан, отдел продолжает.
|
|
240
|
+
2. `dept_propose` — супервайзер предлагает варианты решения.
|
|
241
|
+
3. `dept_critique` — специалисты критикуют; принятое решение фиксируется.
|
|
242
|
+
4. `dept_memo` — служебная записка: вопрос, варианты, критика, решение команды
|
|
243
|
+
(файл `docs/department/<task>/memos/<question>.md`).
|
|
244
|
+
5. `dept_review` — человек утверждает (`approve`) или пишет замечания (`changes`).
|
|
245
|
+
6. `dept_rework` — архитектор готовит план переработки по замечаниям
|
|
246
|
+
(`docs/department/<task>/rework/<question>.md`).
|
|
247
|
+
|
|
248
|
+
## Мультипроект
|
|
249
|
+
|
|
250
|
+
- Вкладка «Проекты» — агрегаты по корням: задачи, стадии, бюджет, последнее событие.
|
|
251
|
+
- Каждый корень — отдельный отдел: задачи создаются через `dept_start root=...`,
|
|
252
|
+
доска показывает все проекты, фильтр — по проекту.
|
|
253
|
+
- Для параллельной работы внутри проекта: `dept_modules` (владение файлами) +
|
|
254
|
+
`dept_worktree` (изолированные каталоги на модуль), слияние — сеньор-кодер.
|
|
255
|
+
- Лимит одновременных кодеров — `maxInstances` у роли.
|
|
256
|
+
|
|
257
|
+
## Художник и референсы
|
|
258
|
+
|
|
259
|
+
- `dept_art` рисует по сетке символов: вход — `rows` (символ = пиксель) и `palette`
|
|
260
|
+
(символ → #rrggbb), выход — PNG (RGBA), масштаб 1–16.
|
|
261
|
+
- `dept_pixelize` берёт PNG/JPEG/WebP, уменьшает до сетки (4–96), квантует в палитру
|
|
262
|
+
(2–64 цвета или заданную), сохраняет PNG и возвращает `rows` + `palette` —
|
|
263
|
+
художник правит пиксели вручную, чтобы получить похожий, но свой спрайт.
|
|
264
|
+
- Референс — для стиля (палитра, пропорции), не для копирования чужой графики.
|
|
265
|
+
|
|
266
|
+
### Художник работает не спеша
|
|
267
|
+
|
|
268
|
+
- Скорость не критерий: качество важнее. Художник рисует по частям:
|
|
269
|
+
референс/палитра → базовые формы → детали → проверка → композиция.
|
|
270
|
+
- Каждый шаг — отдельный файл-чекпоинт (`assets/...png`), его можно пересмотреть.
|
|
271
|
+
- Большая картинка не рисуется одним куском: маленькие спрайты + `dept_compose`.
|
|
272
|
+
- Роль: `reasoning: high`, до 6 попыток; руководитель дробит задачу на элементы,
|
|
273
|
+
а не даёт художнику «нарисуй всё».
|
|
274
|
+
|
|
275
|
+
## Ограничения
|
|
276
|
+
|
|
277
|
+
- Офис и схема — визуализация по данным сессий; арт простой.
|
|
278
|
+
- Blueprint строит только статические импорты (JS/TS/C/C++/Python).
|
|
279
|
+
- У каждой роли лимит одновременных экземпляров (`maxInstances`), у кодера по умолчанию 2:
|
|
280
|
+
руководитель не может запускать больше кодеров, чем указано.
|
|
281
|
+
- Роли можно включать/выключать (кроме manager/coder/tester); `beta-tester`
|
|
282
|
+
по умолчанию выключен — запуск приложений и поток скриншотов дороги по ресурсам.
|
|
283
|
+
- Бюджет считает usage, который отдают адаптеры модели; цены задаются вручную.
|
|
284
|
+
|
|
285
|
+
## Лицензия
|
|
286
|
+
|
|
287
|
+
MIT. Ассеты офиса (папка `assets/`) — собственные и/или CC0; сторонние паки не входят.
|
|
Binary file
|
|
Binary file
|
package/assets/chair.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|