dsh-spec-collab 0.4.0 → 0.5.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.
- package/CHANGELOG.md +14 -0
- package/README.md +16 -16
- package/docs/assets/demo-01-workspace.png +0 -0
- package/docs/assets/demo-02-ai-review.png +0 -0
- package/docs/assets/demo-03-patches.png +0 -0
- package/docs/assets/demo-04-decisions.png +0 -0
- package/docs/assets/demo-05-ready.png +0 -0
- package/docs/core-refactor-ablation.md +59 -0
- package/docs/usage-walkthrough.md +7 -7
- package/lib/client.js +247 -236
- package/lib/index.js +1481 -1376
- package/lib/types/collaboration-ledger.d.ts +14 -0
- package/lib/types/collaboration-ledger.d.ts.map +1 -0
- package/lib/types/engine.d.ts +19 -29
- package/lib/types/engine.d.ts.map +1 -1
- package/lib/types/git-store.d.ts +24 -10
- package/lib/types/git-store.d.ts.map +1 -1
- package/lib/types/insights.d.ts +29 -0
- package/lib/types/insights.d.ts.map +1 -0
- package/lib/types/ready-admission.d.ts +1 -0
- package/lib/types/ready-admission.d.ts.map +1 -1
- package/lib/types/review-runtime.d.ts +32 -2
- package/lib/types/review-runtime.d.ts.map +1 -1
- package/lib/types/routes.d.ts.map +1 -1
- package/lib/types/spec-lifecycle.d.ts +18 -0
- package/lib/types/spec-lifecycle.d.ts.map +1 -0
- package/package.json +34 -29
- package/src/collaboration-ledger.ts +168 -0
- package/src/engine.ts +306 -516
- package/src/git-store.ts +212 -141
- package/src/insights.ts +186 -0
- package/src/ready-admission.ts +5 -1
- package/src/review-runtime.ts +37 -3
- package/src/routes.ts +6 -4
- package/src/spec-lifecycle.ts +126 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 — 2026-11-25
|
|
4
|
+
|
|
5
|
+
- Share one commit transition across saves, renames, restores, and accepted patches. Invalidate the previous Ready package, whole-version confirmations, and pending patches when the Spec advances.
|
|
6
|
+
- Record the next collaboration ledger before moving the Git ref. Recover interrupted writes on startup and isolate Spec commits from unrelated staged files.
|
|
7
|
+
- Commit human actions and AI submissions atomically. Keep terminal AI results when dispatch acknowledgements arrive late.
|
|
8
|
+
- Use the same current-version human signers for Ready admission and export. Keep the existing compatibility range and verify the packaged plugin on DSH 0.2.2-rc.5.
|
|
9
|
+
- Refresh the walkthrough and validate the core mechanisms with reproducible ablation tests.
|
|
10
|
+
|
|
11
|
+
## 0.4.1 — 2026-11-11
|
|
12
|
+
|
|
13
|
+
- Support DSH 0.2.2-rc.1 while retaining 0.2.1-rc.5 compatibility. Declare bounded runtime and SDK peer windows for both release lines, including npm's default prerelease matching, and reject unverified 0.2.3 and later releases.
|
|
14
|
+
- Replace the removed Session Controller inspection call with paginated event history on DSH 0.2.2. Keep one history cursor while reading earlier pages, preserve chronological replies, reject non-advancing cursors, and fall back to inspection on DSH 0.2.1.
|
|
15
|
+
- Build and type-check against the 0.2.2-rc.1 SDK and support both Cordis 4.0/4.1 and native schema versions. Cover the original exact-peer rejection, supported and unsupported runtimes, legacy history, and the current history protocol.
|
|
16
|
+
|
|
3
17
|
## 0.4.0 — 2026-11-03
|
|
4
18
|
|
|
5
19
|
- Support DeepSeek Harness 0.2.1-rc.5 and declare its Host services as exact SDK peers. Older DSH 0.1.1-rc.1 installations must continue using plugin 0.3.1.
|
package/README.md
CHANGED
|
@@ -7,25 +7,23 @@ DeepSeek Harness 的需求“编辑校样台”,用于把原始需求澄清为
|
|
|
7
7
|
|
|
8
8
|
产品边界严格止于 Ready Spec,不包含代码实现、测试用例生成、worktree、MR、部署、发布或交付状态管理。
|
|
9
9
|
|
|
10
|
-
当前版本为 `v0.
|
|
10
|
+
当前版本为 `v0.5.0`,已在 npm `latest` 对应的 DeepSeek Harness `0.2.2-rc.5` 上验证安装、工作台和 Ready 流程。版本范围覆盖 DSH `0.2.1`(从 `rc.5` 起)与 `0.2.2`(从 `rc.1` 起),包括对应的稳定版本。`0.2.3-alpha.2` 属于 `alpha` 渠道,超出兼容范围。DSH `0.1.1-rc.1` 请使用插件 `0.3.1`。
|
|
11
|
+
|
|
12
|
+
插件在 DSH `0.2.2` 上通过分页事件接口读取 AI 会话历史,并保留 `0.2.1` 的历史读取方式。在 `0.2.2-rc.5` 中,从侧栏「插件」旁的「需求讨论」进入工作台。
|
|
11
13
|
|
|
12
14
|
## 安装
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
桌面版可在 DSH 的「插件」中添加 `dsh-spec-collab@0.5.0`。如果界面提示需要重启,退出并重新打开桌面应用,再确认插件已启用。
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
npx -y @deepseek-ai/dsh@0.2.1-rc.5 plugin --profile desktop add dsh-spec-collab@0.4.0
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
如果 `dsh` 已在 `PATH` 中,也可以使用简写:
|
|
18
|
+
使用独立 Web 的用户可通过与宿主同版本的 CLI 安装或升级:
|
|
21
19
|
|
|
22
20
|
```sh
|
|
23
|
-
dsh plugin --profile
|
|
21
|
+
npx -y @deepseek-ai/dsh@0.2.2-rc.5 plugin --profile web add dsh-spec-collab@0.5.0
|
|
24
22
|
```
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
如果当前 `dsh` 已在 `PATH` 中,可以运行 `dsh plugin --profile web add dsh-spec-collab@0.5.0`。使用自定义 profile 时,将 `web` 替换为实际名称。重启使用该 profile 的 Web 进程后,刷新浏览器。
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
DSH 宿主需要安装 Git。插件可在本机 HTTP 环境生成 UUID。通过团队反向代理使用时,插件请求仍需同源,且代理连接插件后端时须来自 loopback。使用 HTTPS 和真实认证,浏览器还需允许剪贴板操作。
|
|
29
27
|
|
|
30
28
|
## 核心流程
|
|
31
29
|
|
|
@@ -65,7 +63,7 @@ dsh plugin --profile desktop add dsh-spec-collab@0.4.0
|
|
|
65
63
|
|
|
66
64
|
## 完整演示
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
截图来自 DSH `0.2.2-rc.5` 上从新建到 Ready Spec 的隔离验收。使用可控模型端点返回演示结果,由 DSH 执行会话和工具调用,再通过工作台完成回答、Patch 审核和交付。
|
|
69
67
|
|
|
70
68
|
**[阅读完整图文教程](docs/usage-walkthrough.md)**
|
|
71
69
|
|
|
@@ -90,11 +88,11 @@ dsh plugin --profile desktop add dsh-spec-collab@0.4.0
|
|
|
90
88
|
|
|
91
89
|
### 5. 查看并导出 Ready Spec
|
|
92
90
|
|
|
93
|
-

|
|
94
92
|
|
|
95
93
|
</details>
|
|
96
94
|
|
|
97
|
-
## 当前能力(v0.
|
|
95
|
+
## 当前能力(v0.5.0)
|
|
98
96
|
|
|
99
97
|
### 需求正文与版本
|
|
100
98
|
|
|
@@ -108,7 +106,7 @@ dsh plugin --profile desktop add dsh-spec-collab@0.4.0
|
|
|
108
106
|
|
|
109
107
|
### AI 审核与候选修改
|
|
110
108
|
|
|
111
|
-
- `FACT / INFERENCE / ASSUMPTION / TO_VERIFY`
|
|
109
|
+
- 结构化 Review Item 区分 `FACT / INFERENCE / ASSUMPTION / TO_VERIFY`。提交 `FACT` 时必须提供声明可访问且填写版本的证据。
|
|
112
110
|
- 同一需求在同一流程阶段复用一个 DSH AI session;审核、评论分析和追问只追加增量提示,进入下一阶段后再创建新会话。
|
|
113
111
|
- 每条实质评论提交后自动进入当前阶段 AI 会话,回复必须包含理解、证据或 `TO_VERIFY`、影响章节/AC 和建议处置。
|
|
114
112
|
- AI 只能提交 Review Item、评论分析和候选 patch;不能写 Git、代替人确认或标记 Ready。
|
|
@@ -219,7 +217,7 @@ pnpm run build
|
|
|
219
217
|
dsh plugin --profile desktop add "link:$(pwd)"
|
|
220
218
|
```
|
|
221
219
|
|
|
222
|
-
首次安装或 Host
|
|
220
|
+
首次安装或 Host 代码变更后,重启承载插件的桌面应用或 `dsh web` 进程。使用 DSH 源码开发 Client 时,可在同一个 DSH checkout 运行 `pnpm run dev:web`,并在插件仓库运行 `pnpm run bundle --watch`,让已连接的 Client 接收更新。
|
|
223
221
|
|
|
224
222
|
## 键盘与响应式工作台
|
|
225
223
|
|
|
@@ -248,7 +246,9 @@ CSV 必填 `body`,可选 `title`、`customer`、`company`、`external_ref`、`
|
|
|
248
246
|
|
|
249
247
|
Git 是正式 Spec 版本的唯一事实源;协作账本不保存第二套 Markdown 历史。未正式保存的草稿只保存在当前浏览器 IndexedDB。
|
|
250
248
|
|
|
251
|
-
|
|
249
|
+
单个插件宿主管理一套 Git 仓库和协作账本。正文变更先记录待完成的事务,再更新 Git 和账本。宿主中断后会在下次启动时续写。如果恢复前有人编辑了同一个 Spec 路径,插件保留外部编辑和恢复记录,并报告冲突。
|
|
250
|
+
|
|
251
|
+
[阅读 v3 迁移、回滚与隐私说明](docs/migration-v3.md) · [查看核心重构与消融结果](docs/core-refactor-ablation.md)
|
|
252
252
|
|
|
253
253
|
## 安全与限制
|
|
254
254
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# 规格协作核心重构与消融结果
|
|
2
|
+
|
|
3
|
+
基线为 `e14eb41`。实验在 macOS、Node.js `24.21.0`、pnpm `9.9.0` 上运行,使用隔离 Git 仓库和协作账本。
|
|
4
|
+
|
|
5
|
+
## 必须成立的约束
|
|
6
|
+
|
|
7
|
+
1. **交付对应一份明确的正文。** Git commit 定义正式 Spec。保存、重命名、历史恢复和接受 Patch 都会生成新 commit。正文变更后,旧 Ready 包和整版确认失效,未处置的候选 Patch 退出待办。Ready 准入与导出读取同一组当前版本人工整版确认。
|
|
8
|
+
2. **协作更新以持久化为准。** 同一个命令里的参与者绑定、协作记录和 AI 待办一次写入。SSE 在写入完成后通知,单个订阅者掉线不影响提交。批量审核中的任何一项校验失败,整批撤回。
|
|
9
|
+
3. **跨进程调用允许迟到。** AI 回调按需求 ID 和任务 ID 回写最新记录,用发起时的阶段和阶段轮次登记会话。已完成任务保留终态。进程重启后,缺少调度确认的排队任务标记为可重试的失败状态,保留真实 DSH 后续回写的机会。
|
|
10
|
+
4. **Git 仓库与协作账本能够重启续写。** Git 先用临时 index 生成仅涉及当前 Spec 的 commit 对象。账本先落恢复记录,随后更新 Git ref、同步对应路径,再发布账本。恢复记录还支持上一版写入的旧格式。恢复期间发现不匹配的外部编辑时,保留现场并报错。
|
|
11
|
+
|
|
12
|
+
## 对抗性审查
|
|
13
|
+
|
|
14
|
+
| 现有假设 | 反例 | 实现取舍 |
|
|
15
|
+
| --- | --- | --- |
|
|
16
|
+
| 每个入口各自处理正文更新就够了 | 重命名绕过了 Ready 和候选 Patch 的失效逻辑 | 四个入口调用同一处正文变更规则 |
|
|
17
|
+
| 准入时校验确认范围后,导出可直接列出所有 active 确认 | 只签了章节的研发被列为整版确认人 | 准入与导出复用一条确认筛选规则 |
|
|
18
|
+
| 提交后的订阅回调可以参与命令成败 | 回调抛错后,账本已写入而内存回滚,后续订阅者也收不到事件 | 提交后再通知,移除故障订阅者 |
|
|
19
|
+
| AI 结果逐项追加后再写账本即可 | 第二项无效时,第一项和对应待办留在内存,下次写入可能一并落盘 | AI 与人工共用同一账本事务 |
|
|
20
|
+
| 发起 AI 时捕获的数据对象可用于稍后的回写 | 另一个命令替换状态后,回调仍指向旧评论。更早到达的 AI 回复也可能被改回运行中 | 回写按 ID 查找,运行状态从排队单向推进 |
|
|
21
|
+
| `git add <spec>` 足以限定提交范围 | 真实 index 里已有其他暂存路径 | 从基准 commit 构建隔离 index,只更新正式 Spec |
|
|
22
|
+
| Git 提交后再写 `.pending` 足以恢复 | 写恢复记录前失败时,Git 已领先协作账本 | 先记可恢复的目标状态,再更新 ref |
|
|
23
|
+
|
|
24
|
+
沿用 Git、v3 JSON 和原有工作流。选用一个连接 Git 提交与账本快照的恢复记录,覆盖两套存储之间无法单次原子写入的间隙。
|
|
25
|
+
|
|
26
|
+
## 消融结果
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
node scripts/verify-core-ablation.mjs
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
脚本把原版和每个变体复制到临时目录,使用同样的测试与依赖。原版的 7 个回归场景全部失败,完整实现的 11 个场景全部通过。每个消融变体运行对应反例和独立控制用例。10 个变体均出现预期的目标失败,并保留了外部编辑保护。脚本写出逐次 Vitest 结果、日志和 `summary.json`,并校验预期的用例身份和退出码。
|
|
33
|
+
|
|
34
|
+
| 单独撤掉的机制 | 实际退化 |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| 新正文撤销 Ready | 重命名后状态仍为 Ready |
|
|
37
|
+
| 整版签署范围过滤 | 章节确认人进入 Ready 整版签署名单 |
|
|
38
|
+
| SSE 订阅者故障隔离 | 第一个故障订阅者使命令抛错 |
|
|
39
|
+
| 隔离事务草稿 | 被拒绝的评审批次仍在内存中留下问题和待办 |
|
|
40
|
+
| AI 回调按 ID 查找当前记录 | 延迟回调结束后,当前评论仍停在排队 |
|
|
41
|
+
| AI 终态保护 | 已完成的评论回复退回运行中 |
|
|
42
|
+
| 从基准 commit 初始化临时 index | 无关文件被纳入正式 Spec 提交 |
|
|
43
|
+
| 恢复记录先于 Git ref 写入 | 恢复记录写失败时 Git ref 已移动 |
|
|
44
|
+
| 已移动 Git ref 的续写分支 | 在 ref 更新后中断,重启无法同步工作区和账本 |
|
|
45
|
+
| 当前版本研发预审门禁 | 缺少研发预审时仍生成 Ready |
|
|
46
|
+
|
|
47
|
+
另外验证了在 ref 更新前、ref 更新后、工作区同步后注入中断,以及删除完成但账本尚未发布的情形。真实 Git ref、index、工作区与账本在重启时收敛到同一状态。现有的 V2 迁移、V3 恢复、HTTP Ready 准入和 Cordis 加载测试继续通过。
|
|
48
|
+
|
|
49
|
+
## 性能与验证范围
|
|
50
|
+
|
|
51
|
+
同一台机器用 6 个本地需求、3 轮交错运行测量。300 次热状态读取的中位数从 **0.056 ms** 降至 **0.041 ms**。18 次正式保存的中位数从 **100.4 ms** 升至 **298.8 ms**,增加约 **198 ms**,主要来自准备 Git 对象、更新 ref、同步工作区与账本记录所需的额外操作。这是隔离数据集上的观察值。
|
|
52
|
+
|
|
53
|
+
恢复验证覆盖单个插件宿主进程的中断和本地文件系统写入错误。多个宿主进程同时写同一个数据目录与机器断电级持久性未覆盖。
|
|
54
|
+
|
|
55
|
+
## 0.5.0 发布验收
|
|
56
|
+
|
|
57
|
+
在 npm `latest` 对应的 DSH `0.2.2-rc.5` 中,将 `npm pack` 产物装入独立 Web profile。浏览器验证了侧栏入口、绑定工作区、新建需求、登记角色、回答审核问题、检查与接受 Patch、查看 Decision,以及生成和下载 Ready Markdown。HTTP 补充验证了未预审拒绝、旧 commit 审核拒绝、双角色整版确认、会话历史与追问、SSE 修订通知。下载的 Markdown 与服务端交付包一致,正文与对应 Git 对象逐字一致,SHA-256 复算一致。
|
|
58
|
+
|
|
59
|
+
模型请求走 DSH 的实际会话和工具调用链,响应由本地确定性端点提供。该验收覆盖宿主集成和交付流程。模型判断质量与 `alpha` 渠道不在这次验证范围内。浏览器实录见[使用演示](usage-walkthrough.md)。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 完整使用演示:从新需求到 Ready Spec
|
|
2
2
|
|
|
3
|
-
本页记录 2026-
|
|
3
|
+
本页记录 2026-11-25 在 DSH `0.2.2-rc.5` Web 中完成的隔离验收。演示需求为「演示:需求列表快速复制分享链接」。截图来自运行中的 `dsh-spec-collab 0.5.0` 工作台。验收使用可控模型端点返回演示内容,由 DSH 执行会话和工具调用,配合浏览器和 HTTP 操作推进演示流程。
|
|
4
4
|
|
|
5
5
|
## 演示需求
|
|
6
6
|
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
## 1. 从空白表单新建需求
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
从 DSH 侧栏打开「需求讨论」,在需求栏中点击「新建需求」。填写标题、原始需求和可选的补充资料,并选择工作区。首次写入前先登记花名和角色。创建后,原始输入形成首个 Git commit,工作台自动发起产品初审。审核会话使用所选工作区。
|
|
12
12
|
|
|
13
13
|

|
|
14
14
|
|
|
15
15
|
## 2. AI 初审,产品逐项澄清
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
在「下一步」中打开阻塞问题。演示的问题是分享链接应保存哪一种页面状态。选择「只保存稳定的需求编号」,补充结论后点击「保存回答」。回答完成后,点击「让 AI 回读并生成修改」发起二次审核。
|
|
18
18
|
|
|
19
19
|

|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ AI 根据产品回答生成候选 Patch,人工在写入前检查完整正文
|
|
|
26
26
|
|
|
27
27
|

|
|
28
28
|
|
|
29
|
-
候选 Patch 绑定精确 `baseCommit
|
|
29
|
+
候选 Patch 绑定精确 `baseCommit`。在差异窗口点击「整包接受并保存」会生成新的 Git commit。工作台会发起变更审核。如果仍在澄清阶段,按「下一步」完成新版本要求的产品审核,再进入产品确认。正文改版后,旧 Ready 包、整版确认和待处理候选 Patch 会自动失效。
|
|
30
30
|
|
|
31
31
|
## 4. 产品确认并记录 Decision
|
|
32
32
|
|
|
@@ -38,11 +38,11 @@ Decision 与普通评论分离,保留结论、理由、确认人和生效状
|
|
|
38
38
|
|
|
39
39
|
## 5. 研发检查与 Ready 质量门
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
进入产研确认后,点击「开始研发检查」,重点核对现有实现、影响范围、兼容性和测试落点。生成 Ready 前,当前 commit 必须有已完成的研发预审,产品与研发都要完成整版确认,当前版本的审核和候选 Patch 均已处理,且六项内容检查全部通过。
|
|
42
42
|
|
|
43
|
-

|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
点击「生成就绪需求」,确认后选择「查看交付内容」。本次 Ready Spec 绑定 commit `a95c59dd77a2083a8df5df6f5011a1d26d52143c`,确认人为「演示产品」和「演示研发」。点击「下载 .md」可取得对应的 Ready Markdown,其中包含版本、稳定 AC、生效 Decision、来源、非阻塞待确认问题和双方整版确认人。
|
|
46
46
|
|
|
47
47
|
## 使用原则
|
|
48
48
|
|