dsh-chief 1.2.1 → 1.4.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 +76 -15
- package/README.en.md +143 -114
- package/README.md +134 -140
- package/api-routes.js +1291 -0
- package/archive-cabinets.js +766 -0
- package/archive-core.js +761 -0
- package/archive-dossiers.js +1185 -0
- package/archive-precipitated.js +428 -0
- package/archives.js +63 -2991
- package/board-actions.js +1950 -0
- package/board-schema.js +580 -0
- package/board-store.js +392 -0
- package/chief-approvals.js +1001 -0
- package/chief-archives.js +940 -0
- package/chief-commands.js +3020 -0
- package/chief-compaction.js +591 -0
- package/chief-executor.js +280 -382
- package/chief-models.js +578 -0
- package/chief-network.js +869 -0
- package/chief-review.js +1096 -0
- package/chief-state.js +2193 -0
- package/chief-view.js +568 -0
- package/chief.js +94 -8541
- package/client.js +13294 -11651
- package/index.js +154 -6363
- package/model-tools.js +831 -0
- package/package.json +59 -21
- package/runtime-hooks.js +735 -0
- package/safety/audit-log.js +95 -0
- package/safety/command-analyzer.js +339 -0
- package/safety/guard-walls.js +993 -0
- package/safety/index.js +78 -0
- package/safety/invariant-guards.js +280 -0
- package/safety/path-guard.js +227 -0
- package/safety/policy-engine.js +387 -0
- package/safety/policy-plugin.js +391 -0
- package/safety/tool-gate.js +278 -0
- package/subagent-runtime.js +1406 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,26 +5,87 @@ All notable changes to **`dsh-chief`** (**DSH 参谋长**) will be documented in
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
## [1.
|
|
8
|
+
## [1.4.0] - 2026-11-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### 🧱 全会话事前物理驻墙与独立安全内核 (`pkg/safety/` + `tools/pre-execute`)
|
|
13
|
+
- **事前物理硬拦截**:主对话、子代理与参谋调用文件或命令落地前统一经过 `tools/pre-execute` 门禁,撞墙直接拒止并写入 `chief-audit.jsonl`。
|
|
14
|
+
- **随身复用的动态物理墙**:边界页新增「🧱 物理驻墙」(持久化于 `~/.dsh/chief/guard-walls.json`),支持 `global`(跨窗口自动跟随)/ `workspace`(仅本工程)/ `paused`(暂挂备用)一键切换。
|
|
15
|
+
- **大白话手搓与同类合并**:对参谋说白话即可生成 `wallProposals` 草案(人工确认后落锁),支持多选或一键合并相同 `ruleType` 的物理墙(跨类型混选自动拦截)。
|
|
16
|
+
- **9 模块独立安全内核**:将硬守卫、命令拆解、路径穿透检测、能力引擎与审计拆为 `pkg/safety/` 9 个零业务依赖模块,与 `chief-executor.js` 全集 MD5 锁定。
|
|
17
|
+
|
|
18
|
+
#### 🤝 参谋懒介入协同、无感问询与自动续跑 (`chief-commands.js` + `chief-state.js`)
|
|
19
|
+
- **主对话优先(懒介入)**:高权限下只要未点名让参谋亲自操刀,工作区改动与命令统一发 `[EXECUTION_REQUEST]` 委派 `@lead` 动手,绝不冒充用户发言。
|
|
20
|
+
- **空白新窗口先探路定计划**:新开空白会话直接找参谋时,默认先引导 `@lead` 只读看代码 → `graph.plan` 排计划 → `chief.request` 汇报结论。
|
|
21
|
+
- **后台优先问询零打断**:参谋缺细节时经 `agent/pre-step` 递出 `[INQUIRY #id]`,主对话顺手调 `inquiry.reply` 秒回后继续原工作,不打断当前步骤。
|
|
22
|
+
- **审批/提权后自动续跑 (`TaskLedger`)**:点完「允许」后按持久化账本自动接上未走完的步骤;异常重启时自动将半途任务安全置为 `interrupted`,不偷偷重跑。
|
|
23
|
+
|
|
24
|
+
#### 🔒 细粒度能力模型与只紧不松策略 (`policy-engine.js` + `policy-plugin.js`)
|
|
25
|
+
- **`role + capabilities` 双层解耦**:界面保持 `advisor / assistant / strategist / chief` 四档,底层放开 `assistant` 低风险看板与档案整理免弹窗,依然严锁文件写入。
|
|
26
|
+
- **单次授权防复用与只紧不松插件**:逐项授权绑定目标路径/命令 `capabilityScope`;可选 `policyPlugins` 仅允许收紧规则,试图关闭硬守卫的配置直接拒绝。
|
|
9
27
|
|
|
10
28
|
### Changed
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- **L2 · 参谋模式 (`strategist` · `ADVISOR WITH APPROVAL` · `逐项授权`)**:具备 L1 全部能力,可申请修改工作区文件、系统命令与主/子代理工作流;每项受控操作执行前强制弹出「🛡️ 操作授权请求」(操作 / 目标 / 原因 / 影响 + 拒绝 / 允许本次操作),经用户单次授权后才执行。
|
|
15
|
-
- **L3 · 参谋长模式 (`chief` · `CHIEF OF STAFF` · `主动风险知悉`)**:拥有更高自主执行权(切换主代理、协调子代理工作流、自动纠偏与续跑);进入前强制弹出「⚠️ 高权限模式风险告知」并勾选「我已阅读并知悉上述风险,理解高权限模式可能造成的后果。」,且由后端 `DSH Chief` 强制校验 `confirmedChiefRisk === true`(未校验的旧版/异常配置自动降级回 L0)。
|
|
16
|
-
- **6 级统一安全架构流水线**:`用户模式 → 操作请求 → 安全卫兵硬性规则 → 权限判定 → 执行器 → 审计日志`,安全卫兵红线对 L0–L3 全档位硬性兜底,所有权限判定与执行结果均写入会话审计日志并支持前端弹窗检索。
|
|
17
|
-
- **模型主动申请提权闭环**:新增 `request_permission_elevation` 执行工具与 `chief_board permission.request` 工具动作;UI 弹窗展示申请方、原因与目标档位(支持在 L3 申请时提供「仅提权至 L2 参谋模式」稳妥选项),若批准升至 L3 同样强制走风险告知与打勾校验。
|
|
18
|
-
- **`⚡ 主动强介入` 随 4 档位联动差异化表现**:
|
|
19
|
-
- **L0 顾问**:仅只读巡检诊断与建议输出,不改写工作区且不注入 `@lead` 强推指令。
|
|
20
|
-
- **L1 助手**:仅自动维护参谋记忆、档案与建议卡,不干预主对话执行流。
|
|
21
|
-
- **L2 参谋**:每轮强介入生成的关键受控动作/递话/压缩均队列化并弹出逐项授权请求,允许后单次执行。
|
|
22
|
-
- **L3 参谋长**:高自主闭环督导(直控主对话/子代理、纠偏、压缩前抢救与 `auto-continue.js` 续跑),配合死循环熔断与人类结项门禁。
|
|
29
|
+
- **前后台流光舞台提示 (`activeWork`)**:参谋在前台或后台自动巡检、收档、维护边界或刷摘要时,面板自动切页并点亮流动渐变 + 双束光线边框与毛玻璃跃动字提示。
|
|
30
|
+
- **强介入双防线核对窗 (`InterventionConfirmModal`)**:开启前并排核对当前生效的「🧱 物理驻墙」与「🚫 禁止红线」,右上角改为「管理边界」并支持一键收起/拉开。
|
|
31
|
+
- **问答分组框、红盾哨兵与顺势刷摘要**:每轮提问与回执包进高对比分组外框并支持一键折展,按钮统一靠右下对齐;「🛡 红线哨兵」开启时变红并点亮双层红盾图标;每次聊完按 60 秒节流后台顺势刷新顶部摘要。
|
|
23
32
|
|
|
24
33
|
### Fixed
|
|
25
|
-
-
|
|
26
|
-
-
|
|
34
|
+
- **适配 DSH `0.2.2-rc.5` 原生工具与弹窗审批**:对齐 `dsh-tool-fs`(`read` / `read_image` / `write` / `edit` / `apply_patch`),修复仅禁写路径墙误拦 `str_replace_editor` 只读 `view` 模式的问题,接入 `tools/pre-execute` 原生 `{ kind: 'ask' }` 单次审批弹窗,并兼容多代际 `session(.vN).jsonl(.zstd)` 日志检索。
|
|
35
|
+
- **封堵复合管道、内联脚本与多反斜杠凭据变形**:补齐 `&& / || / | / ;`、嵌套 Shell、`node -e / python -c / pwsh / iex`(含 Base64)及引号多反斜杠绕过(如 `copy x ".\\"env`),对 `node .\env\setup.js`、`process.env.NODE_ENV` 与 `$env:TEMP` 保持 0 误杀;`bounds.*` 与驻墙删改强制校验 `HUMAN_BOUNDS_CONFIRM_TOKEN`。
|
|
36
|
+
|
|
37
|
+
## [1.3.0] - 2026-11-18
|
|
27
38
|
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
#### 🧩 模块化低耦合架构与双版本 CI (`ARCHITECTURE.md` + `build-client.mjs`)
|
|
42
|
+
- **前后端模块化拆分**:将 4 个超长单体文件拆为 **29 个后端模块 + 16 个前端源码模块**,`index.js`、`chief.js`、`archives.js`、`client.js` 公开导出保持 100% 兼容。
|
|
43
|
+
- **静态边界与双版本门禁**:强制零 `export let/var` 可变导出、零循环依赖,新增 GitHub Actions Node `22 / 24` 自动门禁。
|
|
44
|
+
|
|
45
|
+
#### 🔄 审批续跑、独立审计与对话流筛选 (`chief-executor.js` + `chief-state.js`)
|
|
46
|
+
- **点完允许自动接着跑 (`resumeTasks`)**:点击「允许本次操作」或完成提权后,按 30 分钟 TTL 与深度熔断自动续接未走完的多步任务,拒绝或超时自动取消不空转。
|
|
47
|
+
- **独立只追加审计账本 (`chief-audit.jsonl`)**:权限判定、放行/拒绝与安全拦截统一追加写入 `~/.dsh/chief/chief-audit.jsonl`,不受状态文件截断影响。
|
|
48
|
+
- **顶栏版本号与对话流筛选**:标题栏常驻显示当前版本徽章(`v1.3.0`);参谋页支持 `全部 / 💬 问答 / 📋 回执` 筛选,待定建议统一收拢至顶部「`▶ 执行建议`」。
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
- **跨进程与多线程文件锁加固 (`O_EXCL`)**:`board-store.js`、`chief-state.js`、`archive-core.js` 引入 `threadId` 唯一临时文件与 Windows NTFS `EPERM / EACCES / EBUSY` 随机抖动自旋重试,消除高并发丢写。
|
|
52
|
+
- **模型上下文窗口异步回写 (`subagent-runtime.js`)**:兼容同步与异步 `resolveModelInfo` 查询,及时缓存并刷新会话 Token 窗口统计。
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- **命令与路径安全卫兵反混淆 (`chief-executor.js`)**:检查前统一执行 NFKC 规范化、PowerShell `-EncodedCommand` 解码、引号拼接与 `^` 插入符折叠;拦截越界写入、凭据符号链接与 NTFS ADS 流(如 `safe.txt:.env`);待批操作绑定 SHA-256 `payloadHash`,同源 `guard()` 异常默认返回 `403`。
|
|
56
|
+
- **修复关闭右侧栏后每 3.2 秒自动弹回**:区分首次启动自动展开与用户手动收起状态,底部入口点击恢复真实折叠/展开(Toggle)。
|
|
57
|
+
- **修复档案页「一键收纳入柜」漏收与不刷新**:补齐会话看板、根会话看板与共享便签三路收纳,疑似密钥自动 `[REDACTED]` 脱敏入柜,并即时同步前端分柜计数。
|
|
58
|
+
|
|
59
|
+
## [1.2.1] - 2026-11-17
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
#### 🛡️ 四档会话权限与逐项操作授权 (`chief-executor.js`)
|
|
64
|
+
- **四档会话权限**:`advisor`(只读 · 默认)/ `assistant`(助手)/ `strategist`(逐项授权)/ `chief`(高自主)。
|
|
65
|
+
- **新会话一律只读起步**:新开窗口与跨窗投递进来的会话统一落在 `advisor`,只观察、只分析、只给方案,不改工作区、不打断主对话。
|
|
66
|
+
- **受控操作先弹窗**:改文件、跑命令、调子代理工作流前强制弹出「🛡️ 操作授权请求」,写明做什么 / 改谁 / 为什么 / 有什么影响。
|
|
67
|
+
- **单次授权不放永久权**:只有亲手点「允许本次操作」才执行;权限不够时模型主动打报告申请提权,不会自行升档。
|
|
68
|
+
- **提权申请闭环**:新增 `request_permission_elevation` 执行工具与 `chief_board permission.request` 动作,弹窗展示申请方、原因与目标档位,高自主档申请时可选择只提到逐项授权档。
|
|
69
|
+
- **旧配置自动降级**:未经风险勾选校验的旧版或异常配置一律回落到 `advisor`。
|
|
70
|
+
|
|
71
|
+
#### 🔒 统一安全流水线与审计日志
|
|
72
|
+
- **6 级流水线**:`用户模式 → 操作请求 → 安全卫兵硬性规则 → 权限判定 → 执行器 → 审计日志`。
|
|
73
|
+
- **红线对全档位硬兜底**:删库、`git reset --hard`、`.env` 与密钥泄露、全局禁止红线不因放权而松开。
|
|
74
|
+
- **高自主档先读风险**:进入前强制弹出「⚠️ 高权限模式风险告知」并勾选确认,后端复核 `confirmedChiefRisk === true`,切回低档或新建对话后自动失效。
|
|
75
|
+
- **全程留审计账本**:权限判定与执行结果均写入会话审计日志,支持前端弹窗检索。
|
|
76
|
+
- **随时急停**:输入栏红色 `⏹ 急停` 一键切断后台自驱,回到人工接管。
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
- **`⚡ 主动强介入` 随档位差异化**:
|
|
80
|
+
- `advisor`:仅只读巡检诊断与建议输出,不改写工作区,不注入 `@lead` 强推指令。
|
|
81
|
+
- `assistant`:仅自动维护参谋记忆、档案与建议卡,不干预主对话执行流。
|
|
82
|
+
- `strategist`:每轮强介入产生的关键受控动作、递话与压缩均队列化,逐条弹出授权请求,允许后单次执行。
|
|
83
|
+
- `chief`:高自主闭环督导(直控主对话与子代理、纠偏、压缩前抢救与 `auto-continue.js` 续跑),配合死循环熔断与人工结项门禁。
|
|
84
|
+
|
|
85
|
+
### Fixed
|
|
86
|
+
- **修复「🚀 新建窗口并部署参谋长」按钮在深色与标准主题下发白看不清文字**:原 `--dnb-accent` 绑定宿主 `--dsw-alias-brand-primary`(标准深色主题下接近白色 `#f9fafb`),白字按钮对比度崩掉;现改用 `--dsw-alias-state-business-primary` 并引入独立的 `--dnb-primary-bg` / `--dnb-primary-fg` 高对比主按钮令牌,同时补齐暗色 `<select option>` 下拉配色。
|
|
87
|
+
- **修复「🚀 新建窗口并部署参谋长」创建会话未绑定当前 `workspaceId`、不自动跳转新窗**:`transferChief('create')` 现会继承当前会话工作区,前端同时兼容 `sessions.open(created)` 切换视图。
|
|
88
|
+
|
|
28
89
|
## [1.2.0] - 2026-11-16
|
|
29
90
|
|
|
30
91
|
### Added
|
package/README.en.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
|
|
3
|
-
**
|
|
4
|
-
<sub>
|
|
3
|
+
**Right-sidebar supervisor, anti-compaction vault, and approval gate for DeepSeek Harness (DSH)**
|
|
4
|
+
<sub>Saves paths and findings before `/compact` wipes context, tracks subagent DAGs in one view, and asks before editing files or running shell commands.</sub>
|
|
5
5
|
|
|
6
|
-
<img src="assets/chief-10s-compare.gif" alt="
|
|
6
|
+
<img src="assets/chief-10s-compare.gif" alt="Side-by-side comparison: plain long session loses context on compaction vs. dsh-chief saves findings to cold vaults, guards actions, and carries structured handoffs across windows" width="800" />
|
|
7
7
|
|
|
8
|
-
<sub>Read-only by default ·
|
|
8
|
+
<sub>Read-only by default · Per-action workspace approval · `dsh plugin --profile web add dsh-chief`</sub>
|
|
9
9
|
|
|
10
10
|
<br />
|
|
11
11
|
|
|
12
|
-
<img src="assets/hero-banner.png" alt="
|
|
12
|
+
<img src="assets/hero-banner.png" alt="dsh-chief main cockpit view" width="100%" />
|
|
13
13
|
|
|
14
14
|
<br />
|
|
15
15
|
|
|
16
|
-
#
|
|
17
|
-
### DeepSeek Harness
|
|
16
|
+
# DSH Chief (`dsh-chief`)
|
|
17
|
+
### DeepSeek Harness Right-Sidebar Supervisor, Zero-Token Archive Vault & Safety Gate
|
|
18
18
|
|
|
19
19
|
[](https://dsh.deepseek.com)
|
|
20
20
|
[](https://www.npmjs.com/package/dsh-chief)
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
[](#)
|
|
26
26
|
[](LICENSE)
|
|
27
27
|
|
|
28
|
-
> **
|
|
29
|
-
>
|
|
28
|
+
> **Current release `v1.4.0`**: Adds a 9-module safety kernel (`pkg/safety/`), `tools/pre-execute` guard walls (`guard-walls.json`), two-tier `role + capabilities` with persistent `TaskLedger` resume, main-chat-first lazy delegation (`[EXECUTION_REQUEST]`), quiet `[INQUIRY]` checks, and DSH `0.2.2-rc.5` support.
|
|
29
|
+
> Shares the Router + Workers split from DeepSeek's **[SuperAgent (`dsh-superagent-prototype`)](https://github.com/deepseek-ai/dsh-superagent-prototype)** while keeping Chief state and prompts isolated from the main session.
|
|
30
30
|
|
|
31
31
|
[简体中文 (`README.md`)](README.md) · **English** · [Changelog (`CHANGELOG.md`)](CHANGELOG.md)
|
|
32
32
|
|
|
@@ -34,91 +34,75 @@
|
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Daily Friction This Plugin Fixes
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
- **Native Split-Pane Streams (`subagentchat`)**: Click `分屏` on any subagent node to open DSH's native `sidebarRight.openResource` live stream.
|
|
41
|
-
- **Read-only first, asks before acting (`chief-executor.js`)**: New and handed-off sessions start read-only — it observes and proposes first. Editing files, running commands, or steering subagents needs your per-action approval, with a confirmation popup and an audit log behind it.
|
|
42
|
-
- **Ready on Blank New Sessions**: Resolves workspace root via `workspaceRegistry` even before turn 1 in the main chat, and stages `@lead` relays cleanly in `pending-transfer.json`.
|
|
43
|
-
- **Objective Lock & Human Sign-Off**: Strong Intervention locks your Core Objective (`0 = ∞` turns supported), verifies `allowed` must-do items, and waits for your explicit **`✅ 批准结项`** click.
|
|
44
|
-
- **Cross-Isolation `✦ 智选压缩` & Flexible Thresholds**: Compacts via DSH `/compact` across Cordis service isolation (and wakes dormant agents via `sessionController.resolveAgent`), supporting `10%–95%`, `>= 8,000` tokens, or direct `"压缩吧"` commands.
|
|
45
|
-
- **Three-Tier 0-Token Cold Vaults**: Isolates **Session Cabinet**, **System Global Cold Vault** (with live Local ↔ Global diff), and **Double-Blind Precipitated Vault**, spotlighted only via **`📌 摆上桌面`**.
|
|
46
|
-
- **Clean Cross-Window Linking & Pinnable Handoffs**: Warns before linking sessions, purges external context immediately on detach, and locks snapshots via **`📌 定住防改`**.
|
|
39
|
+
If you run multi-step coding tasks inside DeepSeek Harness, these six problems tend to come up quickly.
|
|
47
40
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Ordinary Todo plugins give you another scratchpad; always-on memory plugins flood every system prompt with stale noise. **`dsh-chief` turns human micromanagement into Wish-Driven One-Stop Execution:**
|
|
53
|
-
|
|
54
|
-
### 1. Agents Stop Halfway ("I edited the file, please test it yourself")
|
|
55
|
-
- **Typical Plugins**: Static checklists let agents self-declare victory.
|
|
56
|
-
- **`dsh-chief`**: Locks the Core Objective with Strong Intervention (`0 = ∞`), verifies `allowed` must-do checks, and blocks exit until you click **`✅ 批准结项`**.
|
|
57
|
-
- **Instant Override**: High-risk checks prompt first, and the red **`⏹ 急停`** button halts background drives immediately.
|
|
41
|
+
### 1. Context compaction (`/compact`) wipes paths, commands, and errors
|
|
42
|
+
- **What goes wrong**: When a long session compacts, the summary drops exact file paths, port numbers, and shell fixes you already verified, so the model re-reads files from scratch.
|
|
43
|
+
- **How `dsh-chief` handles it**: Supports `✦ 智选压缩` at idle phase boundaries, custom `10%–95%` or `>= 8,000` token thresholds, or typing `"压缩吧"`.
|
|
44
|
+
- **Fixed order of operations**: It harvests notes into your local session archive and verifies the write before running `/compact` via DSH. Compaction counters only increment after a real, non-empty compaction succeeds.
|
|
58
45
|
|
|
59
|
-
### 2. "
|
|
60
|
-
- **
|
|
61
|
-
-
|
|
62
|
-
-
|
|
46
|
+
### 2. Agents stop halfway ("I edited the file, please test it")
|
|
47
|
+
- **What goes wrong**: Left unattended or overnight, an agent updates one file and marks the task done without running checks or builds.
|
|
48
|
+
- **How `dsh-chief` handles it**: Locks the Core Objective under Strong Intervention (`0 = ∞` turns with stall breakers) and checks your `allowed` must-do list until you explicitly click `✅ 批准结项`.
|
|
49
|
+
- Hit the red `⏹ 急停` button at any time to stop background drives and take back manual control.
|
|
63
50
|
|
|
64
|
-
### 3.
|
|
65
|
-
- **
|
|
66
|
-
-
|
|
67
|
-
-
|
|
51
|
+
### 3. Always-on memory plugins bloat prompts and burn tokens
|
|
52
|
+
- **What goes wrong**: Injecting kilobytes of old notes on every turn wastes context window and distracts the model from the current file.
|
|
53
|
+
- **How `dsh-chief` handles it**: Stores sealed dossiers in three local vaults (Session, System Global, Precipitated). **While sealed, they add 0 bytes and 0 tokens to the main chat.**
|
|
54
|
+
- Click `📌 摆上桌面` or `📤 取出` only when a specific note is needed, and put it back as soon as you finish that step.
|
|
68
55
|
|
|
69
|
-
### 4.
|
|
70
|
-
- **
|
|
71
|
-
-
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
56
|
+
### 4. Full autonomy feels unsafe, but chat-only mode leaves Chief idle (or bossy)
|
|
57
|
+
- **What goes wrong**: Clicking "allow everything" risks `git push --force`, destructive deletes, or reading `.env`, while high-tier supervisors often try to edit files themselves instead of letting your main agent work.
|
|
58
|
+
- **How `dsh-chief` handles it**: Uses four permission tiers (`advisor` read-only default, `assistant`, `strategist` per-action approval, `chief` high autonomy) plus a pre-execution firewall.
|
|
59
|
+
- **Every new session starts read-only**: Observes code, answers questions, and updates the board without touching your workspace.
|
|
60
|
+
- **Pre-execution guard walls (`tools/pre-execute`)**: Before the main agent, any subagent, or Chief writes a file or runs a command, calls pass through `~/.dsh/chief/guard-walls.json`. Walls can be scoped as `global` (follow every new session like preferences), `workspace` (project-only), or `paused`, merged in-place when they share a rule type, or crafted in plain language by Chief for you to approve. High-risk command rules can prompt DSH's native one-time approval dialog.
|
|
61
|
+
- **Lazy intervention & background check-ins**: Unless you explicitly ask Chief to edit files directly, it sends structured `[EXECUTION_REQUEST]` items to the main conversation instead of taking over or speaking as you. In a blank new chat, it instructs `@lead` to read the repo and build a plan first, asks clarifying questions quietly in the background without pausing `@lead`, and updates the top summary after chats.
|
|
62
|
+
- **Auto-resume after approval & restrict-only policies**: `TaskLedger` picks up unfinished steps once you click Allow, hard rules (compound shells, `node -e`/`python -c`, quote-backslash `.env` tricks, symlinks, NTFS ADS) hold in every tier with logs written to `~/.dsh/chief/chief-audit.jsonl`, and optional JSON `policyPlugins` can tighten permissions without ever weakening built-in hard guards.
|
|
76
63
|
|
|
77
|
-
### 5.
|
|
78
|
-
- **
|
|
79
|
-
-
|
|
64
|
+
### 5. Dozens of subagents run out of sight and ignore verbal rules
|
|
65
|
+
- **What goes wrong**: Workers live across scattered tabs, and rules mentioned in chat scroll out of context after ten turns.
|
|
66
|
+
- **How `dsh-chief` handles it**: Shows the main coordinator and subagents in one tree view with status controls, step Q&A, and one-click `分屏` live output streams. Pin rules with `📌` in Boundaries so every new task inherits them.
|
|
80
67
|
|
|
81
|
-
### 6.
|
|
82
|
-
- **
|
|
83
|
-
-
|
|
68
|
+
### 6. Long threads slow down, but opening a new window resets everything
|
|
69
|
+
- **What goes wrong**: After 100 turns you want a clean window without re-explaining workspace paths and task progress, and you do not want a background plugin quietly calling paid APIs every turn.
|
|
70
|
+
- **How `dsh-chief` handles it**: Defaults to `⏸ On-Demand` (0 background LLM calls) and mirrors your active session's provider/model. Edit or freeze handoff notes with `📌 定住防改`, then deploy a linked window carrying only the vault scope you pick.
|
|
84
71
|
|
|
85
72
|
---
|
|
86
73
|
|
|
87
|
-
##
|
|
74
|
+
## Inside the Sidebar
|
|
88
75
|
|
|
89
|
-
### 01 ·
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
76
|
+
### 01 · Chief Cockpit (`参谋` Tab)
|
|
77
|
+
- Send tasks in plain language from the bottom input box (with action buttons cleanly aligned at bottom-right). Status pills above show `⚡ 强介入`, `✦ 智选压缩`, `🛡 红线哨兵` (turning red with a colored shield when active), permission tier, and `⏹ 急停`.
|
|
78
|
+
- Enabling Strong Intervention opens a confirmation modal listing both active Physical Guard Walls and Forbidden Redlines side by side (`管理边界` + expand/collapse controls).
|
|
79
|
+
- Filter the feed by `全部 / 💬 问答 / 📋 回执`. User prompts and Chief receipts sit inside high-contrast grouped frames that collapse individually or all at once, multi-step suggestions merge into one top `▶ 执行建议` button, and background Chief work switches to the active tab with a frosted overlay and sweeping light-beam border.
|
|
93
80
|
|
|
94
|
-

|
|
95
82
|
|
|
96
83
|
---
|
|
97
84
|
|
|
98
|
-
### 02 ·
|
|
99
|
-
-
|
|
100
|
-
- **Inline Squad Controls**: Transition statuses, ask for plain-language explanations, dispatch tasks, or launch native `分屏` live streams in one click.
|
|
85
|
+
### 02 · Coordinator & Subagent Task Tree (`任务` Tab)
|
|
86
|
+
- Displays the root coordinator and active subagent lanes in a single layout instead of tiny nested lists, with inline status toggles, plain-language step explanations, and `分屏` live stream panes.
|
|
101
87
|
|
|
102
88
|
<div align="center">
|
|
103
|
-
<img src="assets/screenshots/02-full-spread-pyramid-dag.png" alt="02 -
|
|
89
|
+
<img src="assets/screenshots/02-full-spread-pyramid-dag.png" alt="02 - Subagent DAG View" width="76%" />
|
|
104
90
|
</div>
|
|
105
91
|
|
|
106
92
|
---
|
|
107
93
|
|
|
108
|
-
### 03 ·
|
|
109
|
-
- **
|
|
110
|
-
-
|
|
111
|
-
- **Spotlight & Diff Tracking**: Tracks `Synced` / `Local Modified` / `Local Only` diffs; inject selectively via **`📌 摆上桌面`** or send multi-archive **combinatorial relays**.
|
|
94
|
+
### 03 · 3-Tier Local Archive Vaults (`档案` Tab)
|
|
95
|
+
- Separates **💬 Session Cabinet** (strictly isolated per `rootSessionId`, with multi-cabinet support and one-click `一键收纳入柜` for temporary notes), **🌐 System Global Vault** (tracks `Synced` / `Local Modified` / `Local Only` diffs), and **🏛️ Precipitated Vault** (double-blind by default).
|
|
96
|
+
- Dossiers stay out of prompts until you click `📌 摆上桌面`.
|
|
112
97
|
|
|
113
98
|
<div align="center">
|
|
114
|
-
<img src="assets/screenshots/03-cold-archive-cabinet.png" alt="03 - Three-Tier Cold Vaults and
|
|
99
|
+
<img src="assets/screenshots/03-cold-archive-cabinet.png" alt="03 - Three-Tier Cold Vaults and Diff Tracking" width="68%" />
|
|
115
100
|
</div>
|
|
116
101
|
|
|
117
102
|
---
|
|
118
103
|
|
|
119
|
-
### 04 ·
|
|
120
|
-
-
|
|
121
|
-
- **Interactive Step Board**: Click any step to ask Chief *"Why does this step exist?"* without interrupting the main session.
|
|
104
|
+
### 04 · Core Objective Lock & Step Q&A (`规划` Top)
|
|
105
|
+
- Click `🎯 设为目标` to track long tasks, or click any step in the plan list to ask why that step exists without interrupting the main agent.
|
|
122
106
|
|
|
123
107
|
<div align="center">
|
|
124
108
|
<img src="assets/screenshots/04-dual-tier-goal-and-step-qa.png" alt="04 - Goal Supervision and Step Q&A" width="68%" />
|
|
@@ -126,10 +110,9 @@ Ordinary Todo plugins give you another scratchpad; always-on memory plugins floo
|
|
|
126
110
|
|
|
127
111
|
---
|
|
128
112
|
|
|
129
|
-
### 05 · Cross-Window Peer Linking &
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
- **Lossless Image Staging**: Uploaded screenshots persist directly in `<cwd>/.dsh-chief/uploads/` for multimodal lead fallback.
|
|
113
|
+
### 05 · Cross-Window Peer Linking & Mailbox (`协同` Tab)
|
|
114
|
+
- Connect multiple open DSH windows to share live progress, with automatic cache and mailbox purge on detach.
|
|
115
|
+
- Screenshots pasted into the cockpit are saved under `<cwd>/.dsh-chief/uploads/` so models can inspect real files instead of guessing.
|
|
133
116
|
|
|
134
117
|
<div align="center">
|
|
135
118
|
<img src="assets/screenshots/05-cross-session-collab-bus.png" alt="05 - Cross-Window Linking and Mailbox" width="68%" />
|
|
@@ -137,87 +120,133 @@ Ordinary Todo plugins give you another scratchpad; always-on memory plugins floo
|
|
|
137
120
|
|
|
138
121
|
---
|
|
139
122
|
|
|
140
|
-
### 06 ·
|
|
141
|
-
- **
|
|
142
|
-
-
|
|
123
|
+
### 06 · Guard Walls, Pinned Redlines & Must-Do Checks (`边界` Tab)
|
|
124
|
+
- The top **🧱 Physical Guard Walls** section blocks dangerous commands or paths before execution: add rules manually (`+ 手动驻墙`) or let Chief draft them from plain text (`✨ 参谋手搓墙`), toggle `🌐 Global`, `📁 Workspace`, or `⏸ Paused`, and merge multiple walls of the same type cleanly (cross-type merges are blocked).
|
|
125
|
+
- Below that, `allowed` (verification gates), `forbidden` (hard blockers), and `notes` separate global `📌` rules from session-only ones and list boundary proposals from blocked workers. Models cannot delete or mute locked walls or redlines on their own.
|
|
143
126
|
|
|
144
127
|
<div align="center">
|
|
145
|
-
<img src="assets/screenshots/06-pinned-bounds-and-handoff.png" alt="06 - Global
|
|
128
|
+
<img src="assets/screenshots/06-pinned-bounds-and-handoff.png" alt="06 - Pinned Global Redlines and Proposals" width="68%" />
|
|
146
129
|
</div>
|
|
147
130
|
|
|
148
131
|
---
|
|
149
132
|
|
|
150
|
-
### 07 ·
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
- **1-Click Chief Deployment & `idle-guard`**: Clones Chief config safely (forcing Strong Intervention off) to a fresh or target session.
|
|
133
|
+
### 07 · Session Handoff & Deployment (`规划` Bottom)
|
|
134
|
+
- Edit the Markdown handoff packet directly and lock it via `📌 定住防改` so later summaries do not overwrite your edits.
|
|
135
|
+
- Choose which archive scope follows into a new session (`None`, `Spotlight Only`, `Entire Drawer`, or `Full Session Cabinet`), while Strong Intervention safely resets to off.
|
|
154
136
|
|
|
155
137
|
<div align="center">
|
|
156
|
-
<img src="assets/screenshots/07-session-handoff-and-guard.png" alt="07 - Cross-Session
|
|
138
|
+
<img src="assets/screenshots/07-session-handoff-and-guard.png" alt="07 - Cross-Session Handoff and Deployment" width="68%" />
|
|
157
139
|
</div>
|
|
158
140
|
|
|
159
141
|
---
|
|
160
142
|
|
|
161
|
-
##
|
|
143
|
+
## Two Things to Know Before Enabling Tools
|
|
162
144
|
|
|
163
|
-
> [!
|
|
164
|
-
> Keep these two
|
|
145
|
+
> [!NOTE]
|
|
146
|
+
> Keep these two constraints in mind when using Wishing Box tools, `⚡ Strong Intervention`, or `✦ 智选压缩`:
|
|
165
147
|
>
|
|
166
|
-
> 1. **
|
|
167
|
-
>
|
|
168
|
-
>
|
|
169
|
-
>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
148
|
+
> 1. **Guardrails set the safety floor; your LLM sets the ceiling**
|
|
149
|
+
> The plugin guarantees 0-token vault isolation, permission gating, verified pre-compact saves, loop breakers, and `⏹ 急停`. Planning accuracy and code judgment still depend on the model assigned to Chief. Use a strong reasoning model for real engineering work.
|
|
150
|
+
> 2. **Avoid stacking heavy external prompt injections**
|
|
151
|
+
> Skip stacking hundreds of conflicting global rule lines or always-on memory plugins alongside `dsh-chief`. Extra prompt noise competes with active work and causes unnecessary loops or early trips. Keep prompts lean and store reference notes in the cold archive instead.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Modular Architecture (`v1.4.0`)
|
|
156
|
+
|
|
157
|
+
`v1.4.0` spans **38 backend modules (including 9 isolated modules under `pkg/safety/`) and 16 frontend modules** with zero `export let` bindings and zero circular imports. See [ARCHITECTURE.md](ARCHITECTURE.md) for boundaries and module contracts.
|
|
158
|
+
|
|
159
|
+
```mermaid
|
|
160
|
+
flowchart TB
|
|
161
|
+
subgraph UI["DSH Right Sidebar (client.js <- 16 source modules)"]
|
|
162
|
+
T1["Chief Tab (Grouped Q&A + Red Shield + FX Border)"]
|
|
163
|
+
T2["Tasks Tab (Coordinator + Subagent Lanes + Split Stream)"]
|
|
164
|
+
T3["Peers Tab (Cross-Window Link + Mailbox)"]
|
|
165
|
+
T4["Plan Tab (Objective Lock + Pinned Handoff + Deploy)"]
|
|
166
|
+
T5["Archives Tab (3-Tier Vaults + Sweep Notes)"]
|
|
167
|
+
T6["Boundaries Tab (Dynamic Guard Walls + 📌 Redlines)"]
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
subgraph Core["Local Backend & Safety Kernel (Zero External Deps · 38 modules)"]
|
|
171
|
+
Hot["Hot Boards: ~/.dsh/chief/board.json & boards/<sid>.json\nCross-process/worker_threads O_EXCL spin locks"]
|
|
172
|
+
Walls["Guard Walls: ~/.dsh/chief/guard-walls.json\nGlobal / Workspace / Paused"]
|
|
173
|
+
Cold["3-Tier Vaults: cabinets/ + global-vault/ + precipitated/"]
|
|
174
|
+
Bus["Safety & Resume: safety/*.js + chief-executor.js + taskLedger + chief-audit.jsonl"]
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
subgraph Agents["Host Execution Agents (tools/pre-execute gate)"]
|
|
178
|
+
Lead["Main Coordinator (@lead)"]
|
|
179
|
+
Subs["Subagents (@arch / @dev / @bench)"]
|
|
180
|
+
Peers["Linked DSH Windows"]
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
UI <-->|"27 Same-Origin Routes (/api/dsh-chief/*, fail-closed 403)"| Core
|
|
184
|
+
Hot -->|"Compact Hot State"| Lead
|
|
185
|
+
Hot -->|"Compact Hot State"| Subs
|
|
186
|
+
Walls -->|"Pre-Execution Block or Ask Prompt"| Lead
|
|
187
|
+
Walls -->|"Pre-Execution Block or Ask Prompt"| Subs
|
|
188
|
+
Cold -.->|"0 Tokens While Sealed\nInjected Only When Pinned to Desk"| Lead
|
|
189
|
+
Bus <-->|"chief_board / chief_memory\nchief_boundaries / chief_handoff"| Agents
|
|
190
|
+
```
|
|
174
191
|
|
|
175
192
|
---
|
|
176
193
|
|
|
177
|
-
##
|
|
194
|
+
## Installation & Host Compatibility
|
|
178
195
|
|
|
179
|
-
Search **`dsh-chief`** inside [dshmarket](https://github.com/dsh-market/dsh-market) / DSH Plugin Market, or install via CLI (replace `desktop` with `web` for web profile):
|
|
196
|
+
Search **`dsh-chief`** inside [dshmarket](https://github.com/dsh-market/dsh-market) / DSH Plugin Market, or install via CLI (replace `desktop` with `web` for the web profile):
|
|
180
197
|
|
|
181
198
|
```bash
|
|
182
|
-
# Option 1: Install
|
|
199
|
+
# Option 1: Install latest release (v1.4.0) from npm
|
|
183
200
|
dsh plugin --profile desktop add dsh-chief
|
|
184
201
|
|
|
185
|
-
# Option 2: Install
|
|
186
|
-
dsh plugin --profile desktop add https://github.com/gluztm/dsh-chief/releases/download/v1.2.1/dsh-chief-1.2.1.tgz
|
|
187
|
-
|
|
188
|
-
# Option 3: Install directly from GitHub repository
|
|
202
|
+
# Option 2: Install directly from GitHub main branch
|
|
189
203
|
dsh plugin --profile desktop add github:gluztm/dsh-chief
|
|
204
|
+
|
|
205
|
+
# Option 3: Install prebuilt GitHub Release tarball (v1.4.0)
|
|
206
|
+
dsh plugin --profile desktop add https://github.com/gluztm/dsh-chief/releases/download/v1.4.0/dsh-chief-1.4.0.tgz
|
|
190
207
|
```
|
|
191
208
|
|
|
192
|
-
### Host Version Compatibility
|
|
209
|
+
### Host Version Compatibility
|
|
193
210
|
|
|
194
|
-
| DeepSeek Harness (DSH) Version | Panel / Board /
|
|
211
|
+
| DeepSeek Harness (DSH) Version | Panel / Board / Vaults / Pre-Execute Walls | Named Subagent Tree (`task.dispatch` / `team.*`) | Notes |
|
|
195
212
|
| :--- | :---: | :---: | :--- |
|
|
196
|
-
| **`>= 0.2.2-rc.
|
|
197
|
-
| `0.2.
|
|
213
|
+
| **`>= 0.2.2-rc.5` (current desktop target)** | Full support | Full support | Matches `dsh-tool-fs` (`read`/`read_image`/`write`/`edit`/`apply_patch`), `str_replace_editor`, and native `{ kind: 'ask' }` approval dialogs |
|
|
214
|
+
| `0.2.2-rc.2 ~ 0.2.2-rc.4` | Full support | Full support | Provides native `subagents.resolveName`, `rootOf`, `namesOf`, and `tools/pre-execute` |
|
|
215
|
+
| `0.2.0 ~ 0.2.2-rc.1` | Panel works | Upgrade notice | Blocks unsafe `team.*` dispatch and prompts host upgrade |
|
|
198
216
|
|
|
199
217
|
---
|
|
200
218
|
|
|
201
|
-
##
|
|
219
|
+
## Tools Registered With the Model
|
|
202
220
|
|
|
203
|
-
| Tool Name | Purpose |
|
|
221
|
+
| Tool Name | Purpose | Common Actions |
|
|
204
222
|
| :--- | :--- | :--- |
|
|
205
|
-
| **`chief_board`** | Task DAG
|
|
206
|
-
| **`chief_memory`** | Session-scoped hot
|
|
207
|
-
| **`chief_boundaries`** | Global
|
|
208
|
-
| **`chief_handoff`** |
|
|
223
|
+
| **`chief_board`** | Task DAG updates, cold archive queries, peer & chief requests, inquiry replies, wall listing, elevations, compaction | `graph.plan`, `task.add`, `task.update`, `plan.set`, `cursor.set`, `mail.send`, `chief.request`, `inquiry.reply`, `wall.list`, `archive.save`, `archive.search`, `bounds.propose`, `permission.request`, `context.compact` |
|
|
224
|
+
| **`chief_memory`** | Session-scoped hot items (`decisions`, `progress`, `verify`, `risks`) | `list`, `get`, `add`, `update`, `remove` |
|
|
225
|
+
| **`chief_boundaries`** | Global `📌` redlines, must-do checks (`allowed`), and notes | `get`, `set`, `add`, `pin`, `remove` |
|
|
226
|
+
| **`chief_handoff`** | Preview and render self-contained Markdown handoff packets | `preview` / session handoff |
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Local Storage & Security Guarantees
|
|
231
|
+
|
|
232
|
+
- **Process & Worker-Thread Lock Safety**: `board-store.js`, `chief-state.js`, `archive-core.js`, and `safety/guard-walls.js` serialize writes with `O_EXCL` spin locks (handling transient Windows NTFS `EPERM`/`EACCES`/`EBUSY` retries) and `threadId`-scoped temporary files before atomic rename.
|
|
233
|
+
- **Isolated Safety Kernel & De-obfuscation**: `pkg/safety/` (9 modules) and `chief-executor.js` are checksum-locked and catch compound shells, inline scripts (`node -e` / `python -c` / `pwsh` / `iex` + Base64), quote-backslash credential obfuscation (zero false positives on `process.env.NODE_ENV` or `node .\env\setup.js`), `bounds.*` / wall human confirmation tokens, and single-use `capabilityScope` checks.
|
|
234
|
+
- **27 Loopback-Guarded HTTP Routes**: All `/api/dsh-chief/*` endpoints validate local origin/host headers and fail closed (`403`) if connection checks throw.
|
|
235
|
+
- **Secret Protection & Zero Telemetry**: Refuses to persist `sk-*`, `ghp_*`, Bearer tokens, `AIza*`, `AKIA*`, or private keys (auto-redacting to `[REDACTED]` when sweeping temporary notes). All boards, archives, guard walls, and `chief-audit.jsonl` stay locally under `~/.dsh/chief/`.
|
|
209
236
|
|
|
210
237
|
---
|
|
211
238
|
|
|
212
|
-
##
|
|
239
|
+
## Contributors
|
|
213
240
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
-
|
|
241
|
+
| Contributor | Role |
|
|
242
|
+
| --- | --- |
|
|
243
|
+
| [gluztm](https://github.com/gluztm) | Creator, product design, and maintainer |
|
|
244
|
+
| [Gemini](https://github.com/gemini-code-assist) | Feature development, `pkg/safety/` kernel, pre-execute guard walls, lazy intervention, and CI gates |
|
|
245
|
+
| [Codex](https://github.com/codex) | Modular architecture design, concurrency stress tests, and red-team boundary audits |
|
|
246
|
+
| [deepseek-ai](https://github.com/deepseek-ai) | DeepSeek Harness host runtime and SuperAgent workflow alignment |
|
|
218
247
|
|
|
219
248
|
---
|
|
220
249
|
|
|
221
|
-
##
|
|
250
|
+
## License
|
|
222
251
|
|
|
223
252
|
Licensed under **[GNU Affero General Public License v3.0 (`AGPL-3.0-only`)](LICENSE)**.
|