feat: 单包 ds-bot-sansheng@0.2.8(合并 DS-Bot 与三省六部)
- scripts/build-combined.mjs 生成单包:宿主同一补丁挂两行,客户端合并入口 - 独立 profile 安装验证:无未激活插件、右栏角色页签可用、控制台无错误 - 发布说明改为单包 v0.2.8
This commit is contained in:
parent
4add2ca03d
commit
f785e1005e
|
|
@ -57,6 +57,8 @@ node --check sansheng/client.js && node --check sansheng/index.js
|
|||
|
||||
Node >= 22。测试覆盖:门禁最新判决、成果快照、项目隔离、派发幂等/恢复、状态投影、客户端注册与渲染、provision 流程。
|
||||
|
||||
单包安装版 `ds-bot-sansheng` 由 `scripts/build-combined.mjs` 从两个包生成,见 [docs/combined-package.md](docs/combined-package.md)。
|
||||
|
||||
WP0–WP7 的实施与验收状态见 [docs/verification/00-baseline.md](docs/verification/00-baseline.md)、[01-contracts.md](docs/verification/01-contracts.md)、[02-test-matrix.md](docs/verification/02-test-matrix.md)、[03-host-smoke.md](docs/verification/03-host-smoke.md)。当前是**候选版本**:隔离测试 profile 已验证真实宿主加载、右栏入口、初始化项目和角色会话;真实模型 E2E 与日常 profile 升级未执行。
|
||||
|
||||
重启后自检:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
# 单包版本 `ds-bot-sansheng`
|
||||
|
||||
## 为什么有它
|
||||
|
||||
DSH 原生按包加载插件:`ds-bot` 是底座,`dsh-sansheng-sansheng` 是治理层。为了满足“只更新一个包”的安装体验,`scripts/build-combined.mjs` 把两者合并成一个可安装包 `ds-bot-sansheng`:
|
||||
|
||||
- 宿主半:DS-Bot 的 `index.js` + 三省六部的 `sansheng/index.js`,由同一个补丁挂载为两个插件行;
|
||||
- 客户端半:把 `ds-bot/client.js` 与 `sansheng/client.js` 合并为一个客户端入口,先应用三省六部(写入共存标记),再应用 DS-Bot;
|
||||
- 补丁:`bot`、`web-search-auto`、`sansheng` 三行;`web` 的搜索配置保留。
|
||||
|
||||
它仍然是一个 fork:DS-Bot 上游升级后,需要重新运行构建脚本并做宿主冒烟测试。
|
||||
|
||||
## 构建
|
||||
|
||||
```powershell
|
||||
node scripts/build-combined.mjs
|
||||
```
|
||||
|
||||
生成 `.scratch/combined/`,再打包:
|
||||
|
||||
```powershell
|
||||
pnpm --dir .scratch/combined pack --pack-destination dist
|
||||
```
|
||||
|
||||
产物:`dist/ds-bot-sansheng-0.2.8.tgz`。
|
||||
|
||||
## 安装
|
||||
|
||||
1. 从 Gitea Release 下载 `ds-bot-sansheng-0.2.8.tgz`;
|
||||
2. 在 DSH 插件页安装该 tgz(或 `dsh plugin --profile <name> add file:<abs path>`);
|
||||
3. 把 profile 的 `dsh.profile.bundles` 里旧的 `ds-bot`、`dsh-sansheng-sansheng` 替换为 `ds-bot-sansheng`;
|
||||
4. 彻底重启 DSH。
|
||||
|
||||
## 已验证
|
||||
|
||||
在独立测试 profile(独立 `DSH_HOME`)安装本单包并启动 Web:
|
||||
|
||||
- 启动无未激活插件;
|
||||
- `__SANSENG_WORKBENCH__=true`;
|
||||
- 原生项目树/聊天保留,DS-Bot 全局 shell 未接管;
|
||||
- 右栏「三省 → 角色」页签可打开,未初始化项目显示初始化入口;
|
||||
- 浏览器控制台无页面错误。
|
||||
|
||||
真实模型 E2E、长工具流和日常 desktop profile 未验证。
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
# 验收矩阵与证据状态(候选版本 v0.2.7)
|
||||
# 验收矩阵与证据状态(候选版本 v0.2.8)
|
||||
|
||||
日期:2026-11-14
|
||||
结论:**候选版本**。仓库内自动化回归 **168/168 通过**;已在隔离测试 profile(独立 DSH_HOME,宿主 0.2.2-rc.3)完成真实宿主冒烟:原生项目树、原生聊天、右栏三卡与 Bot 切换,DS-Bot 全局 shell 未接管,控制台无 DS-Bot 重挂/设置冲突警告,证据见 `03-host-smoke.md`。真实模型 E2E(E01–E04)、长消息/连续工具流仍缺失;用户日常 desktop profile 未修改。
|
||||
结论:**候选版本**。仓库内自动化回归 **168/168 通过**;已在隔离测试 profile(独立 DSH_HOME,宿主 0.2.2-rc.3)完成真实宿主冒烟:原生项目树、原生聊天、右栏三卡与 Bot 切换,DS-Bot 全局 shell 未接管,控制台无 DS-Bot 重挂/设置冲突警告,证据见 `03-host-smoke.md`。真实模型 E2E(E01–E04)、长消息/连续工具流仍缺失;单包 `ds-bot-sansheng@0.2.8` 已在独立 profile 启动验证:无未激活插件、`__SANSENG_WORKBENCH__=true`、右栏角色页签可打开;用户日常 desktop profile 未修改。
|
||||
|
||||
## 1. 自动化测试入口
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ profile `web-test` 的 bundles:`@deepseek-ai/dsh-base`、`@deepseek-ai/dsh-web
|
|||
| 深色/窄屏 | 深色 1440×900 与窄屏 900×700 下原生项目树/聊天/输入框保持;900 宽时侧栏收成图标,底部「三省」仍可点开右栏角色页签;无页面错误 | `evidence/host-dark.png`、`evidence/host-narrow.png` |
|
||||
| v0.2.5 重启检查 | `/sansheng/health` 200:store `ok`、registry `ok`、`writable:true`、`governance:true`、Bot 4;Q04 memory 集成只改插件代码,未影响隔离宿主加载 | 本次 HTTP 响应 |
|
||||
| v0.2.7 第四轮共存 | 浏览器 `marker=true`、`dsShell=false`、原生项目树/聊天保留、控制台 0 条 DS-Bot 重挂/设置冲突警告;右栏「角色」「Bot 切换」可打开 | 本次 Chromium 探测 |
|
||||
| v0.2.8 单包 `ds-bot-sansheng` | 独立 profile 只装 `ds-bot-sansheng@0.2.8`:启动无未激活插件;`__SANSENG_WORKBENCH__=true`;原生项目树/聊天保留;新建会话后右栏「角色」显示未初始化项目;控制台无错误 | 独立 `C:\dsh-single-test` profile |
|
||||
|
||||
HTTP 响应原文(初始空状态):
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# 发布说明(候选版本 v0.2.7 / ds-bot 0.3.2-sansheng.7)
|
||||
# 发布说明(候选版本 v0.2.8 · 单包 `ds-bot-sansheng`)
|
||||
|
||||
日期:2026-11-14
|
||||
状态:**候选版本**。可用于隔离测试环境;用户日常 desktop profile 未由实施者修改。
|
||||
|
|
@ -7,10 +7,15 @@
|
|||
|
||||
| 包 | 版本 | 文件 |
|
||||
| --- | --- | --- |
|
||||
| `dsh-sansheng-sansheng` | 0.2.7 | `dist/dsh-sansheng-sansheng-0.2.7.tgz` |
|
||||
| `ds-bot`(上游 0.3.2 + M-01–M-06) | 0.3.2-sansheng.7 | `dist/ds-bot-0.3.2-sansheng.7.tgz` |
|
||||
| `ds-bot-sansheng`(DS Bot 0.3.2 底座 + 三省六部治理层) | 0.2.8 | `dist/ds-bot-sansheng-0.2.8.tgz` |
|
||||
|
||||
云端发布:**已发布预发布 `v0.2.7-sansheng`**(2026-11-14)。分支 `feat/dsbot` 已推送至 Gitea,提交 `fa75b6e`;单包 asset `sansheng-liubu-v0.2.7-sansheng.zip` 已上传,内含 `dsh-sansheng-sansheng-0.2.7.tgz` 与 `ds-bot-0.3.2-sansheng.7.tgz`。发布页:https://git.qyhhh.top/DeepsSeekHarness/dsh-sansheng-liubu/releases/tag/v0.2.7-sansheng 。日常 desktop profile 未由实施方修改。
|
||||
云端发布:**已发布预发布 `v0.2.8-sansheng`**(2026-11-14)。分支 `feat/dsbot` 已推送至 Gitea;单包 asset `ds-bot-sansheng-0.2.8.tgz` 已上传。发布页:https://git.qyhhh.top/DeepsSeekHarness/dsh-sansheng-liubu/releases/tag/v0.2.8-sansheng 。历史 `v0.2.7-sansheng` 保留为双包/zip 记录,日常 desktop profile 未由实施方修改。
|
||||
|
||||
### v0.2.8 变更(单包)
|
||||
|
||||
- 新增 `scripts/build-combined.mjs`:把 `ds-bot` 与 `dsh-sansheng-sansheng` 合并成一个可安装包 `ds-bot-sansheng`;宿主半同一补丁挂载两行,客户端半先应用三省六部再应用 DS-Bot。
|
||||
- 独立测试 profile 安装单包并启动 Web:无未激活插件;`__SANSENG_WORKBENCH__=true`;原生项目树/聊天保留;右栏「角色」页签可打开;控制台无页面错误。
|
||||
- 旧的两个包仍可继续使用;单包用于“只需更新一个包”的场景。DS-Bot 上游升级后需重新运行构建脚本。
|
||||
|
||||
### v0.2.7 变更(第四轮复审)
|
||||
|
||||
|
|
@ -60,23 +65,24 @@ node <path-to-pnpm.cjs> pack --pack-destination ..\dist
|
|||
|
||||
- 宿主:DeepSeek Harness 0.2.2-rc.3(本机真实宿主冒烟版本);0.2.x 同代接口按 `docs/p0` 记录。
|
||||
- Node:>= 22(本机 24.21.0)。
|
||||
- 两个包必须一起升级:`sansheng` 依赖 `ds-bot` 的 M-01 运行时句柄、M-04 投递边界、M-05 记忆域。
|
||||
仅升级 `sansheng` 会导致项目隔离与自动返工不可用;仅升级 `ds-bot` 不影响上游行为,但新工作台无入口。
|
||||
- 单包 `ds-bot-sansheng` 内含 DS-Bot 与三省六部,二者版本一起发布;不再需要分别升级两个包。
|
||||
- 旧双包布局仍可继续使用;不要在同一个 profile 同时启用单包与旧的两个包,否则会重复注册 Bot 行、右栏页签和工具。
|
||||
|
||||
## 3. 安装 / 升级(用户自行执行)
|
||||
|
||||
1. 备份(用 Git,不建 backup 目录):确认日常 profile 的 `package.json` 与 `cordis.patch.yml` 已在 Git 控。
|
||||
2. 停旧包:从 `dsh.profile.bundles` 移除 `dsh-sansheng-liubu-mode`(不要让旧十席与新方案同时注册入口)。
|
||||
3. 安装两个 tarball:
|
||||
2. 从 `dsh.profile.bundles` 移除旧的 `ds-bot` 与 `dsh-sansheng-sansheng`(若之前用的是双包布局)。
|
||||
3. 安装单包:
|
||||
```powershell
|
||||
dsh plugin --profile desktop add <绝对路径>\dsh-sansheng-sansheng-0.2.4.tgz <绝对路径>\ds-bot-0.3.2-sansheng.4.tgz
|
||||
dsh plugin --profile desktop add <绝对路径>\ds-bot-sansheng-0.2.8.tgz
|
||||
```
|
||||
4. 确认 `dsh.profile.bundles` 含 `dsh-sansheng-sansheng` 与 `ds-bot`。
|
||||
4. 确认 `dsh.profile.bundles` 含 `ds-bot-sansheng`,且不再含旧的 `ds-bot` / `dsh-sansheng-sansheng`。
|
||||
5. 彻底重启 DSH(插件宿主半改动只有重启生效)。
|
||||
6. 自检:
|
||||
- 打开任一项目会话,左栏底部出现「三省」;点击后在右栏看到「角色」页签。
|
||||
- 未绑定项目显示「此项目尚未初始化」;初始化表单默认折叠。
|
||||
- 已绑定项目显示三张角色卡,点击卡片打开对应 Bot 真实会话。
|
||||
- 启动日志没有“未激活插件”;
|
||||
- 打开任一项目会话,左栏底部出现「三省」;点击后在右栏看到「角色」页签;
|
||||
- 未绑定项目显示「此项目尚未初始化」;初始化表单默认折叠;
|
||||
- 已绑定项目显示三张角色卡,点击卡片打开对应 Bot 真实会话;
|
||||
- `GET /sansheng/health` 返回 `governance: true`。
|
||||
|
||||
## 4. 回退
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
https://git.qyhhh.top/DeepsSeekHarness/dsh-sansheng-liubu/releases/tag/v0.2.2-sansheng
|
||||
- 发布产物:`dist/dsh-sansheng-sansheng-0.2.2.tgz`、`dist/ds-bot-0.3.2-sansheng.2.tgz`
|
||||
- 审查修复 v0.2.3:本地提交(当前 HEAD)(`dsh-sansheng-sansheng@0.2.3` / `ds-bot@0.3.2-sansheng.3`),144/144 回归;按审查“不授权推送/发布”暂未推 Gitea,tarball 只在 `dist/`。
|
||||
- 第四轮审查修复 v0.2.7:`dsh-sansheng-sansheng@0.2.7` / `ds-bot@0.3.2-sansheng.7`,168/168 回归;已推送 `feat/dsbot`(`fa75b6e`)并发布预发布 `v0.2.7-sansheng`,单包 `sansheng-liubu-v0.2.7-sansheng.zip` 作为 release asset 上传(内含两个 tarball)。
|
||||
- 第四轮审查修复 v0.2.8:单包 `ds-bot-sansheng@0.2.8`,168/168 回归;独立 profile 启动验证通过;已推送 `feat/dsbot` 并发布预发布 `v0.2.8-sansheng`,单包 `ds-bot-sansheng-0.2.8.tgz` 作为 release asset 上传。
|
||||
- 当前状态:候选版本,真实模型 E2E(E01–E04)未执行;日常 desktop profile 未修改。
|
||||
|
||||
> 说明:仓库的 `master` 分支仍是旧版结构(工作台/panel 目录),与 `feat/dsbot` 不在同一历史线。
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
import { cp, mkdir, readFile, rm, writeFile } from 'node:fs/promises'
|
||||
import { join } from 'node:path'
|
||||
|
||||
const root = process.cwd()
|
||||
const stage = join(root, '.scratch', 'combined')
|
||||
const ds = join(root, 'ds-bot')
|
||||
const ss = join(root, 'sansheng')
|
||||
|
||||
await rm(stage, { recursive: true, force: true })
|
||||
await mkdir(stage, { recursive: true })
|
||||
for (const item of ['index.js', 'src', 'office.js', 'web-search.js', 'cordis.patch.yml', 'README.md', 'LICENSE', 'NOTICE', 'package.json']) {
|
||||
await cp(join(ds, item), join(stage, item), { recursive: true })
|
||||
}
|
||||
await mkdir(join(stage, 'sansheng'), { recursive: true })
|
||||
await cp(join(ss, 'index.js'), join(stage, 'sansheng', 'index.js'))
|
||||
await cp(join(ss, 'src'), join(stage, 'sansheng', 'src'), { recursive: true })
|
||||
|
||||
const manifest = JSON.parse(await readFile(join(stage, 'package.json'), 'utf8'))
|
||||
manifest.name = 'ds-bot-sansheng'
|
||||
manifest.version = '0.2.8'
|
||||
manifest.description = 'DS Bot 底座 + 三省六部治理层的单包版本。'
|
||||
manifest.files = [...new Set([...(manifest.files ?? []), 'sansheng', 'client.js'])]
|
||||
await writeFile(join(stage, 'package.json'), JSON.stringify(manifest, null, 2) + '\n', 'utf8')
|
||||
|
||||
await writeFile(join(stage, 'cordis.patch.yml'), `- insert:
|
||||
- id: bot
|
||||
name: 'ds-bot-sansheng'
|
||||
- id: web-search-auto
|
||||
name: './web-search.js'
|
||||
- id: sansheng
|
||||
name: './sansheng/index.js'
|
||||
|
||||
- id: web
|
||||
config:
|
||||
searchProvider: auto
|
||||
fetchProvider: http
|
||||
`, 'utf8')
|
||||
|
||||
const dsClient = (await readFile(join(ds, 'client.js'), 'utf8')).replace("id: 'ds-bot'", "id: 'ds-bot-internal'")
|
||||
const ssClient = (await readFile(join(ss, 'client.js'), 'utf8')).replace("id: 'dsh-sansheng-sansheng'", "id: 'sansheng-internal'")
|
||||
await writeFile(join(stage, 'client.js'), `${dsClient}\n${ssClient}\nwindow.__ModuleLoader__.load({
|
||||
id: 'ds-bot-sansheng',
|
||||
factory: (require) => {
|
||||
const ds = require('ds-bot-internal')
|
||||
const ss = require('sansheng-internal')
|
||||
const apply = (ctx) => {
|
||||
const first = ss.apply?.(ctx)
|
||||
const second = ds.apply?.(ctx)
|
||||
return () => {
|
||||
try { second?.() } catch { /* ignore */ }
|
||||
try { first?.() } catch { /* ignore */ }
|
||||
}
|
||||
}
|
||||
const inject = [...new Set([...(ds.inject ?? []), ...(ss.inject ?? [])])]
|
||||
return { ...ds, ...ss, apply, ...(inject.length > 0 ? { inject } : {}) }
|
||||
},
|
||||
})
|
||||
`, 'utf8')
|
||||
console.log(stage)
|
||||
Loading…
Reference in New Issue