dsh-taskbridge 1.5.2 → 1.5.3

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 CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.3 — 验收展示、混合换行与指挥规则修复(2026-11-17)
4
+
5
+ - 验收摘要仅显示结论、时间与保存状态;完整意见在详情中阅读,未确认保存成功时不提前显示通过。
6
+ - 修复完整审查意见的长路径与连续字符串换行,保留全部正文、原始换行及按需读取、复制和刷新。
7
+ - Codex 托管模板按全文准确识别 LF/CRLF/混合换行;额外独立 CR、BOM、空白、正文或版本改动仍受保护,新写入统一 LF,写删前精确复核原字节。
8
+ - 增加指挥端规划与按需拆单规则:先明确目标、方案、责任和验收,再派当前可执行工单,交付后集中审查。该规则不构成运行时行为拦截。
9
+ - 保留已发布 1.5.2 及真实本地 test.1/test.2 模板的准确升级身份;沿用现有提供方、模型、权限和等待协议。
10
+ - 本版汇总已验收测试候选;任务名称保存、分组与目标树不在本次更新内。验证范围与更新方法见 docs/releases/1.5.3.zh.md。
11
+
12
+ ## 1.5.3-test.2 — 验收展示、全文排版与混合换行修复(本地测试版,2026-11-17)
13
+
14
+ - 纳入 G10:验收摘要只显示结论、时间和保存状态,避免与完整意见正文重复;未确认保存成功时不提前显示通过。
15
+ - 纳入 G11:完整意见保留所有字符与换行,长路径及连续字符串在容器内换行,保留全文读取、复制和刷新。
16
+ - 纳入 G12:准确识别已知模板的 LF/CRLF/混合形式;额外独立 CR、正文或版本改动仍不认领,新受管文件统一 LF,写删并发保护保持精确。
17
+ - 保留 test.1 的 P0 指挥规则,并以实际已安装模板的准确样本支持 test.1 升级,不从当前正文推导历史身份。
18
+ - 此为新的本地测试包;任务名称/分组/目标树尚未实现。包前回归和真实安装结果另存验证报告,未发布 npm/GitHub。
19
+
20
+ ## 1.5.3-test.1 — 指挥端规划与按需拆单(本地测试版,2026-11-16)
21
+
22
+ - 新增 P0 指挥规则:指挥端先确定目标、方案、接口、依赖和验收,再派当前可执行的小工单。简单内聚任务可一次完成;多阶段目标按需拆分,不能把整个待办清单交给执行端自行规划。
23
+ - 每单明确工作目标、已选方案、文件责任、约束及验收;交付后由指挥端集中审查并记录结论,再推进有依赖的工作。修正续接原任务,独立工作另建会话。
24
+ - 规划、规则、用户报告、审查结论与更新日志由指挥端负责。只验证的工单不得自行修改规则、实现或测试断言。
25
+ - 在派工工具及 prompt 说明中加入简短提醒;保留用户选择的 API、模型、思考强度及原有审批、静默等待和续接协议。
26
+ - 登记已发布 1.5.2 模板的准确 LF/CRLF 身份,验证原版升级、幂等和自定义内容保留。包清单、锁文件和托管模板同步标记为测试版。
27
+ - 本包只交付以上规则和迁移支持。任务名称/任务树、审阅显示和 Codex 混合换行识别问题仍待后续修复;不包含真实安装生效或新 token 节省比例的声明。
28
+
3
29
  ## 1.5.2 — 产品介绍更新(2026-11-15)
4
30
 
5
31
  - 重写插件列表与 npm 简介,突出让 Codex 指挥 DSH,并在插件中配置已有 API、执行模型和思考强度。
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # DSH TaskBridge
2
2
 
3
+ > 当前版本:**1.5.3**。本次小更新修复验收摘要、完整审查意见排版与 Codex 模板混合换行识别,并加入指挥端规划和按需拆单规则。详见[更新说明](docs/releases/1.5.3.zh.md)。
4
+
3
5
  **让 Codex 指挥 DSH 工作,在 DSH 插件里选择执行所用的 API、模型和思考强度。**
4
6
 
5
7
  > **当前支持 Codex 端。Claude Code 与 Claude Desktop 接入预计在 2.0 版本上线。**
@@ -56,7 +58,7 @@ dsh-taskbridge
56
58
  也可以指定本次版本:
57
59
 
58
60
  ```text
59
- dsh-taskbridge@1.5.2
61
+ dsh-taskbridge@1.5.3
60
62
  ```
61
63
 
62
64
  安装后启用 **DSH TaskBridge**,进入该插件的设置页面。若使用的区域镜像尚未同步新版本,可切换到 npm 官方源;本项目 GitHub Release 也提供 `.tgz` 安装包。
@@ -260,7 +262,8 @@ TaskBridge 自身无需 dsh-crew。执行任务使用的项目依赖仍按任务
260
262
  | [会话放置与续接](docs/conversation-placement.md) | DSH 工作区命名、会话创建和同任务续接。 |
261
263
  | [插件发现与更新](docs/plugin-market.md) | 自定义索引、npm 与 GitHub 安装来源。 |
262
264
  | [旧名称迁移](docs/taskbridge-upgrade.md) | 从 DSH Delegate / TaskDispatch 升级。 |
263
- | [1.5.2 更新说明](docs/releases/1.5.2.zh.md) | 本次介绍更新的内容与验证范围。 |
265
+ | [1.5.3 更新说明](docs/releases/1.5.3.zh.md) | 验收展示、全文排版、混合换行修复与指挥规则更新。 |
266
+ | [1.5.2 更新说明](docs/releases/1.5.2.zh.md) | 产品介绍更新及验证范围。 |
264
267
 
265
268
  本插件不按 DSH 版本白名单筛选,所需接口按运行时实际能力检查;具体说明见 [运行时说明](docs/runtime-compatibility.md)。CLI 独立执行通道及所有运行环境组合尚未完成,已知限制见 [1.5.1 说明](docs/releases/1.5.1.zh.md)。
266
269
 
@@ -300,13 +303,13 @@ profile 是**应用保留的**:npm / `dsh plugin` CLI 对该 profile 的操作
300
303
  Desktop 侧的包操作只能交给应用完成——不要在 Desktop 的正式 profile 里执行 npm/pnpm
301
304
  命令,也不要直接编辑其中的文件。
302
305
 
303
- 1. 打开 Desktop 的 **Plugins manager → 添加插件**,输入 **`dsh-taskbridge@1.5.2`**。
306
+ 1. 打开 Desktop 的 **Plugins manager → 添加插件**,输入 **`dsh-taskbridge@1.5.3`**。
304
307
  若中国大陆镜像尚未同步,先选择 npm 官方源再重试。安装后的显示名为 **DSH TaskBridge**。
305
308
  也可以从本项目 Release 下载 `.tgz`,或在仓库根目录打包:
306
309
 
307
310
  ```bash
308
311
  npm pack
309
- # → dsh-taskbridge-1.5.2.tgz
312
+ # → dsh-taskbridge-1.5.3.tgz
310
313
  ```
311
314
 
312
315
  2. 使用本地包时,通过 **添加插件**入口选择下载或生成的 `.tgz`(或本仓库目录)完成安装。
@@ -320,7 +323,7 @@ Desktop 侧的包操作只能交给应用完成——不要在 Desktop 的正式
320
323
 
