@ran-sh/dsh-crew 0.3.7 → 0.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/README.md +52 -67
- package/README.zh.md +52 -68
- package/docs/gpt-relay-extension.md +103 -0
- package/docs/job-contracts.md +107 -0
- package/docs/readiness-matrix.md +73 -0
- package/lib/client.js +3446 -3446
- package/official-web-bridge/cordis.patch.yml +4 -0
- package/official-web-bridge/entry.mjs +1 -0
- package/official-web-bridge/lib/client.js +3446 -0
- package/official-web-bridge/package.json +26 -0
- package/package.json +8 -3
- package/scripts/build-client.mjs +5 -1
- package/scripts/verify-official-bridge-e2e.mjs +180 -0
- package/src/dsh-cli-runtime.mjs +219 -208
- package/src/extension-contract.mjs +78 -0
- package/src/failure-classification.mjs +29 -0
- package/src/hub/index.mjs +343 -62
- package/src/information-flow.mjs +67 -0
- package/src/install/npx-lifecycle.mjs +149 -5
- package/src/install/official-web.mjs +132 -0
- package/src/job-contracts.mjs +218 -0
- package/src/mcp-runtime.mjs +16 -8
- package/src/official-web-bridge.mjs +211 -0
- package/src/role-profiles.mjs +107 -0
- package/src/runtime-identity.mjs +6 -1
- package/src/server.mjs +141 -98
- package/src/workflow-runtime.mjs +109 -10
- package/src/workspace-context.mjs +146 -0
- package/src/workspace-readiness.mjs +32 -0
package/README.md
CHANGED
|
@@ -1,124 +1,109 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="./docs/images/dsh-crew-logo.png" alt="DSH Crew" width="120" />
|
|
3
|
-
</p>
|
|
1
|
+
<p align="center"><img src="./docs/images/dsh-crew-logo.png" alt="DSH Crew" width="120" /></p>
|
|
4
2
|
|
|
5
3
|
<h1 align="center">DSH Crew</h1>
|
|
6
4
|
|
|
7
|
-
<p align="center"><strong>
|
|
5
|
+
<p align="center"><strong>Workers and reviewers for Codex Desktop and Claude Code, shown inside the official DeepSeek Harness UI.</strong></p>
|
|
8
6
|
|
|
9
7
|
<p align="center"><a href="./README.md"><b>English</b></a> · <a href="./README.zh.md">简体中文</a></p>
|
|
10
8
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
- A `worker` for implementation, fixes, tests, and repository inspection.
|
|
14
|
-
- A read-only `reviewer` with its own model priority.
|
|
15
|
-
- Ordered provider/model routing for both roles.
|
|
16
|
-
- Temporary Git worktrees by default, so workers do not edit your main workspace directly.
|
|
17
|
-
- A live settings and jobs panel inside DeepSeek Harness.
|
|
18
|
-
|
|
19
|
-
## Install
|
|
9
|
+
## Quick start
|
|
20
10
|
|
|
21
11
|
Requirements: Node.js; Git is required for worktree isolation.
|
|
22
12
|
|
|
23
13
|
```bash
|
|
24
14
|
npm install -g @ran-sh/dsh-crew@latest
|
|
25
15
|
dsh-crew install
|
|
16
|
+
dsh-crew integrate
|
|
26
17
|
```
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## Start Harness
|
|
31
|
-
|
|
32
|
-
Windows PowerShell:
|
|
33
|
-
|
|
34
|
-
```powershell
|
|
35
|
-
$env:DSH_HOME = "$HOME\.config\dsh-crew\harness"
|
|
36
|
-
& "$env:DSH_HOME\runtime\node_modules\.bin\dsh.cmd" --profile dsh-crew --port 3210
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
macOS / Linux:
|
|
19
|
+
Start the official Harness on port 3080 as usual:
|
|
40
20
|
|
|
41
21
|
```bash
|
|
42
|
-
|
|
43
|
-
"$HOME/.config/dsh-crew/harness/runtime/node_modules/.bin/dsh" \
|
|
44
|
-
--profile dsh-crew --port 3210
|
|
22
|
+
npx -y @deepseek-ai/dsh web --host 127.0.0.1 --port 3080
|
|
45
23
|
```
|
|
46
24
|
|
|
47
|
-
Open <http://127.0.0.1:
|
|
25
|
+
Open <http://127.0.0.1:3080> and go to **Settings → DSH Crew**. The official 3080 process displays the UI; Crew work stays in an isolated backend on `127.0.0.1:3210`, which the bridge starts in the background when needed.
|
|
48
26
|
|
|
49
27
|
## Configure
|
|
50
28
|
|
|
51
|
-
1.
|
|
52
|
-
2.
|
|
53
|
-
3.
|
|
54
|
-
4.
|
|
55
|
-
5.
|
|
29
|
+
1. Click **Refresh Harness Models**.
|
|
30
|
+
2. Set the model order for Worker and Reviewer.
|
|
31
|
+
3. Keep Worker on **Auto** for automatic delegation.
|
|
32
|
+
4. Reviewer defaults to **Manual**; enable automatic review only when wanted.
|
|
33
|
+
5. Keep **worktree** isolation for coding tasks.
|
|
56
34
|
|
|
57
|
-
|
|
35
|
+
With one configured model, both roles simply use that model. With several models, each role tries its ordered list and falls back to the next available model. Settings modules are collapsible and show their effective state while closed.
|
|
58
36
|
|
|
59
|
-
## Use
|
|
60
|
-
|
|
61
|
-
Ask your coding host naturally:
|
|
37
|
+
## Use from Codex or Claude
|
|
62
38
|
|
|
63
39
|
```text
|
|
64
40
|
Use ds-worker to implement this change and run the tests.
|
|
65
41
|
Use ds-reviewer to review the result.
|
|
66
42
|
```
|
|
67
43
|
|
|
68
|
-
Legacy `ds-flash` and `ds-pro` aliases remain
|
|
44
|
+
Legacy `ds-flash` and `ds-pro` aliases remain compatible.
|
|
69
45
|
|
|
70
|
-
##
|
|
46
|
+
## Results and reviews
|
|
71
47
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
48
|
+
Crew returns a compact, machine-readable Result Contract by default: status,
|
|
49
|
+
tests, changed files, review verdict, model-selection trace, artifact references,
|
|
50
|
+
and canonical lifecycle events. Raw agent prose and full patches are not copied
|
|
51
|
+
through every hand-off. An automatic Reviewer receives a bounded evidence
|
|
52
|
+
capsule and inspects the isolated workspace directly.
|
|
77
53
|
|
|
78
|
-
|
|
54
|
+
MCP callers can request `detail: "full"` on `dsh_run_worker` or
|
|
55
|
+
`dsh_worker_result` for explicit debugging and recovery. Contract details are in
|
|
56
|
+
[Job contracts and information flow](./docs/job-contracts.md).
|
|
79
57
|
|
|
80
|
-
|
|
58
|
+
## Common commands
|
|
81
59
|
|
|
82
60
|
```bash
|
|
83
|
-
|
|
84
|
-
dsh-crew
|
|
61
|
+
dsh-crew status # installation and integration health
|
|
62
|
+
dsh-crew inspect # machine-readable capabilities and readiness
|
|
63
|
+
dsh-crew jobs list # machine-readable jobs
|
|
64
|
+
dsh-crew jobs watch <job-id> --after 0
|
|
65
|
+
dsh-crew update # update and repair enabled integrations
|
|
66
|
+
dsh-crew integrate # connect official 3080 UI to isolated 3210 Crew
|
|
67
|
+
dsh-crew detach # remove only the 3080 bridge
|
|
68
|
+
dsh-crew uninstall # remove Crew, keep config and backups
|
|
85
69
|
```
|
|
86
70
|
|
|
87
|
-
|
|
71
|
+
`dsh-crew uninstall --purge` also removes Crew configuration and backups.
|
|
88
72
|
|
|
89
|
-
|
|
73
|
+
If you prefer a completely separate UI, run `dsh-crew detach`, then start the isolated profile directly:
|
|
90
74
|
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
```powershell
|
|
76
|
+
$env:DSH_HOME = "$HOME\.config\dsh-crew\harness"
|
|
77
|
+
& "$env:DSH_HOME\runtime\node_modules\.bin\dsh.cmd" --profile dsh-crew --host 127.0.0.1 --port 3210
|
|
94
78
|
```
|
|
95
79
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
Developer install:
|
|
80
|
+
The bridge backs up the official `web` profile before its first change and registers only a lightweight proxy/client package. The full Crew Hub, model execution, config, and credentials stay under:
|
|
99
81
|
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
node scripts/setup.mjs install
|
|
82
|
+
```text
|
|
83
|
+
~/.config/dsh-crew/harness
|
|
84
|
+
profile: dsh-crew
|
|
104
85
|
```
|
|
105
86
|
|
|
106
|
-
|
|
87
|
+
For launchers at `<= 0.3.3`, first refresh the launcher because the old updater cannot discover newer releases and cannot be retroactively fixed:
|
|
107
88
|
|
|
108
89
|
```bash
|
|
109
|
-
|
|
90
|
+
npm install -g @ran-sh/dsh-crew@latest
|
|
91
|
+
dsh-crew update
|
|
110
92
|
```
|
|
111
93
|
|
|
112
|
-
##
|
|
94
|
+
## Source development
|
|
113
95
|
|
|
114
96
|
```bash
|
|
115
|
-
|
|
97
|
+
git clone https://github.com/Ran-sh/dsh-crew.git
|
|
98
|
+
cd dsh-crew
|
|
99
|
+
node scripts/setup.mjs install
|
|
116
100
|
node --test test/*.test.mjs
|
|
117
101
|
pnpm run build:client
|
|
118
|
-
|
|
102
|
+
node scripts/setup.mjs uninstall
|
|
119
103
|
```
|
|
120
104
|
|
|
121
|
-
More detail: [Changelog](./CHANGELOG.md) · [Readiness matrix](./docs/readiness-matrix.md) · [
|
|
105
|
+
More detail: [Changelog](./CHANGELOG.md) · [Readiness matrix](./docs/readiness-matrix.md) · [Job contracts](./docs/job-contracts.md)
|
|
106
|
+
· [GPT-first extension](./docs/gpt-relay-extension.md)
|
|
122
107
|
|
|
123
108
|
## License
|
|
124
109
|
|
package/README.zh.md
CHANGED
|
@@ -1,124 +1,108 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="./docs/images/dsh-crew-logo.png" alt="DSH Crew" width="120" />
|
|
3
|
-
</p>
|
|
1
|
+
<p align="center"><img src="./docs/images/dsh-crew-logo.png" alt="DSH Crew" width="120" /></p>
|
|
4
2
|
|
|
5
3
|
<h1 align="center">DSH Crew</h1>
|
|
6
4
|
|
|
7
|
-
<p align="center"><strong>让 Codex Desktop
|
|
5
|
+
<p align="center"><strong>让 Codex Desktop 和 Claude Code 使用 Worker / Reviewer,并统一显示在官方 DeepSeek Harness 界面中。</strong></p>
|
|
8
6
|
|
|
9
7
|
<p align="center"><a href="./README.md">English</a> · <a href="./README.zh.md"><b>简体中文</b></a></p>
|
|
10
8
|
|
|
11
|
-
##
|
|
9
|
+
## 快速开始
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
- `reviewer`:使用独立模型顺序进行只读审查。
|
|
15
|
-
- 为两个角色分别设置 Provider / Model 优先级。
|
|
16
|
-
- 默认使用临时 Git worktree,不直接修改主工作区。
|
|
17
|
-
- 在 DeepSeek Harness 中查看设置、进度和结果。
|
|
18
|
-
|
|
19
|
-
## 安装
|
|
20
|
-
|
|
21
|
-
需要 Node.js;worktree 隔离还需要 Git。
|
|
11
|
+
需要 Node.js;使用 worktree 隔离还需要 Git。
|
|
22
12
|
|
|
23
13
|
```bash
|
|
24
14
|
npm install -g @ran-sh/dsh-crew@latest
|
|
25
15
|
dsh-crew install
|
|
16
|
+
dsh-crew integrate
|
|
26
17
|
```
|
|
27
18
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
## 启动 Harness
|
|
31
|
-
|
|
32
|
-
Windows PowerShell:
|
|
33
|
-
|
|
34
|
-
```powershell
|
|
35
|
-
$env:DSH_HOME = "$HOME\.config\dsh-crew\harness"
|
|
36
|
-
& "$env:DSH_HOME\runtime\node_modules\.bin\dsh.cmd" --profile dsh-crew --port 3210
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
macOS / Linux:
|
|
19
|
+
照常在 3080 端口启动官方 Harness:
|
|
40
20
|
|
|
41
21
|
```bash
|
|
42
|
-
|
|
43
|
-
"$HOME/.config/dsh-crew/harness/runtime/node_modules/.bin/dsh" \
|
|
44
|
-
--profile dsh-crew --port 3210
|
|
22
|
+
npx -y @deepseek-ai/dsh web --host 127.0.0.1 --port 3080
|
|
45
23
|
```
|
|
46
24
|
|
|
47
|
-
打开 <http://127.0.0.1:
|
|
25
|
+
打开 <http://127.0.0.1:3080>,进入 **设置 → DSH Crew**。3080 只显示官方界面;Crew 的任务与模型执行继续隔离在 `127.0.0.1:3210`,需要时由桥接在后台自动启动。
|
|
48
26
|
|
|
49
27
|
## 配置
|
|
50
28
|
|
|
51
|
-
1.
|
|
52
|
-
2.
|
|
53
|
-
3.
|
|
54
|
-
4.
|
|
55
|
-
5.
|
|
29
|
+
1. 点击“刷新 Harness 模型”。
|
|
30
|
+
2. 分别设置 Worker 和 Reviewer 的模型顺序。
|
|
31
|
+
3. Worker 保持 **Auto**,即可自动委派。
|
|
32
|
+
4. Reviewer 默认 **Manual**;确实需要自动复审时再开启。
|
|
33
|
+
5. 编码任务建议保持 **worktree** 隔离。
|
|
56
34
|
|
|
57
|
-
|
|
35
|
+
只配置一个模型时,两个角色直接使用它。配置多个模型时,每个角色按自己的排序调用,失败后依次回退。设置模块可以展开/收起,收起后仍显示当前状态。
|
|
58
36
|
|
|
59
|
-
##
|
|
60
|
-
|
|
61
|
-
直接告诉编码宿主:
|
|
37
|
+
## 在 Codex 或 Claude 中使用
|
|
62
38
|
|
|
63
39
|
```text
|
|
64
40
|
使用 ds-worker 实现这个改动并运行测试。
|
|
65
41
|
使用 ds-reviewer 审查结果。
|
|
66
42
|
```
|
|
67
43
|
|
|
68
|
-
旧的 `ds-flash`、`ds-pro`
|
|
44
|
+
旧的 `ds-flash`、`ds-pro` 别名仍可使用。
|
|
69
45
|
|
|
70
|
-
##
|
|
46
|
+
## 结果与复审信息流
|
|
71
47
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```
|
|
48
|
+
Crew 默认返回紧凑、机器可读的 Result Contract:状态、测试、改动文件、
|
|
49
|
+
Reviewer 结论、模型选择轨迹、候选引用和规范化生命周期事件。Worker 的
|
|
50
|
+
整段原始回答和完整 patch 不会在每次交接时重复传递;自动 Reviewer 只接收
|
|
51
|
+
有大小上限的证据胶囊,并直接检查隔离工作区。
|
|
77
52
|
|
|
78
|
-
|
|
53
|
+
MCP 调用方如需排障或恢复,可以在 `dsh_run_worker` 或
|
|
54
|
+
`dsh_worker_result` 中显式传入 `detail: "full"`。完整契约见
|
|
55
|
+
[任务契约与信息流](./docs/job-contracts.md)。
|
|
79
56
|
|
|
80
|
-
|
|
57
|
+
## 常用命令
|
|
81
58
|
|
|
82
59
|
```bash
|
|
83
|
-
|
|
84
|
-
dsh-crew
|
|
60
|
+
dsh-crew status # 查看安装与集成状态
|
|
61
|
+
dsh-crew inspect # 输出机器可读的能力与就绪度
|
|
62
|
+
dsh-crew jobs list # 输出机器可读的任务列表
|
|
63
|
+
dsh-crew jobs watch <job-id> --after 0
|
|
64
|
+
dsh-crew update # 更新并自动修复已启用的集成
|
|
65
|
+
dsh-crew integrate # 将官方 3080 界面连接到隔离的 3210 Crew
|
|
66
|
+
dsh-crew detach # 只移除 3080 桥接
|
|
67
|
+
dsh-crew uninstall # 卸载 Crew,保留配置和备份
|
|
85
68
|
```
|
|
86
69
|
|
|
87
|
-
|
|
70
|
+
`dsh-crew uninstall --purge` 才会同时删除 Crew 配置和备份。
|
|
88
71
|
|
|
89
|
-
|
|
72
|
+
如果想继续使用完全独立的界面,先运行 `dsh-crew detach`,再直接启动隔离 profile:
|
|
90
73
|
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
74
|
+
```powershell
|
|
75
|
+
$env:DSH_HOME = "$HOME\.config\dsh-crew\harness"
|
|
76
|
+
& "$env:DSH_HOME\runtime\node_modules\.bin\dsh.cmd" --profile dsh-crew --host 127.0.0.1 --port 3210
|
|
94
77
|
```
|
|
95
78
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
开发者安装:
|
|
79
|
+
桥接首次修改前会备份官方 `web` profile,并且只注册轻量代理/客户端包。完整 Crew Hub、模型执行、配置和凭据仍位于:
|
|
99
80
|
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
node scripts/setup.mjs install
|
|
81
|
+
```text
|
|
82
|
+
~/.config/dsh-crew/harness
|
|
83
|
+
profile: dsh-crew
|
|
104
84
|
```
|
|
105
85
|
|
|
106
|
-
|
|
86
|
+
对于 `<= 0.3.3` 的旧启动器,请先刷新启动器;旧 updater 无法发现新版本,也无法被追溯修复:
|
|
107
87
|
|
|
108
88
|
```bash
|
|
109
|
-
|
|
89
|
+
npm install -g @ran-sh/dsh-crew@latest
|
|
90
|
+
dsh-crew update
|
|
110
91
|
```
|
|
111
92
|
|
|
112
|
-
##
|
|
93
|
+
## 源码开发
|
|
113
94
|
|
|
114
95
|
```bash
|
|
115
|
-
|
|
96
|
+
git clone https://github.com/Ran-sh/dsh-crew.git
|
|
97
|
+
cd dsh-crew
|
|
98
|
+
node scripts/setup.mjs install
|
|
116
99
|
node --test test/*.test.mjs
|
|
117
100
|
pnpm run build:client
|
|
118
|
-
|
|
101
|
+
node scripts/setup.mjs uninstall
|
|
119
102
|
```
|
|
120
103
|
|
|
121
|
-
|
|
104
|
+
更多资料:[Changelog](./CHANGELOG.md) · [Readiness Matrix](./docs/readiness-matrix.md) · [任务契约](./docs/job-contracts.md)
|
|
105
|
+
· [GPT-first 扩展接入](./docs/gpt-relay-extension.md)
|
|
122
106
|
|
|
123
107
|
## License
|
|
124
108
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# GPT-first extension integration
|
|
2
|
+
|
|
3
|
+
DSH Crew is an optional DeepSeek Harness capability extension for Codex,
|
|
4
|
+
Claude Code, ZCode, or another top-level executor. It is not itself a top-level
|
|
5
|
+
executor and does not choose the next project-wide step.
|
|
6
|
+
|
|
7
|
+
## Discover
|
|
8
|
+
|
|
9
|
+
With the isolated Hub running on 3210:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
dsh-crew inspect
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The same versioned JSON is available at:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
GET http://127.0.0.1:3210/_dsh/dsh-crew/extension
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
An orchestrator should check `capabilities.deepseek.worker` or
|
|
22
|
+
`capabilities.deepseek.reviewer`, then inspect `readiness.status` and its
|
|
23
|
+
components. `DEGRADED` is not `READY`; a model catalog proves discoverability,
|
|
24
|
+
not successful authentication or execution.
|
|
25
|
+
|
|
26
|
+
## Dispatch and observe
|
|
27
|
+
|
|
28
|
+
Codex and Claude normally call the six MCP tools. `dsh_run_worker` and
|
|
29
|
+
`dsh_spawn_worker` accept the backward-compatible fields plus:
|
|
30
|
+
|
|
31
|
+
- `job_id`: optional caller id, echoed separately from Crew's internal id.
|
|
32
|
+
- `profile`: a Worker/Reviewer profile id.
|
|
33
|
+
- `workspace`: per-job `repo_root`, `branch`, and `worktree` policy.
|
|
34
|
+
- `constraints`: per-job timeout and fallback override.
|
|
35
|
+
- `workspace_id`: a registered Workspace Context id.
|
|
36
|
+
- `context_refs`: extra workspace-relative instruction references.
|
|
37
|
+
|
|
38
|
+
Poll `dsh_worker_result` with `after_sequence` to receive only newer canonical
|
|
39
|
+
events. HTTP consumers can use:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
POST /_dsh/dsh-crew/jobs
|
|
43
|
+
GET /_dsh/dsh-crew/jobs/:id/contract?after=0
|
|
44
|
+
GET /_dsh/dsh-crew/jobs/:id/events?after=0
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
CLI consumers use `dsh-crew jobs list|get|watch|cancel|submit`; `submit`
|
|
48
|
+
accepts a versioned JSON Job Request through `--request`.
|
|
49
|
+
|
|
50
|
+
The compact Contract is the automation surface. Full prose and patches require
|
|
51
|
+
an explicit `detail=full` recovery/debug request.
|
|
52
|
+
|
|
53
|
+
## Profiles
|
|
54
|
+
|
|
55
|
+
Profiles live in `~/.config/dsh-crew/profiles.json`:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"schema_version": 1,
|
|
60
|
+
"profiles": {
|
|
61
|
+
"worker-fast": {
|
|
62
|
+
"role": "worker",
|
|
63
|
+
"routing": "priority",
|
|
64
|
+
"isolation": "worktree",
|
|
65
|
+
"fallback": false,
|
|
66
|
+
"timeout_seconds": 300,
|
|
67
|
+
"review_strictness": "standard"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The built-ins are `worker-default` and `reviewer-default`. The registry can be
|
|
74
|
+
read or atomically replaced through loopback-only `GET/POST
|
|
75
|
+
/_dsh/dsh-crew/profiles`. Invalid documents are rejected before replacement.
|
|
76
|
+
|
|
77
|
+
## Workspace Context
|
|
78
|
+
|
|
79
|
+
Workspace facts live in `~/.config/dsh-crew/workspaces.json`:
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"schema_version": 1,
|
|
84
|
+
"workspaces": {
|
|
85
|
+
"dsh-crew": {
|
|
86
|
+
"repo_root": "D:/work/dsh-crew",
|
|
87
|
+
"default_branch": "main",
|
|
88
|
+
"instruction_files": ["AGENTS.md"],
|
|
89
|
+
"validation_hints": ["node --test test/*.test.mjs", "pnpm run build:client"]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Only bounded path references and hints cross the hand-off. Crew never copies
|
|
96
|
+
instruction-file contents into the registry. Use loopback-only `GET/POST
|
|
97
|
+
/_dsh/dsh-crew/workspaces` to read or atomically replace it.
|
|
98
|
+
|
|
99
|
+
## Failure handling
|
|
100
|
+
|
|
101
|
+
Every structured failure includes a `family` and `disposition`. Dispositions
|
|
102
|
+
are `retry`, `fallback`, `human`, or `terminal` (`none` for success), allowing
|
|
103
|
+
the GPT-first controller to decide the next step without parsing logs.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Job contracts and information flow
|
|
2
|
+
|
|
3
|
+
DSH Crew is a narrow bridge and scheduler. Codex or Claude owns the main task;
|
|
4
|
+
Crew owns one delegated Worker/Reviewer workflow and reports auditable evidence
|
|
5
|
+
back to the caller.
|
|
6
|
+
|
|
7
|
+
## Information flow
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
caller objective
|
|
11
|
+
-> Worker in isolated workspace
|
|
12
|
+
-> structured outcome + candidate reference
|
|
13
|
+
-> optional Reviewer inspects the workspace directly
|
|
14
|
+
-> compact Result Contract + canonical job events
|
|
15
|
+
-> caller
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The Worker receives the complete delegated objective. After it finishes, Crew
|
|
19
|
+
does not copy the Worker's raw prose or full patch into the Reviewer prompt.
|
|
20
|
+
The Reviewer receives a bounded capsule containing the objective, reported
|
|
21
|
+
changes/tests/risks, changed-file names, base revision, and candidate
|
|
22
|
+
fingerprint. It opens the relevant files and runs `git diff` in the isolated
|
|
23
|
+
workspace when deeper inspection is needed.
|
|
24
|
+
|
|
25
|
+
The Hub keeps only the latest assistant message needed as the final Delivery
|
|
26
|
+
Report. It does not retain an ever-growing list of intermediate assistant
|
|
27
|
+
messages.
|
|
28
|
+
|
|
29
|
+
## Canonical events
|
|
30
|
+
|
|
31
|
+
Every workflow result can expose a versioned, ordered `canonical_events` list.
|
|
32
|
+
Each event has `schema_version`, `event_id`, `job_id`, `sequence`, `type`, `at`,
|
|
33
|
+
`role`, `attempt`, and bounded structured `data`.
|
|
34
|
+
|
|
35
|
+
Supported event types (the allow-list is versioned; `approval.required` is
|
|
36
|
+
reserved for a future approval broker and is not emitted by the current
|
|
37
|
+
runtime):
|
|
38
|
+
|
|
39
|
+
- `job.created`, `job.started`
|
|
40
|
+
- `model.selected`, `model.fallback`
|
|
41
|
+
- `worker.started`, `worker.completed`
|
|
42
|
+
- `review.started`, `review.completed`
|
|
43
|
+
- `approval.required`
|
|
44
|
+
- `job.completed`, `job.failed`, `job.cancelled`
|
|
45
|
+
|
|
46
|
+
Events never carry a candidate patch, raw provider payload, credential, or full
|
|
47
|
+
assistant response. `event_cursor` identifies the latest event in status views.
|
|
48
|
+
|
|
49
|
+
## Result Contract
|
|
50
|
+
|
|
51
|
+
`dsh_run_worker` and `dsh_worker_result` default to `detail: "compact"`. Their
|
|
52
|
+
`evidence` object contains:
|
|
53
|
+
|
|
54
|
+
- `status`: `PASS`, `FAIL`, `PARTIAL`, or `BLOCKED`
|
|
55
|
+
- structured execution/test/delivery/review summary
|
|
56
|
+
- bounded model-selection trace
|
|
57
|
+
- changed files, reported changes, tests, risks, and unverified checks
|
|
58
|
+
- reviewer verdict and evidence when review ran
|
|
59
|
+
- candidate fingerprint/base revision and workspace recovery state
|
|
60
|
+
- bounded machine error code/message when execution failed
|
|
61
|
+
|
|
62
|
+
Raw worker prose and candidate patch text are excluded. For an explicit debug
|
|
63
|
+
or recovery operation, pass `detail: "full"`; this preserves the previous rich
|
|
64
|
+
workflow view and adds the same evidence envelope.
|
|
65
|
+
|
|
66
|
+
## Profiles, Workspace Context, and watch
|
|
67
|
+
|
|
68
|
+
Both blocking and asynchronous MCP dispatch accept optional `job_id`, `profile`,
|
|
69
|
+
`workspace`, `constraints`, `workspace_id`, and `context_refs` fields. The
|
|
70
|
+
caller id is echoed as `client_job_id`; it never replaces Crew's internal id.
|
|
71
|
+
Profiles control role-compatible
|
|
72
|
+
routing, isolation, timeout, fallback, and review strictness. Workspace Context
|
|
73
|
+
adds bounded project facts by reference; instruction file contents are opened by
|
|
74
|
+
the Agent in the workspace rather than copied through the hand-off.
|
|
75
|
+
|
|
76
|
+
`dsh_worker_result` accepts `after_sequence`. The response includes only newer
|
|
77
|
+
`canonical_events` plus the current numeric `event_cursor`, so callers can watch
|
|
78
|
+
long jobs without replaying the entire event history.
|
|
79
|
+
|
|
80
|
+
The isolated Hub also exposes `/extension`, `/profiles`, `/workspaces`,
|
|
81
|
+
`/jobs/:id/contract`, and `/jobs/:id/events`. All remain loopback-only.
|
|
82
|
+
|
|
83
|
+
Per-job precedence is request `constraints` > Profile > session defaults.
|
|
84
|
+
`workspace.branch` pins the isolated base revision; `workspace.worktree` accepts
|
|
85
|
+
`auto`, `existing`, or `none`. Workspace preflight reports `READY`, `CONFLICT`,
|
|
86
|
+
`READ_ONLY`, or `UNAVAILABLE` before dispatch.
|
|
87
|
+
|
|
88
|
+
The CLI is a JSON projection of the same local HTTP surface:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
dsh-crew jobs list
|
|
92
|
+
dsh-crew jobs get <job-id> --detail compact
|
|
93
|
+
dsh-crew jobs watch <job-id> --after <sequence>
|
|
94
|
+
dsh-crew jobs cancel <job-id>
|
|
95
|
+
dsh-crew jobs submit --request job.json
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Compatibility boundary
|
|
99
|
+
|
|
100
|
+
The internal legacy phase events remain in the explicit full view for current
|
|
101
|
+
debug consumers. Canonical events and the compact Result Contract are the
|
|
102
|
+
stable integration surface for new Codex, Claude, CLI, and HTTP consumers.
|
|
103
|
+
|
|
104
|
+
This design borrows the useful boundary from
|
|
105
|
+
[OpenMausBot](https://github.com/milind-soni/OpenMausBot)—a small provider
|
|
106
|
+
contract and one normalized event stream—without adopting its desktop chat,
|
|
107
|
+
bot roster, persona, connector, or general-purpose agent-platform scope.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# DSH Crew Readiness Matrix
|
|
2
|
+
|
|
3
|
+
The readiness matrix is a conservative diagnostic surface for release and environment confidence. Its primary rule is simple:
|
|
4
|
+
|
|
5
|
+
> Missing evidence is never PASS.
|
|
6
|
+
|
|
7
|
+
The matrix is emitted by `hubStatus()` and is therefore visible inside the existing `dsh_worker_config` response under `hub_compatibility.readiness_matrix`.
|
|
8
|
+
|
|
9
|
+
## Statuses
|
|
10
|
+
|
|
11
|
+
- `PASS` — direct evidence confirms the row.
|
|
12
|
+
- `FAIL` — a check actually ran and produced an incompatible or failed result.
|
|
13
|
+
- `BLOCKED` — the check could not run because required infrastructure or authorization was unavailable.
|
|
14
|
+
- `SKIP` — the row is intentionally not applicable for the active policy/path.
|
|
15
|
+
- `NOT_RUN` — no trusted evidence has been supplied for the row.
|
|
16
|
+
|
|
17
|
+
`BLOCKED` and `SKIP` are not failures. `NOT_RUN` is not success.
|
|
18
|
+
|
|
19
|
+
## Evidence classes
|
|
20
|
+
|
|
21
|
+
The matrix separates three kinds of evidence:
|
|
22
|
+
|
|
23
|
+
1. `live-runtime` — facts the current process can directly observe, such as Hub reachability and protocol compatibility.
|
|
24
|
+
2. `ci` — platform validation such as Linux deterministic, Windows regressions, and future macOS smoke.
|
|
25
|
+
3. `real-execution` — provider/model and workflow behavior that requires a genuine DSH execution.
|
|
26
|
+
|
|
27
|
+
Only live checks are populated automatically by the current runtime. CI and real-execution rows remain `NOT_RUN` until a trusted higher layer supplies explicit evidence.
|
|
28
|
+
|
|
29
|
+
## Target rows
|
|
30
|
+
|
|
31
|
+
- `linux_deterministic`
|
|
32
|
+
- `windows_regressions`
|
|
33
|
+
- `macos_smoke`
|
|
34
|
+
- `hub_compatibility`
|
|
35
|
+
- `provider_catalog`
|
|
36
|
+
- `deepseek_flash`
|
|
37
|
+
- `deepseek_pro`
|
|
38
|
+
- `opencode_go_mimo_qwen`
|
|
39
|
+
- `reviewer_pipeline`
|
|
40
|
+
- `cancellation_timeout_escalation`
|
|
41
|
+
- `standalone_official`
|
|
42
|
+
|
|
43
|
+
## Provider/catalog rule
|
|
44
|
+
|
|
45
|
+
The Hub client does not know the active worker provider mode, so its embedded matrix leaves `provider_catalog` as `NOT_RUN` with `PROVIDER_MODE_UNKNOWN` rather than guessing.
|
|
46
|
+
|
|
47
|
+
When a higher layer knows the provider mode and has actually read the Harness catalog, it may build a more specific matrix:
|
|
48
|
+
|
|
49
|
+
- DeepSeek Official strict mode: catalog row may be `SKIP` / `PROVIDER_CATALOG_NOT_REQUIRED`.
|
|
50
|
+
- Follow-DSH with successful catalog read: `PASS` / `PROVIDER_CATALOG_RESOLVED`.
|
|
51
|
+
- Follow-DSH with an attempted but failed catalog read: `FAIL` / `PROVIDER_CATALOG_UNAVAILABLE`.
|
|
52
|
+
- Hub unavailable/incompatible before catalog access: `BLOCKED`, not `FAIL`.
|
|
53
|
+
|
|
54
|
+
## Credential safety
|
|
55
|
+
|
|
56
|
+
The matrix never reads or returns credential values, provider configuration payloads, quota data, pricing, cookies, tokens, or raw exception dumps. The standalone row defaults to `NOT_RUN` / `CREDENTIAL_STATUS_NOT_PROBED` unless an authorized real-environment validation explicitly reports evidence.
|
|
57
|
+
|
|
58
|
+
## Trusted evidence
|
|
59
|
+
|
|
60
|
+
`buildReadinessMatrix()` accepts an optional evidence map so CI/report aggregation can be added later without changing row semantics. Evidence can set only the existing status vocabulary. Invalid statuses are ignored rather than broadening the contract.
|
|
61
|
+
|
|
62
|
+
An evidence record may contain:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"status": "PASS",
|
|
67
|
+
"reason_code": "CI_GREEN",
|
|
68
|
+
"evidence_source": "github-actions",
|
|
69
|
+
"evidence_ref": "run-123"
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The matrix does not fetch or trust arbitrary remote data by itself. Loading and authenticating an evidence source is the responsibility of the higher layer that calls the builder.
|