dsh-leader-agent 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,8 @@ e2e 的判据是「真实宿主 + 真实 chromium 里,可观察行为是否成
16
16
 
17
17
  ## 断言纪律
18
18
 
19
- - **断言外部世界**:DOM 的 class、`getComputedStyle` 的具体属性、磁盘上的 JSON。不读 agent 的自述文本,不拿页面里的推理文字当证据。
19
+ - **断言外部世界**:DOM 的结构、class、属性与可见性,磁盘上的 JSON。不读 agent 的自述文本,不拿页面里的推理文字当证据。
20
+ - **不测样式**:颜色、字号、圆角、动画、像素位置与尺寸、布局对齐一律不写进 e2e;它们随宿主改版漂移,写进去只会周期性红。样式走人工取证(清单见 [e2e-testing 的样式/布局人工取证](https://github.com/fengshenx/dsh-leader-agent/blob/main/docs/e2e-testing.md#样式布局人工取证review-门禁))。例外只有**已修 bug 的最小相对几何守卫**(行高/左缘/宽度),且基准必须是宿主同一元素。
20
21
  - **等状态,不睡时间**。`waitFor()` 轮询到条件成立;locator 用 `contenteditable="true"`、`data-*`、可见文本这类状态条件,让 playwright 自己等。
21
22
  - **等待预算按正常耗时给**。实测单场景 3–8 秒、元素 1–2 秒到位:首次启动 20 秒、元素状态 15 秒。写 60 秒/90 秒只会让失败多等一整分钟,还把「机器慢」与「等错了元素」混成同一个症状。慢机与 2 核 CI 用 `E2E_BUDGET_SCALE=1.5` 整体放大(测试级上限走 `scenarioTimeout()`,取同一个倍率)。
22
23
  - **失败要带读数**。元素等待走 `waitForLocator()`:失败时报 locator、目标元素读数(计数、`visible`、边界盒、`display` / `visibility` / `checkVisibility`、宽高)与页面读数(会话行、工作区行、插件元素计数)。目标读数用来分开「不在 DOM」「在 DOM 但 `display:none`」「在 DOM 但零尺寸」——只数 count 时这三种是同一句超时。读数自身限 2 秒,页面主线程卡死时退化成 `{ unavailable }`;自定义读数用 `describePage()`。细节见[e2e 失败预算](https://github.com/fengshenx/dsh-leader-agent/blob/main/.agents/notes/implemented/testing/2026-11-04-e2e-failure-budget.md)。
@@ -76,5 +77,5 @@ e2e 的判据是「真实宿主 + 真实 chromium 里,可观察行为是否成
76
77
 
77
78
  - 不为了 e2e 改生产代码:场景用现有 class 与 role;需要新选择器时那是一次产品决定,不夹带。
78
79
  - 不把截图当断言:截图只解释「当时界面上是什么样」,回归靠断言。
79
- - 不覆盖原生控件、浮层像素位置、WebKit / Firefox:这些走人工取证,PR 里如实标注。
80
+ - 不覆盖原生控件、样式与像素布局(已修 bug 的最小几何守卫除外)、WebKit / Firefox:这些走人工取证,PR 里如实标注。
80
81
  - 不加 `--test-force-exit`:它会把漏清理从「挂住/超时变红」变成「绿着通过 + 孤儿进程」;有界清理见[e2e 清理笔记](https://github.com/fengshenx/dsh-leader-agent/blob/main/.agents/notes/implemented/testing/2026-11-04-e2e-shutdown-bounded.md)。
@@ -49,6 +49,7 @@ worker 的工作目录强制是项目目录:leader 不能指定 worker 的 cwd
49
49
  | 讨论需求、了解系统 | 先明确可观察行为、验收与范围;机制不明先追机制,设计理由不明先查历史记录,分别标事实、推断与缺口 |
50
50
  | 设计与任务定义 | 从真实用法推 owner 与接口;文档归属由项目规范决定;先查重,业务优先级交用户 |
51
51
  | Feature / Bug / Refactor | [实现 playbook](playbooks/implementation.md),依 [并行协作](references/parallel.md)派完整简报;独占 worktree,执行者按行为单元实现验证 |
52
+ | 测试与验证 | [测试 playbook](playbooks/testing.md),按改动面选最便宜的层、双向验证并交可复算证据;项目命令与门槛按项目约定 |
52
53
  | 多任务与依赖 | [编排 playbook](playbooks/program.md),按 owner/语义依赖安排,优先消化审查与 CI 队列 |
53
54
  | 交付 / CI / 审查 / 合入准备 | [交付 playbook](playbooks/delivery.md),当前 head 验产物、行为、审查与门禁,按授权推进 |
54
55
  | 暂停、恢复与清理 | [交接 playbook](playbooks/handoff.md),保存指针与证据缺口,恢复核对实态,清理遵守项目门槛 |
@@ -1,6 +1,6 @@
1
1
  # 实现、缺陷与重构
2
2
 
3
- 共用前提:已有验收、设计/Issue、独占 worktree 和明确写入 owner;委派简报见 [并行协作](../references/parallel.md)。行为驱动、fixture、永久回归与覆盖率以项目约定为准,验证范围按项目既有门禁选择,结构判断按 [专项能力方法](../SKILL.md#按问题调用专项能力)。
3
+ 共用前提:已有验收、设计/Issue、独占 worktree 和明确写入 owner;委派简报见 [并行协作](../references/parallel.md)。行为驱动、fixture、永久回归与覆盖率以项目约定为准,测试方法见 [测试 playbook](testing.md),验证范围按项目既有门禁选择,结构判断按 [专项能力方法](../SKILL.md#按问题调用专项能力)。
4
4
 
5
5
  本 playbook 可由普通单会话或 dev worker 直接使用,不要求加载 leader 入口、建卡或启动派工。共同工程要求相同;worker 的任务来源、交接对象与阶段归属由宿主身份和派单确定,普通会话直接向用户交付。
6
6
 
@@ -0,0 +1,46 @@
1
+ # 测试与验证
2
+
3
+ 测试不是「跑过命令」,而是用最便宜、能证伪的手段证明可观察行为成立。先定验收与可观察量,再选层;能用纯函数、夹具或落盘断言证明的不上浏览器。项目自己的测试命令、覆盖率门槛、flake 表与人工取证范围是事实源,本 playbook 只给方法与检查点。
4
+
5
+ ## 选层
6
+
7
+ - **纯函数 / 数据转换 / 状态归一 / 落盘格式**:单测。输入输出可判定,不需要运行时。
8
+ - **构建、打包、profile、门禁**:用项目自带的构建与打包检查,不另造一套断言。
9
+ - **真实 UI 行为**:项目的 e2e 车道。先读项目里的车道文档与场景写法,不自己另起一套。
10
+ - **样式、像素、动画、原生控件、跨浏览器**:人工取证;自动回归只守行为与已修 bug 的最小几何守卫,不守观感。
11
+
12
+ 同一条结论有更便宜的层就不要升级;e2e 只补单测证明不了的那一段。
13
+
14
+ ## 写用例
15
+
16
+ - **先失败再修**:bug 先复现正确失败,feature 先固定用户路径,重构先固定消费者行为。方法见[实现 playbook](implementation.md)。
17
+ - **断言外部可观察量**:返回值、落盘文件、DOM 属性与可见性、ARIA、wire、投影。不读内部调用栈或自述。
18
+ - **假件照真实 API 面构造**:多给一个宿主方法,会掩盖下限版本的能力缺口。
19
+ - **一次只改一个变量**:用例名写清守住的那句话;去掉不稳定的时序依赖。
20
+ - **边界与反向路径至少各有一条**:空值、越界、失败、取消、重复提交。
21
+ - e2e 场景的断言纪律、等待预算与失败读数见 [e2e-scenarios](../../e2e-scenarios/SKILL.md)。
22
+
23
+ ## 双向验证
24
+
25
+ 修 bug 与重大回归必须:撤掉修复(或注入缺陷)→ 对应用例变红 → 还原 → 全绿。没变红先怀疑用例,不先怀疑实现;把「撤掉什么、红了哪条、报什么读数」写进交付物。重大缺陷固化为永久回归。
26
+
27
+ ## 证据与门禁
28
+
29
+ - 按项目门禁跑最小检查;交付物写清跑了什么、结果、未跑项与原因。不贴一条命令当证据,不把 worker PASS 当验收;PR 证据格式见[交付 playbook](delivery.md#开-pr)。
30
+ - 失败先读目标/页面读数、日志与请求记录,区分数据没到、渲染错了、环境坏了;不靠重试或加大等待变绿。
31
+ - 已知 flake 要登记并追根因;同一处连续两次空载失败按回归处理。
32
+ - 截图与临时数据不入库;截图只解释当时状态,不替代断言。
33
+ - 覆盖数字只作下限:新增文件默认要求全覆盖,加载不到的文件要登记理由,不靠漏测或空导入变绿。
34
+
35
+ ## 审查测试
36
+
37
+ - 断言是否落在可观察行为上,而不是实现细节?
38
+ - 撤掉修复后这条用例会红吗?
39
+ - 假件是否比真实 API 面多给了能力?
40
+ - 是否有只证明「代码执行过」的绿灯?
41
+ - e2e 是否在测样式、像素或动画?是则删掉或转人工取证;只有已修 bug 的最小相对几何守卫可以留,基准必须是宿主同一元素。
42
+ - 覆盖数字是否靠加载文件凑出来,而不是覆盖行为?
43
+
44
+ ## 不覆盖
45
+
46
+ 原生控件、样式与像素布局、WebKit/Firefox 走人工取证并在交付物里标注;不真实调用付费模型 API;不把 e2e 塞进只跑纯函数的门禁。
package/README.md CHANGED
@@ -28,7 +28,7 @@
28
28
  ## Highlights
29
29
 
30
30
  1. **One Leader drives development and review** — You state the goal once. The Leader opens cards, dispatches workers, watches each one finish, verifies the deliverable and organizes review. Your attention goes back to "what do I want" instead of "which agent is stuck"; the target is ten features in flight at once.
31
- 2. **A right SidePanel board: see who is working at a glance** — One board per project. Each card carries its executor slot and a live status light, its note renders as Markdown, its links are editable in place, and the detail footer can delete the card. Click a card for the spec (goal, scope, acceptance, links), click a slot to drill into that agent's session and keep talking; worker reports arrive as Markdown-rendered agent bubbles; dispatched task briefs arrive as user-style bubbles whose body uses the same Markdown pipeline as assistant content; single newlines merge per Markdown, so use blank lines or Markdown syntax for a line break.
31
+ 2. **A right SidePanel board: see who is working at a glance** — One board per project, in two presentations: **Work** (default) keeps the plain list, **Cinematic** draws it as a workflow map for demos and social sharing; switch under Settings → Leader Agent → Task board. Each card carries its executor slot and a live status light, its note renders as Markdown, its links are editable in place, and the detail footer can delete the card. Click a card for the spec (goal, scope, acceptance, links), click a slot to drill into that agent's session and keep talking; worker reports arrive as Markdown-rendered agent bubbles; dispatched task briefs arrive as user-style bubbles whose body uses the same Markdown pipeline as assistant content; single newlines merge per Markdown, so use blank lines or Markdown syntax for a line break.
32
32
  3. **Arrange your agents however you want** — Two files do the arranging. `LEADER.md` holds the Leader's prompt and this project's orchestration rules: boundaries, dispatch requirements, acceptance criteria. `SLOTS.md` gives each worker role its own rules (dev / review / …). Both are evaluated before every model request and appended only when their text changes, so editing a file changes behavior without recreating sessions.
33
33
  4. **Many projects in parallel, one Leader each** — Adding a project binds a leader session to it, and the project tree lists the workers that Leader spawned; rows can be dragged to reorder, and deleting a project only drops the record while keeping the folder and the sessions (dsh workspaces are untouched). Projects stay out of each other's way. Swap in a new Leader and the existing workers plus undelivered reports move over, so it can dispatch immediately.
34
34
  5. **The `leader-mode` skill: an orchestration protocol for the Leader** — Not "you are a tech lead". Staged playbooks across discussion → design → implementation and delivery → review → merge, plus guidance on parallel collaboration and handoff.
@@ -55,7 +55,7 @@ Desktop uses its own profile (`$DSH_HOME/profiles/desktop`), separate from `web`
55
55
 
56
56
  On Windows / Linux, use `runtime/cli/bin/dsh` inside the installation directory. The app reads the profile only at startup, and only one version can be mounted at a time. `DSH_HOME` must be absolute or start with `~/`. Sessions, projects, and cards are shared with `web`; plugin packages and activation are separate.
57
57
 
58
- For development inside this repository, `npm run desktop` mounts the current worktree, rebuilds the bundle and launches the app; `-- --remove` unmounts it.
58
+ Development: `npm run desktop` uses an isolated root (`.dev/desktop-home`); `npm run desktop:prod` uses a shadow root (`.dev/desktop-prod-home`) linking sessions/cards to `~/.dsh`; online profile untouched. Both run local code; direct launches use the installed version. `-- --remove` cleans its root; `-- --remove --remove-mount` removes a legacy mount.
59
59
 
60
60
  ### Web install
61
61
 
@@ -73,12 +73,18 @@ For pinning a version, removing it, development installs, or trying it without a
73
73
  ## Preview
74
74
 
75
75
  <div align="center">
76
- <img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/board.png" alt="dsh-leader-agent: the project tree on the left, the Leader's conversation in the middle, the delivery board on the right" width="1200">
76
+ <img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/board.png" alt="Work mode: the project tree on the left, the Leader's conversation in the middle, the delivery board as a list on the right" width="1200">
77
77
  </div>
78
78
 
79
- Left: projects and the workers each Leader spawned. Center: the Leader's session — the task, the dispatch, the worker reporting back, the verdict. Right: the delivery board for the project, with one card per task and a slot chip per executor. You can see the agents that are working, click one to drill into its session and talk to it directly, without going through the Leader.
79
+ **Work mode (default).** The plain list: one card per task with a slot chip per executor. Left: projects and their workers. Center: the Leader's session — task, dispatch, report, verdict. Right: the board; click an executor to open its session.
80
80
 
81
- The screenshot shows a real working session.
81
+ <div align="center">
82
+ <img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/ab19c6307736fc21675bbac2847dd9bce3bf7a81/docs/assets/readme/board-cinema.png" alt="Cinematic mode in the dark theme: the delivery board as a workflow map, with cards on a trunk and executors on animated branches" width="1200">
83
+ </div>
84
+
85
+ **Cinematic mode.** The same board as a workflow map: cards on a trunk, one branch per executor; only a running branch animates. Built for demos and social sharing. Shown in the dark theme; the light theme uses electric-blue lines.
86
+
87
+ Switch under **Settings → Leader Agent → Task board**; the choice is stored per browser. Work-mode shot is a real session; cinematic shot is the browser e2e fixture (real host + local mock).
82
88
 
83
89
  ## How it runs
84
90
 
@@ -104,7 +110,7 @@ Three mechanisms make this more than "a smarter prompt":
104
110
 
105
111
  ## Design trade-offs
106
112
 
107
- - This project does not aim to rebuild dsh's own super agent. It solves one concrete problem: letting one person manage 20+ sessions.
113
+ - This project does not aim to rebuild [the Super-agent research prototype from the DeepSeek Harness team](https://github.com/deepseek-ai/dsh-superagent-prototype) (a research prototype, not an official DeepSeek product), which watches one repository and runs event-driven sessions. It solves a different problem: letting one person manage 20+ sessions, with a Leader, a board and parallel tasks ([FAQ](https://fengshenx.github.io/dsh-leader-agent/#faq)).
108
114
  - Today's agents are not reliable enough to run unattended, so the design assumes you can interrupt or push any worker at any point.
109
115
  - The routing layer runs a full-size model. In practice, holding the global picture, it often connects several PRs in one thought and resolves what a single worker cannot see.
110
116
  - Agent orchestration generalizes. A card describes the task itself, so it works outside coding and composes with any skill.
@@ -117,7 +123,7 @@ Three mechanisms make this more than "a smarter prompt":
117
123
  2. **Load the protocol.** In the leader session, have the model load `leader-mode`. It reads `playbooks/program.md` first, then the playbook for the current stage.
118
124
  3. **Dispatch.** `spawn_worker` requires `name` (a short role-task handle); `cardId` + `slot` optionally bind the card's executor slot in the same call. It returns a session id immediately and the worker has **not started yet**. Deliver the task body with `message_worker` (`sessionId` + `message`, optionally `rename`): the first message is what starts the turn, and a card-bound worker gets the card facts added to its request automatically, so you do not need to paste the spec. The worker's sandbox mode and approval policy are inherited from the Leader at dispatch time (an Auto Leader also passes on its review gate); the receipt states the permissions the worker actually runs with, and calls out full access by name. To see how it went about this turn — which tools it called, where it failed — use `read_worker_session` on it; that does not wake the worker.
119
125
  4. **Record task facts.** `create_card` opens a card (`title` required), `update_card` edits one (content changes carry `expectedRevision` for optimistic concurrency; links can be replaced wholesale with `links` or merged by id with `addLinks`), `list_cards` reads them. Links are deliverable entry points — PRs, issues, docs, assets — not comment or inline-comment anchors (`#issuecomment-` / `#discussion_r` / `#pullrequestreview-`). Comments are process evidence; write them in the report body. Cards belong to a project and are numbered globally; edits across projects are refused. `list_cards` and `create_card` are the Leader's alone, and plain sessions get neither; `update_card` is shared with workers. A worker may only edit a card it is bound to, and only derived fields such as `links` — `title` / `spec` / `status` / `kind` / `sortOrder` / `slots` belong to the Leader (the first two are the acceptance anchor and injected content, the rest organize the board and decide who executes). `read_card` is the worker's alone: it reads any card in the project, and with no `cardId` / `number` it reads the worker's single bound card — the way back to its task after compaction or a stale injection. Long specs come in 2000-character pages via `specOffset`.
120
- 5. **Watch the board.** The Board tab in the right panel pulls cards for the project of the current session. It opens by itself when the leader creates a card; click a card for details (links editable, the card deletable, the rest read-only), click a slot chip to open the executor's session.
126
+ 5. **Watch the board.** The Board tab in the right panel pulls cards for the project of the current session. It opens by itself when the leader creates a card; click a card for details (links editable, the card deletable, the rest read-only), click a slot chip to open the executor's session. Work mode is the default; choose Cinematic under Settings → Leader Agent → Task board.
121
127
 
122
128
  ## Orchestration lives in files
123
129
 
package/README_ZH.md CHANGED
@@ -28,7 +28,7 @@
28
28
  ## 亮点
29
29
 
30
30
  1. **通过一个 Leader,帮你推进开发和 Review** — 你只跟 Leader 说目标,它拆卡、派工、盯住每个 worker 的完成、验证产物、组织审查。注意力回到「要什么」上,不用逐个陪跑——目标规模是一次并行开发 10 个 feature。
31
- 2. **右栏 SidePanel 看板,正在工作的 Agent 一目了然** — 一个项目一块看板。卡面上是执行者槽位与实时信号灯,卡片说明按 Markdown 渲染,链接可在浮层里直接编辑,详情页脚可删除卡片;点卡面看详情(目标、范围、验收、链接,其余只读),点槽位直接下钻进那个 Agent 的会话接着聊。worker 的回报按 Markdown 渲染成左侧 agent 气泡;leader 派过去的任务渲染成右侧用户气泡,正文与 assistant 内容同套 Markdown;单换行按 Markdown 合并,需要断行用空行或 Markdown 语法。
31
+ 2. **右栏 SidePanel 看板,正在工作的 Agent 一目了然** — 一个项目一块看板,两套呈现:**工作**(默认)保持纯列表,**炫酷**把卡片画成线路图、纯演示与社交媒体传播用,`设置 → Leader Agent → 任务看板` 切换。卡面上是执行者槽位与实时信号灯,卡片说明按 Markdown 渲染,链接可在浮层里直接编辑,详情页脚可删除卡片;点卡面看详情(目标、范围、验收、链接,其余只读),点槽位直接下钻进那个 Agent 的会话接着聊。worker 的回报按 Markdown 渲染成左侧 agent 气泡;leader 派过去的任务渲染成右侧用户气泡,正文与 assistant 内容同套 Markdown;单换行按 Markdown 合并,需要断行用空行或 Markdown 语法。
32
32
  3. **Agent 自由编排** — 拆成两份文件:`LEADER.md` 写 Leader 的 prompt 与项目编排规则(职责边界、派工要求、验收口径);`SLOTS.md` 按角色给 worker 写编排规则(开发 / 审核……)。两者在每次模型请求前求值、正文变化才追加,改文件即改行为,不用重建会话。
33
33
  4. **多项目并行,每个项目一个 Leader** — 左栏加一个项目就绑定一个 leader 会话,项目树列出它派出的 worker;项目行可拖拽排序,删除项目只删记录、保留文件夹与会话(dsh 工作区不受影响)。项目之间各管各的。换 Leader 时原班 worker 与未投递的回报一并改投新会话,新 Leader 直接接着派。
34
34
  5. **`leader-mode` skill,给 Leader 的编排 Skill** — 不是一句「你是 tech lead」:按技术讨论 → 设计 → 实现交付 → 审查 → 合入分阶段给 playbook,另有并行协作与交接规范。
@@ -55,7 +55,7 @@
55
55
 
56
56
  Windows / Linux 换成安装目录里对应的 `runtime/cli/bin/dsh`。应用只在启动时读 profile,同一时刻只能挂一个版本;`DSH_HOME` 要用绝对路径或 `~/` 写法。会话、项目与卡片数据与 `web` 共享,插件包与激活状态各自一份。
57
57
 
58
- 在本仓库里开发时改用 `npm run desktop`:挂当前工作树、重建产物并拉起应用,`-- --remove` 摘除。
58
+ `npm run desktop` 用 dev 根 `.dev/desktop-home`;`npm run desktop:prod` 用正式数据(影子根 `.dev/desktop-prod-home`,共用日常,线上 profile 不动)。都用本仓代码,直接启动仍用线上;`-- --remove` 清根,旧版用 `-- --remove --remove-mount` 摘。
59
59
 
60
60
  ### Web 版安装
61
61
 
@@ -73,12 +73,18 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
73
73
  ## 预览
74
74
 
75
75
  <div align="center">
76
- <img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/board.png" alt="dsh-leader-agent:左栏项目树、中栏 Leader 的会话、右栏按项目组织的看板" width="1200">
76
+ <img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/board.png" alt="工作模式:左栏项目树、中栏 Leader 的会话、右栏列表形态的交付看板" width="1200">
77
77
  </div>
78
78
 
79
- 左边是项目与每个 Leader 派出的 worker;中间是 Leader 的会话——任务、派工、worker 回报、验收;右边是这个项目的交付看板,一卡一件事,槽位 chip 标出执行者。你能看到正在工作的 Agent,点击即可下钻到它的会话,绕开 Leader 直接和它对话。
79
+ **工作模式(默认)**:纯列表,一卡一件事,槽位 chip 标出执行者。左栏项目树、中栏 Leader 会话、右栏看板;点执行者即可下钻到它的会话。
80
80
 
81
- 截图取自真实工作会话。
81
+ <div align="center">
82
+ <img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/ab19c6307736fc21675bbac2847dd9bce3bf7a81/docs/assets/readme/board-cinema.png" alt="炫酷模式(深色主题):交付看板画成线路图,卡片挂在主干上,执行者支线按运行状态点亮" width="1200">
83
+ </div>
84
+
85
+ **炫酷模式**:同一块看板画成线路图——卡片挂主干,执行者是右侧支线,只有执行中的支线跑光点。纯演示,社交媒体传播用。图为深色主题;浅色宿主下是电蓝正交线条。
86
+
87
+ 在 **设置 → Leader Agent → 任务看板** 切换,选择只存本浏览器;工作模式截图取自真实会话,炫酷模式取自 e2e 夹具(真实宿主 + 本地 mock)。
82
88
 
83
89
  ## 它是怎么跑起来的
84
90
 
@@ -104,7 +110,7 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
104
110
 
105
111
  ## 设计取舍
106
112
 
107
- - 这个项目不想复刻 dsh 的 super agent,只是想解决现有的问题(让 1 个人可以管理 20 个以上的 Session)。
113
+ - 这个项目不复刻 [DeepSeek Harness 团队的 Super-agent 研究原型](https://github.com/deepseek-ai/dsh-superagent-prototype)(研究原型,不是 DeepSeek 官方产品;它盯一个仓库、按事件起会话),要解决的是另一件事:让 1 个人管理 20 个以上的 Session,有 Leader、看板和并行任务([项目落地页 FAQ](https://fengshenx.github.io/dsh-leader-agent/#faq))。
108
114
  - 在当前 agent 还不是那么完善的情况下,这个项目的思路是你可以随时打断或者推进某个 worker 的工作。
109
115
  - routing 层用的是完整大模型,实际使用中,routing 层由于知道全局信息,经常能够把多个 PR 串起来思考,解决单 Worker 看不到的问题。
110
116
  - Agent 编排的泛化。Card 是任务本身的描述,可以用在非编码场景,也可以和各种 Skill 集成。
@@ -117,7 +123,7 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
117
123
  2. **加载协议**:leader 会话里让模型加载 `leader-mode`,先读 `playbooks/program.md`,再按阶段读对应 playbook。
118
124
  3. **派工**:`spawn_worker` 只要求 `name`(角色-任务短名),可带 `cardId` + `slot` 一次把卡槽位绑好;工具立即返回会话 id,此时 worker **还没开工**。用 `message_worker` 投递任务正文(`sessionId` + `message`,可顺手 `rename`),第一条消息才开工;挂卡 worker 的请求会自动带上卡片事实,消息里不必抄 spec。worker 的沙箱模式与审批策略在派工那一刻从 leader 继承(leader 是 Auto 时连审查门一起继承),回执里写明它实际以什么权限在跑,完全权限会被点名。要看它这一轮怎么做的(调了哪些工具、哪步失败),用 `read_worker_session` 回看,不必唤醒它。
119
125
  4. **记任务事实**:`create_card` 建卡(`title` 必填),`update_card` 改卡(改内容带 `expectedRevision` 做乐观并发;链接可用 `links` 整体替换,或用 `addLinks` 按 id 增量追加),`list_cards` 查卡。链接只挂 PR / Issue / 文档 / 成片这类交付物入口,不挂评论或行内评论的锚点(`#issuecomment-` / `#discussion_r` / `#pullrequestreview-`);评论是过程证据,写进回报正文。卡片按项目归属、编号全局递增,跨项目改卡会被拒绝。`list_cards` 与 `create_card` 只给 leader,普通会话一件也没有;`update_card` leader 与 worker 都有。worker 只能改自己挂着的卡,且只能挂 `links` 这类派生字段:`title` / `spec` / `status` / `kind` / `sortOrder` / `slots` 都归 leader(前两者是验收锚点与注入内容,其余组织看板并决定谁在执行)。`read_card` 只给 worker:读本项目的任意卡,不传 `cardId` / `number` 时读自己唯一绑定的卡——压缩或注入失效后找回任务的入口;长规格按 2000 字符分页,用 `specOffset` 续读。
120
- 5. **看看板**:右栏「看板」Tab,按当前会话所属项目拉卡片。leader 建卡后自动打开;点卡面看详情(链接可编辑、可删卡,其余只读),点槽位 chip 打开执行者会话。
126
+ 5. **看看板**:右栏「看板」Tab,按当前会话所属项目拉卡片。leader 建卡后自动打开;点卡面看详情(链接可编辑、可删卡,其余只读),点槽位 chip 打开执行者会话。工作模式是默认;想切炫酷,在 `设置 → Leader Agent → 任务看板` 选「炫酷模式」。
121
127
 
122
128
  ## 编排:把规则写进文件
123
129