321
324
  ```bash
322
325
  # 装进一个 profile(例:web)
323
- dsh plugin --profile web add ./dsh-taskbridge-1.5.2.tgz && dsh plugin --profile web why dsh-taskbridge
326
+ dsh plugin --profile web add ./dsh-taskbridge-1.5.3.tgz && dsh plugin --profile web why dsh-taskbridge
324
327
 
325
328
  # 启动(首次启动会自动把插件 bundle 追加到 dsh.profile.bundles)
326
329
  dsh --profile web
@@ -333,7 +336,7 @@ dsh --profile web
333
336
  ### 说明与注意
334
337
 
335
338
  - **不要装进你正在用的正式 profile 做试验。** 建议先用一次性 profile:
336
- `dsh plugin --profile dsh-delegate-try add ./dsh-taskbridge-1.5.2.tgz`,再把
339
+ `dsh plugin --profile dsh-delegate-try add ./dsh-taskbridge-1.5.3.tgz`,再把
337
340
  `DSH_HOME` 指向临时目录做隔离验证。该命令同样只用于 CLI profile。
338
341
  - 该包声明了 `@deepseek-ai/dsh-*` 的 peer,若你的包管理器默认自动安装 peer,
339
342
  安装过程会尝试解析这些版本。可显式关闭:`npm_config_auto_install_peers=false`
@@ -768,7 +771,7 @@ Codex 子智能体现在按「提交 → `delegate_wait` 同一任务」运作
768
771
  # 不要在 Desktop 的正式 profile 下执行下面的 CLI 命令。
769
772
 
770
773
  # CLI web profile 的升级:换成本地新包或(将来)新版本
771
- dsh plugin --profile web add ./dsh-taskbridge-1.5.2.tgz
774
+ dsh plugin --profile web add ./dsh-taskbridge-1.5.3.tgz
772
775
 
773
776
  # 导出:界面里"导出非敏感配置"按钮,或用只读 API
774
777
  # GET /api/dsh-delegate/settings
@@ -1,7 +1,7 @@
1
1
  # dsh-taskbridge Codex companion — managed by the DSH TaskBridge plugin settings page.
2
2
  # Editing this file turns it into an operator-owned file: the plugin then never
3
3
  # overwrites or removes it, and reports it as "modified" instead.
4
- version = "1.5.2"
4
+ version = "1.5.3"
5
5
 
6
6
  name = "dsh-taskbridge"
7
7
  description = "Dispatch an explicitly assigned implementation task to DSH through the dsh-taskbridge MCP tools, then return evidence for Codex review."
@@ -23,6 +23,43 @@ ACTIVATION (check this before anything else)
23
23
  4. If it is unclear whether this task was explicitly assigned, ask one short
24
24
  clarifying question instead of dispatching.
25
25
 
26
+ P0: COMMANDER-OWNED PLANNING AND WORK PACKETS (for authorized implementation tasks)
27
+ 1. The coordinating model owns the plan. This applies to the parent commander and
28
+ this @-agent: do not merely forward an undivided user request to DSH. First define
29
+ the intended outcome, make the main design and interface decisions, identify the
30
+ dependencies, and set acceptance criteria. Then choose the next work packet.
31
+ Rules, plans, review decisions, user reports and release notes are commander's
32
+ deliverables unless the operator explicitly assigns their authorship otherwise.
33
+ 2. Size work by cohesion and a useful verification boundary. A simple, complete task
34
+ can be one packet, including the few related files and tests it needs. Break a
35
+ larger goal into dependent packets when it contains separable decisions or stages.
36
+ Do not impose a file-count or prompt-length quota, split a small fix into needless
37
+ fragments, or hand over an entire multi-stage backlog as one implementation task.
38
+ 3. Send only the current ready packet. State its work-content title, small objective,
39
+ chosen approach and contracts, owned files or modules, constraints, and concrete
40
+ acceptance checks. Include only the context needed for that work. A roadmap may
41
+ explain dependencies but does not authorize the worker to implement future packets.
42
+ The worker makes routine implementation choices inside this boundary; product
43
+ scope, cross-packet design and changes to the plan stay with the commander.
44
+ 4. Follow the dependency order: dispatch, wait silently, review the delivered diff
45
+ and evidence, then record the review before advancing dependent work. Consolidate
46
+ defects into one correction packet using continueFromTaskId for that same task.
47
+ A different work unit gets a new task conversation; do not chain the whole project
48
+ into one conversation merely to keep context or avoid another preflight.
49
+ 5. Parallel packets require independent work, explicit non-conflicting ownership,
50
+ and permission under the operator's request and the repository's AGENTS.md. Do
51
+ not enable Agent Teams by default. The operator still selects provider, model
52
+ and reasoning effort; smaller packets never authorize a different execution route.
53
+ 6. A blocker or a design question outside the packet goes back to the commander.
54
+ The worker must not expand its scope, execute the remaining roadmap, or become
55
+ its own final reviewer. For a verification-only packet, the implementation and
56
+ rules are read-only: run the agreed checks and report evidence; do not fix a
57
+ failing check without a separate correction assignment from the commander.
58
+ 7. If a parent supplies a broad multi-stage assignment, the coordinating model must
59
+ first turn it into the next bounded packet. An explicit @ mention authorizes the
60
+ task; it does not remove this planning duty. Keep all activation, approval, silent
61
+ waiting, review and continuation rules below while applying this P0 rule.
62
+
26
63
  DISPATCH (only for an explicitly assigned implementation task)
27
64
  1. PREFLIGHT FACTS FIRST — FOR A NEW TASK. Call `delegate_status` first, then call
28
65
  `delegate_preflight` with the exact authorized workspace path as
@@ -56,7 +56,7 @@ dsh-taskbridge
56
56
  To install this specific release:
57
57
 
58
58
  ```text
59
- dsh-taskbridge@1.5.2
59
+ dsh-taskbridge@1.5.3
60
60
  ```
61
61
 
62
62
  Enable **DSH TaskBridge** and open its settings. Use the official npm registry if a regional mirror has not synchronized yet. GitHub Releases also provide `.tgz` packages.
@@ -260,7 +260,8 @@ The goal for 2.0 is to let more commanders use the execution models configured i
260
260
  | [Conversation placement](conversation-placement.md) | Workspace naming, conversation creation and explicit continuation. |
261
261
  | [Plugin discovery and updates](plugin-market.md) | Custom indexes, npm and GitHub installation sources. |
262
262
  | [Migration](taskbridge-upgrade.md) | Upgrading from DSH Delegate / TaskDispatch. |
263
- | [1.5.2 release notes](releases/1.5.2.zh.md) | This introduction update and its validation scope. |
263
+ | [1.5.3 release notes](releases/1.5.3.zh.md) | Review summaries, full-note layout, mixed line endings, and commander planning rules. |
264
+ | [1.5.2 release notes](releases/1.5.2.zh.md) | The introduction update and its validation scope. |
264
265
 
265
266
  TaskBridge uses runtime capability checks rather than a DSH version whitelist; see [runtime notes](runtime-compatibility.md). A separate CLI execution channel and validation of every runtime environment are not complete. Existing limits are documented in the [1.5.1 notes](releases/1.5.1.zh.md).
266
267
 
@@ -56,7 +56,7 @@ dsh-taskbridge
56
56
  也可以指定本次版本:
57
57
 
58
58
  ```text
59
- dsh-taskbridge@1.5.2
59
+ dsh-taskbridge@1.5.3
60
60
  ```
61
61
 
62
62
  安装后启用 **DSH TaskBridge**,进入该插件的设置页面。若使用的区域镜像尚未同步新版本,可切换到 npm 官方源;本项目 GitHub Release 也提供 `.tgz` 安装包。
@@ -260,7 +260,8 @@ TaskBridge 自身无需 dsh-crew。执行任务使用的项目依赖仍按任务
260
260
  | [会话放置与续接](conversation-placement.md) | DSH 工作区命名、会话创建和同任务续接。 |
261
261
  | [插件发现与更新](plugin-market.md) | 自定义索引、npm 与 GitHub 安装来源。 |
262
262
  | [旧名称迁移](taskbridge-upgrade.md) | 从 DSH Delegate / TaskDispatch 升级。 |
263
- | [1.5.2 更新说明](releases/1.5.2.zh.md) | 本次介绍更新的内容与验证范围。 |
263
+ | [1.5.3 更新说明](releases/1.5.3.zh.md) | 验收展示、全文排版、混合换行修复与指挥规则更新。 |
264
+ | [1.5.2 更新说明](releases/1.5.2.zh.md) | 产品介绍更新及验证范围。 |
264
265
 
265
266
  本插件不按 DSH 版本白名单筛选,所需接口按运行时实际能力检查;具体说明见 [运行时说明](runtime-compatibility.md)。CLI 独立执行通道及所有运行环境组合尚未完成,已知限制见 [1.5.1 说明](releases/1.5.1.zh.md)。
266
267
 
@@ -1,6 +1,6 @@
1
1
  # Codex integration contract
2
2
 
3
- Status: implemented in 1.5.2 (1.1.0 introduced wait rules, 1.2.0 added installed-integration upgrades, 1.4.0 clarifies outer long waits and explicit host-review recording). This automatic installer covers Codex, the currently supported client. Claude Code and Claude Desktop integration is planned for 2.0; see the separate roadmap.
3
+ Status: implemented in 1.5.3 (commander-owned planning, bounded work packets, and mixed-line-ending template upgrades). This automatic installer covers Codex, the currently supported client. Claude Code and Claude Desktop integration is planned for 2.0; see the separate roadmap.
4
4
 
5
5
  1.5.1 refreshes the manifest on each activation, resolves a normal linked home root, and upgrades exact shipped/candidate templates while preserving custom content. See [1.5.1 notes](releases/1.5.1.zh.md).
6
6
 
@@ -526,7 +526,7 @@ successful diagnosis.
526
526
  ```jsonc
527
527
  {
528
528
  "codexHome": "…",
529
- "packageVersion": "1.5.2",
529
+ "packageVersion": "1.5.3",
530
530
  "boundary": { "blocked": false, "link": null, "unknown": false, "home": "directory", "agents": "directory" },
531
531
  "agent": {
532
532
  "path": "…", "state": "installed", "installed": true, "managed": true,
@@ -15,7 +15,7 @@ https://ranranyya.github.io/dsh-taskbridge/index.json
15
15
  3. 搜索 **DSH TaskBridge** 或 **dsh-taskbridge**。
16
16
  4. 安装确认框应显示本项目 GitHub 仓库和精确提交。核对后安装,不要改填别人的 `dsh-delegate` 或 `dsh-dispatch` npm 包。
17
17
 
18
- 当前索引采用固定 Git 提交作为安装来源,不依赖本机 npm 登录。另一种安装方式是直接在“添加插件”中输入 `dsh-taskbridge@1.5.2`,无需添加索引;若中国大陆镜像未同步,改选 npm 官方源。GitHub Release 同时提供 `.tgz` 和 SHA256 文件。
18
+ 当前索引采用固定 Git 提交作为安装来源,不依赖本机 npm 登录。另一种安装方式是直接在“添加插件”中输入 `dsh-taskbridge@1.5.3`,无需添加索引;若中国大陆镜像未同步,改选 npm 官方源。GitHub Release 同时提供 `.tgz` 和 SHA256 文件。
19
19
 
20
20
  ## 新版本
21
21
 
@@ -0,0 +1,28 @@
1
+ # 1.5.3-test.1 本地测试版说明
2
+
3
+ 日期:2026-11-16。基于正式版 1.5.2,只更新指挥规则及其迁移支持。
4
+
5
+ ## 本次效果
6
+
7
+ 指挥端先明确总目标、主要方案、接口、依赖及验收,再选择当前工作包派给 DSH。简单且内聚的任务仍可一次完成;包含可分离阶段的大任务必须按需拆分。执行端只负责当前工单,不能自行实现整个路线图。
8
+
9
+ 每单交付后,指挥端集中审查、记录结论,再推进依赖任务。有问题续接该任务;独立工作使用新会话。规划、规则、报告及更新日志由指挥端编写。只验证的工单不允许修改候选规则、实现或测试断言。
10
+
11
+ 派工工具的说明同步增加提醒。API、执行模型、思考强度仍取自用户设置;审批、静默等待和续接机制保持原有协议。
12
+
13
+ ## 安装与验证
14
+
15
+ 1. 在 DSH 插件管理器中添加本地 `dsh-taskbridge-1.5.3-test.1.tgz`。这是同一插件的预发布包,会更新该 profile 中的 TaskBridge。
16
+ 2. 启用插件后,确认设置页的 Codex 集成已更新到 `1.5.3-test.1`;需要时点击更新 Codex 集成。
17
+ 3. 使用新的 Codex 对话或重新加载集成后再测试 `@dsh-taskbridge`。包内新规则不会改变已开始的执行任务。
18
+ 4. 用一个包含多个阶段的需求验证:指挥端先给出方案和当前小工单,DSH 交付并审查后才推进下一阶段。
19
+
20
+ 已发布 1.5.2 原版模板的 LF/CRLF 升级、重复更新及用户自定义规则保留有自动测试覆盖。此前 P0 候选的 184 项规则与协议测试通过;本测试包另做版本、分发和解包验证,具体结果随本地验证报告提供。
21
+
22
+ ## 尚未覆盖
23
+
24
+ - G01/G02/G03/G04/G09 的名称、分组与任务树尚未实现。
25
+ - G10/G11 的验收摘要和完整审阅意见排版尚未修复。
26
+ - G12 的已知混合换行模板识别问题仍存在;若 Codex 集成提示模板不属于已知版本,本次升级不能视为规则已经生效,需要单独处理。
27
+ - 本轮规则属于指挥行为约定,不是强制执行所有模型规划行为的运行时拦截器。
28
+ - 本地测试包未发布 npm/GitHub,不代表真实桌面安装与后续功能的验收已经完成。
@@ -0,0 +1,24 @@
1
+ # 1.5.3-test.2 本地测试版说明
2
+
3
+ 日期:2026-11-17(Asia/Shanghai)。本测试版合并已验收的 G10/G11/G12,保留 test.1 的 P0 指挥规则。
4
+
5
+ ## 本次变化
6
+
7
+ - G10:任务卡片的验收摘要显示结论、时间及保存状态;完整审查意见在详情中阅读。保存中、未确认或保存失败不提前显示为验收通过。
8
+ - G11:完整审查意见保留正文与换行,连续路径和长字符串可在容器内换行,保留按需读取、复制及刷新能力。
9
+ - G12:只容忍 LF/CRLF/混合换行的全文等价;正文、空白、BOM、独立 CR 和版本改动仍受保护。新写入的受管规则统一 LF,写删前仍精确复核原内容。
10
+ - 为已实际安装的 test.1 保存准确模板样本并提供升级支持;不以当前正文重盖旧版本推导历史身份。
11
+
12
+ ## 安装与验证
13
+
14
+ 1. 通过 DSH 原生插件管理器添加新的本地包 `dsh-taskbridge-1.5.3-test.2.tgz`,保留原 test.1 安装来源。
15
+ 2. 启用后确认插件设置页、Codex 集成及新启动的 MCP 都报告 `1.5.3-test.2`;验证旧规则正常升级,用户配置和已有历史任务保留。
16
+ 3. 检查验收摘要与详情全文,并验证真实安装包中的换行识别及用户编辑保护。
17
+ 4. 本版本实际构建、包内容、回归及真实安装结果以随本地测试包保存的最终验证报告为准。此发布说明不预先宣称真实安装已通过。
18
+
19
+ ## 范围与限制
20
+
21
+ - G01/G02/G03/G04/G09 的名称保存、分组与任务树尚未实现;G05—G08 也未随本版本新增。
22
+ - P0 规则属于指挥行为约定,不是强制所有模型规划行为的运行时拦截器。
23
+ - 本地测试包未发布 npm/GitHub;不宣称新的 token 节省比例。
24
+ - 已运行的 Codex 进程可能继续使用此前加载的工具说明;新连接的 MCP 握手和已安装文件的版本应分别核对。
@@ -0,0 +1,33 @@
1
+ # 1.5.3 — 验收展示、混合换行与指挥规则修复
2
+
3
+ 日期:2026-11-17(Asia/Shanghai)。这是基于 1.5.2 的小更新,汇总已安装验证的 1.5.3-test.2 候选。
4
+
5
+ ## 本次更新
6
+
7
+ - **验收摘要更清楚。** 任务卡片只显示结论、时间和保存状态,完整审查意见在详情中阅读;保存尚未确认或失败时不提前显示通过。
8
+ - **完整意见正常换行。** 长路径和连续字符串在容器内换行,保留全部正文和原始换行,继续支持按需读取、复制及刷新。
9
+ - **修复 Codex 模板换行识别。** 未修改的已知模板可采用 LF、CRLF 或逐行混合换行,避免仅因换行差异被误判为用户修改。新写入统一 LF;正文、空白、BOM、独立 CR 和版本改动继续受到保护,写入和删除前仍精确复核原字节。
10
+ - **加入指挥端规划与按需拆单规则。** 指挥端先明确目标、方案、责任和验收,再派当前可执行的工单;交付后集中审查,修正续接原任务。简单内聚任务可以一次完成,不强制机械拆分。
11
+ - **支持测试版升正式版。** 保留正式 1.5.2 以及真实本地 test.1/test.2 原版模板的准确身份;自定义规则继续保留,不用当前正文伪造旧模板。
12
+
13
+ ## 更新方法
14
+
15
+ 在 DSH 的 **插件 → 添加插件** 中输入:
16
+
17
+ ```text
18
+ dsh-taskbridge@1.5.3
19
+ ```
20
+
21
+ 也可安装本项目 GitHub Release 提供的 `dsh-taskbridge-1.5.3.tgz`,或使用本项目自定义插件索引。区域镜像尚未同步时可切换 npm 官方源。
22
+
23
+ 启用新版后,在 **Codex 集成** 中确认就绪;未修改的受管模板可在启动时升级,也可点击 **安装 / 更新 TaskBridge 智能体**。用户编辑过的规则不会自动覆盖,应先确认并自行处理冲突。重新加载 Codex 后使用新规则和工具说明,已打开的聊天可能仍保留旧说明。
24
+
25
+ ## 验证与边界
26
+
27
+ - test.2 候选已完成 1604 项全库回归、实际原生插件安装、验收摘要和完整意见界面检查,以及真实 Codex/MCP 就绪核对。候选界面样本的 792 字符正文与后台逐字一致,无横向溢出。
28
+ - 正式版针对真实 test.2 模板补充升级及编辑保护检查,并重新检查版本、包内容、客户端构建和回归。正式包的最终统计与校验值见本 Release 的验证摘要和 SHA256 附件。
29
+ - 正式源码完整回归 **1611/1611 通过**,0 失败、跳过或取消;相关定向检查最终 20/20 通过,客户端产物一致性检查通过。首次定向检查中的交替换行夹具构造问题已修正,未放宽产品识别或用户内容保护。
30
+ - 混合换行只用于准确识别全文等价,不授权覆盖其他用户修改。旧记录已经丢失的正文不会因升级恢复;任务历史仍沿用既有容量轮换策略。
31
+ - 指挥规则是行为约定,不是强制所有模型遵守规划流程的运行时拦截器。用户选择的提供方、模型与思考强度、权限判断及静默等待协议继续沿用。
32
+ - 本次不新增任务名称保存、分组或目标树,不新增执行通道,不宣称新的 token 节省比例。当前支持 Codex;Claude Code/Claude Desktop 接入仍为预计 2.0 的计划。
33
+ - 发布与本机安装分别记录;正式版发布不会自动把本地 test.2 安装来源改为 npm。
@@ -1,6 +1,6 @@
1
1
  # Runtime compatibility
2
2
 
3
- Build 1.5.2 retains the loading policy introduced in 1.4.2: **no DSH version whitelist**: it omits `engines.dsh`, declares
3
+ Build 1.5.3 retains the loading policy introduced in 1.4.2: **no DSH version whitelist**: it omits `engines.dsh`, declares
4
4
  host-provided `@deepseek-ai/dsh-*` peers as `*`, and publishes no DSH engine range
5
5
  in the custom plugin index. The plugin uses runtime capability checks rather than
6
6
  rejecting a host solely by its version number. Node.js `>=24` is still required.
@@ -6,7 +6,7 @@
6
6
 
7
7
  1. 等待当前任务结束,关闭旧插件的本机调用开关。
8
8
  2. 在 DSH 插件管理中停用并卸载本项目旧 `dsh-delegate` 或 `dsh-taskdispatch` 包。**保留 `<DSH_HOME>/data/dsh-delegate` 数据目录**;DSH 若提供删除数据选项,不要勾选。新旧包不能同时启用。
9
- 3. 在“添加插件”中输入 **`dsh-taskbridge@1.5.2`**。中国大陆镜像未同步时改选 npm 官方源。也可安装本项目 Release 的 `dsh-taskbridge-1.5.2.tgz`,或添加本项目固定 Git 提交的自定义索引。不要手动修改 Desktop 保留的 profile。
9
+ 3. 在“添加插件”中输入 **`dsh-taskbridge@1.5.3`**。中国大陆镜像未同步时改选 npm 官方源。也可安装本项目 Release 的 `dsh-taskbridge-1.5.3.tgz`,或添加本项目固定 Git 提交的自定义索引。不要手动修改 Desktop 保留的 profile。
10
10
  4. 打开 **DSH TaskBridge** 配置页,核对 API、模型、思考强度和总开关。数据目录与旧版相同;安装前关闭旧开关,避免恢复之前保存的开启状态。
11
11
  5. 在 Codex 集成中点击“安装 / 更新 TaskBridge 智能体”,更新智能体及 MCP,然后重新加载 Codex。未修改的旧 `dsh-delegate.toml` 会迁移为 `dsh-taskbridge.toml`;修改过的文件保留。只需修复 MCP 时可使用“仅修复 MCP 配置”。启动自检不会接管其他安装目录。
12
12
  6. 若添加过旧索引,改用 `https://ranranyya.github.io/dsh-taskbridge/index.json`。
@@ -1,4 +1,4 @@
1
- # Worker session permissions (1.5.2; historical 1.0.0–1.2.0 audits retained)
1
+ # Worker session permissions (1.5.3; historical 1.0.0–1.2.0 audits retained)
2
2
 
3
3
  This document describes the worker sandbox, per-call approval and ordinary-question boundaries. The standing worker sandbox remains `workspace-write`; a question answer never grants access. A single approved operation does not authorize another call.
4
4
 
package/lib/client.js CHANGED
@@ -988,12 +988,15 @@ window.__ModuleLoader__.load({
988
988
  return { label, tone, executed, accepted, decided, phaseLabel, note };
989
989
  }
990
990
  function hostReviewLine(task, formatTime2) {
991
+ const outcome = taskOutcome(task);
991
992
  const acceptance = task?.hostAcceptance;
992
- if (acceptance === null || acceptance === void 0) return "未记录(插件不会自行验收)";
993
- const label = acceptance.accepted === true ? "审查通过" : "需要修正";
993
+ if (acceptance === null || acceptance === void 0) {
994
+ const persistence = task?.reviewPersistence;
995
+ if (persistence?.pending === true || persistence?.state === "failed") return outcome.label;
996
+ return "未记录(插件不会自行验收)";
997
+ }
994
998
  const at = typeof acceptance.acceptedAt === "number" ? `(${formatTime2(acceptance.acceptedAt)})` : "";
995
- const note = typeof acceptance.note === "string" && acceptance.note !== "" ? `:${boundedText(acceptance.note, 200)}` : "";
996
- return `${label}${at}${note}`;
999
+ return outcome.decided ? `${outcome.label}${at}(结论已保存)` : `${outcome.label}${at}`;
997
1000
  }
998
1001
  var REVIEW_NOTE_PREVIEW_CHARS = 200;
999
1002
  function reviewNotePreview(task) {
@@ -2217,9 +2220,42 @@ window.__ModuleLoader__.load({
2217
2220
  .dshdg-fail { color: var(--dsw-alias-label-error, #d92d20); }
2218
2221
  .dshdg-unknown { color: var(--dsw-alias-label-tertiary, #8a9098); }
2219
2222
  .dshdg-table { display: grid; gap: 4px; }
2220
- .dshdg-kv { display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr); gap: 4px 10px; }
2223
+ .dshdg-kv {
2224
+ display: grid;
2225
+ grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
2226
+ gap: 4px 10px;
2227
+ min-width: 0;
2228
+ }
2221
2229
  .dshdg-kv dt { color: var(--dsw-alias-label-secondary, #61666d); }
2222
- .dshdg-kv dd { margin: 0; overflow-wrap: anywhere; }
2230
+ .dshdg-kv dd {
2231
+ margin: 0;
2232
+ /* A grid item defaults to min-width: auto, i.e. "at least as wide as my longest
2233
+ unbreakable run" — the single place that pushed a long review note past the panel. */
2234
+ min-width: 0;
2235
+ overflow-wrap: anywhere;
2236
+ }
2237
+ /* A recorded review note: shown whole, wrapped inside its own track, never clipped.
2238
+ pre-wrap keeps every paragraph break and every space the host stored; anywhere breaks a
2239
+ long unbroken run (a path, a URL, 270 code points of Chinese with no spaces). Nothing
2240
+ here shortens, hides or line-clamps the body: the block keeps its natural height. */
2241
+ .dshdg-note {
2242
+ min-width: 0;
2243
+ max-width: 100%;
2244
+ overflow-wrap: anywhere;
2245
+ }
2246
+ .dshdg-note-full {
2247
+ min-width: 0;
2248
+ max-width: 100%;
2249
+ margin: 0;
2250
+ white-space: pre-wrap;
2251
+ overflow-wrap: anywhere;
2252
+ word-break: break-word;
2253
+ }
2254
+ .dshdg-note-preview {
2255
+ min-width: 0;
2256
+ overflow-wrap: anywhere;
2257
+ word-break: break-word;
2258
+ }
2223
2259
  @media (max-width: 560px) {
2224
2260
  .dshdg-layer, .dshdg-kv { grid-template-columns: minmax(0, 1fr); }
2225
2261
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-taskbridge",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "让 Codex 指挥 DSH:在插件里选择已有 API、执行模型与思考强度,完成派工、静默等待、权限审批、集中审查和原会话续接。支持一键配置 Codex 智能体、可选模型复审与设置自动保存。Claude Code / Claude Desktop 接入预计在 2.0 上线。",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -81,6 +81,9 @@
81
81
  "docs/releases/1.5.0-token-benchmark.zh.md",
82
82
  "docs/releases/1.5.1.zh.md",
83
83
  "docs/releases/1.5.2.zh.md",
84
+ "docs/releases/1.5.3-test.1.zh.md",
85
+ "docs/releases/1.5.3-test.2.zh.md",
86
+ "docs/releases/1.5.3.zh.md",
84
87
  "docs/assets/*.png"
85
88
  ],
86
89
  "dsh": {
package/src/client/api.js CHANGED
@@ -1560,23 +1560,37 @@ export function hostReviewBadge(task) {
1560
1560
  }
1561
1561
 
1562
1562
  /**
1563
- * A task's recorded review conclusion as one bounded display line.
1563
+ * A task's recorded review conclusion as one SHORT display line.
1564
1564
  *
1565
- * Only a short note and the time are shown: the stored note is already redacted, and
1566
- * nothing else about the review exists.
1565
+ * This line carries the conclusion and its time — nothing else. The note BODY deliberately
1566
+ * does not appear here: this row sits beside the detail's own "完整审查意见" block, which
1567
+ * renders the saved text whole. Splicing a bounded cut of it in here produced a second,
1568
+ * truncated copy that read as if the stored text itself had been cut (the misleading
1569
+ * "已截断" line G10 fixes).
1570
+ *
1571
+ * The wording comes from `taskOutcome(...)` and only from there, so this row can never
1572
+ * claim a conclusion the headline contradicts — notably `accepted: true` with a review
1573
+ * record that is not durable yet (a save in flight, a timed-out unconfirmed write, a
1574
+ * failed one). A record written before `reviewPersistence` existed keeps the old
1575
+ * compatibility meaning (stored), which is again exactly what `taskOutcome` decides.
1567
1576
  * @param {object} task - task view.
1568
1577
  * @param {(at: number) => string} formatTime - time formatter from the page.
1569
1578
  * @returns {string} display text.
1570
1579
  */
1571
1580
  export function hostReviewLine(task, formatTime) {
1581
+ const outcome = taskOutcome(task);
1572
1582
  const acceptance = task?.hostAcceptance;
1573
- if (acceptance === null || acceptance === undefined) return '未记录(插件不会自行验收)';
1574
- const label = acceptance.accepted === true ? '审查通过' : '需要修正';
1583
+ if (acceptance === null || acceptance === undefined) {
1584
+ // Nothing recorded. A write that is pending or already failed is its own state, and
1585
+ // `taskOutcome` has already named it — repeating that here would say it twice.
1586
+ const persistence = task?.reviewPersistence;
1587
+ if (persistence?.pending === true || persistence?.state === 'failed') return outcome.label;
1588
+ return '未记录(插件不会自行验收)';
1589
+ }
1575
1590
  const at = typeof acceptance.acceptedAt === 'number' ? `(${formatTime(acceptance.acceptedAt)})` : '';
1576
- const note = typeof acceptance.note === 'string' && acceptance.note !== ''
1577
- ? `:${boundedText(acceptance.note, 200)}`
1578
- : '';
1579
- return `${label}${at}${note}`;
1591
+ // Only a CONFIRMED record is described as saved; an unconfirmed write keeps its own
1592
+ // label and never borrows this suffix.
1593
+ return outcome.decided ? `${outcome.label}${at}(结论已保存)` : `${outcome.label}${at}`;
1580
1594
  }
1581
1595
 
1582
1596
  /**
@@ -209,9 +209,42 @@ export const CSS_TEXT = `
209
209
  .dshdg-fail { color: var(--dsw-alias-label-error, #d92d20); }
210
210
  .dshdg-unknown { color: var(--dsw-alias-label-tertiary, #8a9098); }
211
211
  .dshdg-table { display: grid; gap: 4px; }
212
- .dshdg-kv { display: grid; grid-template-columns: minmax(96px, 140px) minmax(0, 1fr); gap: 4px 10px; }
212
+ .dshdg-kv {
213
+ display: grid;
214
+ grid-template-columns: minmax(96px, 140px) minmax(0, 1fr);
215
+ gap: 4px 10px;
216
+ min-width: 0;
217
+ }
213
218
  .dshdg-kv dt { color: var(--dsw-alias-label-secondary, #61666d); }
214
- .dshdg-kv dd { margin: 0; overflow-wrap: anywhere; }
219
+ .dshdg-kv dd {
220
+ margin: 0;
221
+ /* A grid item defaults to min-width: auto, i.e. "at least as wide as my longest
222
+ unbreakable run" — the single place that pushed a long review note past the panel. */
223
+ min-width: 0;
224
+ overflow-wrap: anywhere;
225
+ }
226
+ /* A recorded review note: shown whole, wrapped inside its own track, never clipped.
227
+ pre-wrap keeps every paragraph break and every space the host stored; anywhere breaks a
228
+ long unbroken run (a path, a URL, 270 code points of Chinese with no spaces). Nothing
229
+ here shortens, hides or line-clamps the body: the block keeps its natural height. */
230
+ .dshdg-note {
231
+ min-width: 0;
232
+ max-width: 100%;
233
+ overflow-wrap: anywhere;
234
+ }
235
+ .dshdg-note-full {
236
+ min-width: 0;
237
+ max-width: 100%;
238
+ margin: 0;
239
+ white-space: pre-wrap;
240
+ overflow-wrap: anywhere;
241
+ word-break: break-word;
242
+ }
243
+ .dshdg-note-preview {
244
+ min-width: 0;
245
+ overflow-wrap: anywhere;
246
+ word-break: break-word;
247
+ }
215
248
  @media (max-width: 560px) {
216
249
  .dshdg-layer, .dshdg-kv { grid-template-columns: minmax(0, 1fr); }
217
250
  }
@@ -8,12 +8,18 @@
8
8
  // 1. `$CODEX_HOME/agents/dsh-taskbridge.toml` — a *managed copy* of the shipped
9
9
  // template `codex/dsh-taskbridge.toml`. Ownership is proved by content, never by
10
10
  // the file name or a version line alone:
11
- // * a file that is byte-identical to the template this build would write is
12
- // `installed` (and removable);
13
- // * a file that matches one of the *known prior shipped templates* in
14
- // {@link KNOWN_AGENT_TEMPLATES} byte for byte is `outdated` (refreshable and
15
- // removable) — a conservative, enumerated list, not a heuristic;
11
+ // * a file that is the same text as the template this build would write is
12
+ // `installed` (and removable). "Same text" admits exactly one difference: CRLF
13
+ // versus LF line terminators (including a mixed spelling of the same lines).
14
+ // Nothing else is normalized — a version line, a comment, a blank line, a
15
+ // trailing space, a tab, a BOM or a lone CR all still make a file different;
16
+ // * a file that is the same text as one of the *known prior shipped templates* in
17
+ // {@link KNOWN_AGENT_TEMPLATES} — as published, or with the terminators spelled
18
+ // the other way per line — is `outdated` (refreshable and removable). The list is
19
+ // still a conservative, enumerated set of published builds, not a heuristic;
16
20
  // * anything else is `modified`/`conflict`: never overwritten, never removed.
21
+ // The tolerant comparison is for CLASSIFICATION only. Every write and delete re-proves
22
+ // the exact bytes it read, so a file edited between the read and the write is kept.
17
23
  // A first install is *exclusive* (`wx`), so a file that appears between the
18
24
  // status read and the write is reported as a conflict instead of replaced.
19
25
  // 2. the `mcp_servers.dsh-delegate` table in `$CODEX_HOME/config.toml`, and only
@@ -111,15 +117,18 @@ export const CODEX_ACTIONS = Object.freeze(['status', 'install', 'repair', 'remo
111
117
  * *as written* (template with the version marker stamped).
112
118
  *
113
119
  * This list, not a heuristic, is what makes `outdated` mean "a build this plugin
114
- * really published". A file that is not byte-identical to one of these is somebody
120
+ * really published". A file that is not identical to one of these texts is somebody
115
121
  * else's file, even if it still carries the managed header and an old version line.
116
- * Regenerating a digest is a deliberate act: add the entry for a release only after
117
- * that release has been packed and its agent file verified.
122
+ * "Identical" admits the CRLF/LF spelling of the same text only (see
123
+ * {@link isKnownPriorTemplate}); the entries below stay the exact published identities and
124
+ * are never derived from the current template. Regenerating a digest is a deliberate act:
125
+ * add the entry for a release only after that release has been packed and its agent file
126
+ * verified.
118
127
  *
119
128
  * The 0.1.6, both 0.1.7 builds, the 0.1.8 and 0.1.9 builds, the published 0.1.10
120
129
  * template (in both its packed CRLF and its LF byte form), the published 0.1.11
121
130
  * template and the published 0.1.12 template are enumerated here because they are
122
- * published Codex agent builds. A file that is not byte-identical to one of these
131
+ * published Codex agent builds. A file that is not identical to one of these
123
132
  * releases or the current template is reported as `modified`, rather than guessed as
124
133
  * ours.
125
134
  * The array is intentionally mutable (not frozen) so a test can pin a temporary
@@ -416,18 +425,127 @@ export const KNOWN_AGENT_TEMPLATES = [
416
425
  // * `da2f428f…` — LF form (39,743 bytes).
417
426
  // * `f55893e7…` — the installed CRLF form (40,259 bytes).
418
427
  { version: '1.5.0', sha256: 'da2f428f726ae64b6895941d5238516346af91b63b038b1d57787be327fb28ee' },
419
- { version: '1.5.0', sha256: 'f55893e7605627c6f0c9a4c55f58a5a1956d4c11b8c03c99569dca241842d8bb' },
420
- // Exact locally installed test.3 product template, verified before preparing 1.5.1.
421
- { version: '1.5.1-test.3', sha256: 'dc1c17f3bdfe171d3c1e7f943d569b12ffe12d6b25190fffe1c8c9550446f29d' },
422
- { version: '1.5.1-test.3', sha256: '06e13895f6df3ec9fbf48b1b40af42940f3ddf2b3afad356751dbd11e1205ff4' },
423
- // Exact published v1.5.1 template; only the version stamp changes in 1.5.2.
424
- { version: '1.5.1', sha256: '3d4fa9d8543306a10a5ac7d337d1538ebf57a20104674192de16ba13f580c0e6' },
428
+ { version: '1.5.0', sha256: 'f55893e7605627c6f0c9a4c55f58a5a1956d4c11b8c03c99569dca241842d8bb' },
429
+ // Exact locally installed test.3 product template, verified before preparing 1.5.1.
430
+ { version: '1.5.1-test.3', sha256: 'dc1c17f3bdfe171d3c1e7f943d569b12ffe12d6b25190fffe1c8c9550446f29d' },
431
+ { version: '1.5.1-test.3', sha256: '06e13895f6df3ec9fbf48b1b40af42940f3ddf2b3afad356751dbd11e1205ff4' },
432
+ // Exact published v1.5.1 template; only the version stamp changes in 1.5.2.
433
+ { version: '1.5.1', sha256: '3d4fa9d8543306a10a5ac7d337d1538ebf57a20104674192de16ba13f580c0e6' },
425
434
  { version: '1.5.1', sha256: 'ad0c09209e60234d369a0589fdc61477efa20b95b02d66534901d6fbc0f4d673' },
435
+ // Published 1.5.2 before the P0 planning rules, preserved in tests/fixtures/agent-1.5.2.toml.
436
+ // These exact LF/CRLF identities allow a managed upgrade without claiming user edits.
437
+ { version: '1.5.2', sha256: 'e0971d206f962ed145d36986334fd27107d3270ead0688e4899b7be2fc1544d2' },
438
+ { version: '1.5.2', sha256: '86ec91643d285ff8fb7e21121b7e4c4cd1cc8687b1190af88865bfb0ff3eab8a' },
439
+ // The INSTALLED local test build `1.5.3-test.1`. Both identities are the bytes of that
440
+ // build's OWN product template, not a reconstruction from today's text: they were
441
+ // preserved byte for byte as `tests/fixtures/agent-1.5.3-test.1.toml` and compared
442
+ // byte-for-byte with the file actually installed on the operator's machine.
443
+ //
444
+ // * `e5e96ae7…` — the installed CRLF form (43,287 bytes, `version = "1.5.3-test.1"`).
445
+ // * `fc767654…` — the same text with every `\r\n` folded to `\n` (42,734 bytes).
446
+ //
447
+ // Without these two an untouched test.1 install hashes to "unknown content" and is
448
+ // reported `modified`, which would make the upgrade to 1.5.3-test.2 impossible. Only
449
+ // these exact bytes qualify: a single edited character still hashes to something
450
+ // unknown and stays the operator's file.
451
+ { version: '1.5.3-test.1', sha256: 'e5e96ae7d0ab3dbfe2d06b58182e2e36c761e0ee622b212f5d0ff584a6412fd0' },
452
+ { version: '1.5.3-test.1', sha256: 'fc7676549dd75fee7ae3ab343a617514dd0d32def9321255b772e29197ac9a76' },
453
+ // The INSTALLED local test build `1.5.3-test.2`, i.e. the last step before the formal
454
+ // 1.5.3 release. Its identity is evidence, not a rendering of today's text: both forms
455
+ // were read from the files of that build that are actually on the operator's machine
456
+ // (saved as `installed-test.2-template.toml` and `installed-test.2-agent.toml`) and were
457
+ // found to differ ONLY in their terminators, the version line being `1.5.3-test.2` in
458
+ // both. The template form is preserved byte for byte as
459
+ // `tests/fixtures/agent-1.5.3-test.2.toml` and compared against the installed one.
460
+ //
461
+ // * `2a905842…` — the shipped template file, CRLF throughout (43,287 bytes).
462
+ // * `77a4e834…` — the file that build actually installed, the same text with LF
463
+ // terminators (42,734 bytes), which is what {@link renderAgentFile} writes.
464
+ //
465
+ // Without these two an untouched test.2 install hashes to "unknown content" and is
466
+ // reported `modified`, which would make the upgrade to the formal 1.5.3 template
467
+ // impossible. Only these exact bytes qualify: a single edited character still hashes to
468
+ // something unknown and stays the operator's file.
469
+ { version: '1.5.3-test.2', sha256: '2a9058424f33b0a022b05aedc3ebfcf35c0cb10eac498b754597dd7f90d3c775' },
470
+ { version: '1.5.3-test.2', sha256: '77a4e83459ef605826cfaa1057d19058c4ae36a5ed6080ebd70c88a0a3dd69fb' },
426
471
  ];
427
472
 
428
473
  /** The `version = "…"` line of an agent file, at column 0. */
429
474
  const VERSION_LINE = /^version[ \t]*=[ \t]*"([^"]*)"\r?$/mu;
430
475
 
476
+ /**
477
+ * Read agent text with CRLF terminators folded to LF.
478
+ *
479
+ * The shipped template is stored with CRLF terminators while {@link renderAgentFile} writes
480
+ * the managed file with LF, so the terminator spelling alone is not a content difference.
481
+ * Only `\r\n` is folded: a BOM, a lone `\r`, a tab, a trailing space, a blank line, a comment
482
+ * and the version line all stay exactly as they are, so every one of them still makes a file
483
+ * a different text. A `\r\r\n` therefore keeps the extra `\r` and stays different too.
484
+ * Classification may use this fold; every write and delete still re-proves the exact bytes it
485
+ * read (`agent.expect`).
486
+ * @param {string} text - agent file or template text.
487
+ * @returns {string} the text with CRLF folded to LF.
488
+ */
489
+ function normalizeLineEndings(text) {
490
+ return text.replace(/\r\n/gu, '\n');
491
+ }
492
+
493
+ /**
494
+ * The normalization above applied to BOTH texts, i.e. "is this the same text?".
495
+ * @param {string} contents - text read from an agent file.
496
+ * @param {string} template - text this build would write.
497
+ * @returns {boolean} true when the two texts differ at most in CRLF/LF spelling.
498
+ */
499
+ function sameAgentText(contents, template) {
500
+ if (contents === template) return true;
501
+ return normalizeLineEndings(contents) === normalizeLineEndings(template);
502
+ }
503
+
504
+ /**
505
+ * Is this file one of the exact agent files an earlier release shipped?
506
+ *
507
+ * The only case where install may replace an existing file. The test is content identity: a
508
+ * single changed character changes the digest, and the version line is deliberately *not*
509
+ * used as proof.
510
+ *
511
+ * The one tolerated difference is the CRLF/LF spelling of the SAME text, which is why the
512
+ * file is also matched as its whole text normalized to LF and as that text with every
513
+ * terminator spelled CRLF. Both digests are compared against the SAME enumerated table above —
514
+ * that table is never rebuilt, widened, re-versioned or emptied.
515
+ *
516
+ * That equivalent branch is only reachable when the normalized text still contains NO `\r` at
517
+ * all. A `\r` left over after storing the CRLF/LF fold is a character of the file, not a
518
+ * spelling: a file whose every line was rewritten to `\r\r\n` normalizes to text that already
519
+ * looks CRLF, so without this guard it would match the published CRLF digest and be claimed as
520
+ * ours (then overwritten). Such a file is an operator edit and stays `modified`.
521
+ * Everything else still fails too: an added or removed line, a comment, a trailing space, a tab,
522
+ * a BOM, a changed version line or any other edit hashes to nothing in the table.
523
+ * @param {string} contents - installed file text.
524
+ * @param {object} [options] - `ignoreVersion`: compare with the version line masked, used only
525
+ * to explain *why* a file is `modified` in the status note. It never grants refresh or removal.
526
+ * @returns {boolean} true when the file is a known published build of this template.
527
+ */
528
+ export function isKnownPriorTemplate(contents, { ignoreVersion = false } = {}) {
529
+ if (typeof contents !== 'string') return false;
530
+ const known = (text) => KNOWN_AGENT_TEMPLATES.some((entry) => entry.sha256 === digest(text));
531
+ if (known(contents)) return true;
532
+ const lf = normalizeLineEndings(contents);
533
+ // A leftover `\r` means the file has a CR no spelling fold accounts for, so no equivalent
534
+ // digest may claim it. This guard wraps ONLY the equivalent branch; the diagnosis below is
535
+ // still reachable for such a file.
536
+ if (!lf.includes('\r')) {
537
+ if (known(lf)) return true;
538
+ const crlf = lf.replace(/\n/gu, '\r\n');
539
+ if (crlf !== contents && known(crlf)) return true;
540
+ }
541
+ if (!ignoreVersion) return false;
542
+ // Explanation-only path: the same body with the version line stripped still has to
543
+ // match a known build, which distinguishes "operator edited a managed file" from
544
+ // "this file was never ours".
545
+ const stripped = contents.replace(VERSION_LINE, 'version = "\u0000"');
546
+ return KNOWN_AGENT_TEMPLATES.some((entry) => entry.sha256 === digest(stripped));
547
+ }
548
+
431
549
  /** Stable states reported for the agent file. */
432
550
  export const AGENT_STATES = Object.freeze({
433
551
  missing: 'not-installed',
@@ -1115,11 +1233,18 @@ async function readLinkTarget(path) {
1115
1233
  /**
1116
1234
  * Compare the installed agent file with the template this build would write.
1117
1235
  *
1118
- * The order matters. Content equality is checked first, so a byte-identical file is
1119
- * `installed` no matter what its version line says. Only then is the exact
1120
- * known-template list consulted, and only a byte-exact match to a published build is
1121
- * `outdated`. Everything else is `modified`: a body edit, a stray byte, a tampered
1122
- * or invented version line, or a file that merely looks like ours.
1236
+ * The order matters. Content equality is checked first, so a file that is the same text
1237
+ * as the template is `installed` no matter what its version line says; "the same text"
1238
+ * includes the CRLF/LF spelling, because the shipped template's terminators are not part
1239
+ * of its content (see {@link normalizeLineEndings}). Only then is the exact known-template
1240
+ * list consulted, and only a match to a published build is `outdated`. Everything else is
1241
+ * `modified`: a body edit, a stray byte, a tampered or invented version line, or a file
1242
+ * that merely looks like ours.
1243
+ *
1244
+ * `contents` is always the text EXACTLY as read, and `expect` (the status field derived
1245
+ * from it) is what the write and delete paths re-prove against, so a file rewritten
1246
+ * between the read and the write is still detected even though this classification is
1247
+ * line-ending tolerant.
1123
1248
  * @param {string} path - agent file path.
1124
1249
  * @param {string} template - template text this build would write.
1125
1250
  * @returns {Promise<{ state: string, present: boolean, reason: string | null, contents: string | null }>} agent state and the exact bytes it was derived from.
@@ -1129,7 +1254,7 @@ async function readAgentState(path, template) {
1129
1254
  if (existing.kind === 'missing') return { state: AGENT_STATES.missing, present: false, reason: null, contents: null };
1130
1255
  if (existing.kind === 'other') return { state: AGENT_STATES.conflict, present: true, reason: 'not-a-regular-file', contents: null };
1131
1256
  const contents = existing.contents;
1132
- if (contents === template) return { state: AGENT_STATES.installed, present: true, reason: null, contents };
1257
+ if (sameAgentText(contents, template)) return { state: AGENT_STATES.installed, present: true, reason: null, contents };
1133
1258
  if (isKnownPriorTemplate(contents)) return { state: AGENT_STATES.outdated, present: true, reason: null, contents };
1134
1259
  return {
1135
1260
  state: AGENT_STATES.modified,
@@ -1218,32 +1343,6 @@ function linkedBoundaryRefusal(status) {
1218
1343
  };
1219
1344
  }
1220
1345
 
1221
- /**
1222
- * Is this file one of the exact agent files an earlier release shipped?
1223
- *
1224
- * The only case where install may replace an existing file. The test is content
1225
- * identity against the enumerated digest list, which cannot be satisfied by an
1226
- * operator edit: a single changed byte changes the digest. The version line is
1227
- * deliberately *not* used as proof — an operator can edit a body while leaving (or
1228
- * lowering) that line, and a heuristic on it is exactly how a customised agent
1229
- * gets overwritten.
1230
- * @param {string} contents - installed file text.
1231
- * @param {object} [options] - `ignoreVersion`: compare with the version line masked,
1232
- * used only to explain *why* a file is `modified` in the status note.
1233
- * @returns {boolean} true when the file is a known published build of this template.
1234
- */
1235
- export function isKnownPriorTemplate(contents, { ignoreVersion = false } = {}) {
1236
- if (typeof contents !== 'string') return false;
1237
- const digestValue = digest(contents);
1238
- if (KNOWN_AGENT_TEMPLATES.some((entry) => entry.sha256 === digestValue)) return true;
1239
- if (!ignoreVersion) return false;
1240
- // Explanation-only path: the same body with the version line stripped still has to
1241
- // match a known build, which distinguishes "operator edited a managed file" from
1242
- // "this file was never ours".
1243
- const stripped = contents.replace(VERSION_LINE, 'version = "\u0000"');
1244
- return KNOWN_AGENT_TEMPLATES.some((entry) => entry.sha256 === digest(stripped));
1245
- }
1246
-
1247
1346
  /**
1248
1347
  * Write a file that must not exist yet, atomically and exclusively.
1249
1348
  *
@@ -2189,15 +2288,23 @@ export function removeMcpEntry(document) {
2189
2288
 
2190
2289
  /**
2191
2290
  * Render the agent file from the shipped template plus this package's version.
2291
+ *
2292
+ * The MANAGED file is written with LF terminators, whatever the template's own spelling
2293
+ * is: this repository stores `codex/dsh-taskbridge.toml` CRLF, and a renderer that echoed
2294
+ * that spelling would make the file it writes depend on the checkout it was built from.
2295
+ * Only the terminators are touched — every other byte of the body is copied verbatim
2296
+ * (spaces, tabs, blank lines, comments), and {@link readAgentTemplate} still returns the
2297
+ * template exactly as shipped, so the source TOML is never rewritten.
2192
2298
  * @param {string} template - shipped template.
2193
2299
  * @param {string} version - package version.
2194
- * @returns {string} file contents.
2300
+ * @returns {string} file contents, LF-terminated.
2195
2301
  */
2196
2302
  export function renderAgentFile(template, version) {
2197
2303
  const marker = `version = ${renderString(version)}`;
2198
- if (/^version = ".*"$/mu.test(template)) return template.replace(/^version = ".*"$/mu, marker);
2304
+ const text = normalizeLineEndings(template);
2305
+ if (/^version = ".*"$/mu.test(text)) return text.replace(/^version = ".*"$/mu, marker);
2199
2306
  // Keep the provenance header first, then the version marker, then the rest.
2200
- const lines = template.split('\n');
2307
+ const lines = text.split('\n');
2201
2308
  const insertAt = lines.findIndex((line) => line.trim() !== '' && !line.trimStart().startsWith('#'));
2202
2309
  const resolved = insertAt === -1 ? lines.length : insertAt;
2203
2310
  lines.splice(resolved, 0, marker);
package/src/mcp/server.js CHANGED
@@ -289,7 +289,11 @@ export const TOOLS = Object.freeze([
289
289
  + 'reuses that task\u2019s recorded execution checkout and DSH Session internally, taking no execution '
290
290
  + 'location from '
291
291
  + 'the caller. An unknown, unfinished, removed or differently-sourced parent is refused rather than '
292
- + 'started as a new conversation.',
292
+ + 'started as a new conversation. '
293
+ + 'The commander must first plan and scope ONE cohesive, independently verifiable work packet. '
294
+ + 'Split a separable multi-stage goal before dispatch; include the chosen approach, scope and acceptance '
295
+ + 'checks. A simple complete task may use one packet. Rules, planning and final review remain with '
296
+ + 'the commander; a verification-only packet does not authorize implementation changes.',
293
297
  // It creates work, so it is not a read; it is not destructive of anything the
294
298
  // operator already has, and repeating it creates ANOTHER task (never idempotent).
295
299
  annotations: Object.freeze({
@@ -314,7 +318,7 @@ export const TOOLS = Object.freeze([
314
318
  + 'an execution.workspacePath or any other internal execution location in its place, because a '
315
319
  + 'different source path names a different repository and the continuation is refused.',
316
320
  },
317
- prompt: { type: 'string', description: 'The task to perform.' },
321
+ prompt: { type: 'string', description: 'One commander-planned work packet: objective, chosen approach, owned files or modules, constraints and acceptance checks. Roadmap context does not authorize future packets. A verification-only assignment permits checks and evidence, not implementation edits.' },
318
322
  title: { type: 'string', maxLength: 120, description: 'Short work-content title in the operator\'s language, e.g. 修复登录错误. Used to name the new DSH Workspace; omit role instructions and task ids. A follow-up keeps its existing Workspace name.' },
319
323
  overrides: {
320
324
  type: 'object',