@kasenri/dsh-orbit 0.5.10 → 0.6.1

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 CHANGED
@@ -44,6 +44,7 @@ Executor, Smart Watchdog, durable state and bounded recovery.
44
44
  |---|---|
45
45
  | `@deepseek-ai/dsh` | `0.1.5-rc.2` |
46
46
  | `@deepseek-ai/cordis` | `4.0.2` |
47
+ | `@goodandready/dsh-moa`(可选 MoA 集成) | `>=0.2.19`(已验证 0.2.19、0.2.20) |
47
48
  | Node.js | `>= 22.19.0` |
48
49
 
49
50
  Requires the DSH base services: `agents`, `subagents`, `tools`, `sessions`
@@ -56,6 +57,10 @@ mirror remains available when a Git source is preferred:
56
57
 
57
58
  ```bash
58
59
  dsh plugin --profile web add @kasenri/dsh-orbit
60
+
61
+ # 可选:为 Orbit 的关键步骤启用多候选 MoA 选优
62
+ dsh plugin --profile web add @goodandready/dsh-moa@0.2.20
63
+
59
64
  # Git source alternative, tracks the mirror repository HEAD:
60
65
  # dsh plugin --profile web add github:KasenRi/dsh-orbit
61
66
  ```
@@ -134,6 +139,40 @@ Commander/Watchdog use settings then explicit config; Executor uses the Session
134
139
  selection, with explicit config only when there is no Session. Missing or
135
140
  unavailable roles block creation of a Run before any child starts.
136
141
 
142
+ ### Optional MoA execution mode (v0.6.0)
143
+
144
+ Orbit 可以把少量高不确定性步骤标记为 `execution_mode: "MOA"`。这不是新的顶层 Supervisor,也不会把状态机交给 MoA:
145
+
146
+ ```text
147
+ Commander PLAN
148
+
149
+ SINGLE ─────────────→ Executor
150
+ \
151
+ MOA → Candidate 1 ─┐
152
+ Candidate 2 ─┼→ Judge → Orbit controlled promotion → Executor verification
153
+ Candidate 3 ─┘
154
+
155
+ Commander STEP_EVALUATE
156
+ ```
157
+
158
+ 关键边界:
159
+
160
+ - Candidate 和 Judge 都是**零工具**的一次性模型调用,不能直接 `write/edit/bash/subagent`。
161
+ - 候选文件只写入 `.cx/moa/<run>/<step>/candidate-N/`,普通 Executor 不能修改 `.cx`。
162
+ - Judge 只负责在已有候选中做相对选择,必须返回 `WINNER_CANDIDATE_INDEX`;它不能决定 `PASS_CURRENT_STEP`,也不能生成新的综合实现。
163
+ - 胜出候选由 Orbit Supervisor 确定性提升到项目目录;之后仍由 Executor 运行真实测试,最后由 Commander 做绝对验收。
164
+ - 整个 MoA Step 只消耗一个 Orbit loop;候选和 Judge 的内部调用受独立的候选数和 `maxMoaSteps` 限制。
165
+ - 候选数固定为 2–4;至少需要 2 个成功候选。失败不会偷偷回退成单 Executor,也不会自动换 Judge 模型。
166
+ - `peerCritique` 默认关闭;开启时只允许一轮有界互评。
167
+ - 新 Run 会冻结 Candidate/Judge 的 provider、model、reasoningEffort、MoA policy,以及原版 MoA settings 中用户显式配置的价格表(如果存在)。中途修改 UI 只影响下一次 Run。
168
+ - Candidate/Judge 的 input/output/cache Token 来自 DSH 子 Session 的真实 `assistant/message.usage`;如果冻结的价格表能匹配对应 Route,同时记录美元成本;没有价格时只展示 Token,并明确标记无法计算成本,不猜价格。
169
+ - Orbit 会把一个不含目标正文、候选正文、Judge 推理或代码的有界运行快照写进所属 DSH Session projection。v0.6.1 的配置首页不再直接展开这些运行详情,而是保持紧凑;运行快照仍保留给会话恢复与后续运行态界面使用。
170
+ - 冷恢复按 durable phase 继续:`JUDGE` 不重跑 Candidate,`SELECTED` 不重跑 Candidate/Judge,`PROMOTED` 不重跑 Candidate/Judge/Promotion。
171
+ - Orbit ACTIVE 时会在下游 hook 之前阻止独立 `/moa`,避免原版 MoA 的自动 Promotion 与 Orbit 同时争夺 workspace。
172
+ - `@goodandready/dsh-moa` 是可选依赖;未安装时普通 SINGLE 模式完全不受影响。
173
+
174
+ 当前兼容层接受 `@goodandready/dsh-moa >=0.2.19`,并已在 0.2.19 与 0.2.20 上完成真实 DSH 烟雾验证。更高版本不再被 Orbit 主动版本上限拦截;若上游未来发生实际 API 不兼容,再按真实故障修正。Orbit 只依赖它公开的项目上下文接口;候选调度、Judge、持久化与 Promotion 权限均由 `moa-adapter.ts` 封装。
175
+
137
176
  ## State machine
138
177
 
139
178
  ```text
@@ -190,6 +229,13 @@ PLAN → EXECUTE → EVALUATE → SUCCESS
190
229
  | `routes.commander` | none | Explicit profile fallback; normally user-selected in Orbit settings. |
191
230
  | `routes.executor` | none | Explicit config only without a Session; otherwise follows DSH Session selection. |
192
231
  | `routes.watchdog` | none | Explicit profile fallback; normally user-selected in Orbit settings. |
232
+ | `moa.enabled` | `false` | 允许 Commander 为关键步骤选择 `MOA` 执行模式。 |
233
+ | `moa.candidateCount` | `3` | 固定候选数量,运行时只允许 2–4。 |
234
+ | `moa.candidates` | none | 用户显式选择的 Candidate routes;不会从 Executor 猜测或继承。 |
235
+ | `moa.judge` | none | 用户显式选择的 Judge route。 |
236
+ | `moa.peerCritique` | `false` | 是否启用一轮有界候选互评。 |
237
+ | `moa.maxMoaSteps` | `2` | 一个 Run 最多允许的 MoA 步骤数(上限受 1–5 步 Plan 约束)。 |
238
+ | MoA prices | none | 若 `dsh-moa` settings 已配置 `prices`,Orbit 在新 Run 冻结该表并据真实 Token 计算成本;否则不估价。 |
193
239
  | `executorTools` | read/read_image/glob/grep | Base read-only subset; mutation tools require Step capabilities. |
194
240
  | `browserTools` | `["agent_browser"]` | Browser capability tool names. |
195
241
  | `commanderReadOnlyTools` | read/glob/grep/web… | Commander allowlist. |
@@ -224,7 +270,7 @@ dsh plugin --profile web add github:KasenRi/dsh-orbit
224
270
  | CX mode | Orbit mode (`orbit模式`; `cx模式` still works) |
225
271
  | `ctx.cx` | `ctx.orbit` (same `OrbitService` instance; `ctx.cx` remains an alias) |
226
272
 
227
- - `.cx/state.json` remains unchanged.
273
+ - `.cx/state.json` 路径保持不变;v0.6.0 写入 schema 3,旧 schema 2 状态可继续读取,并在下一次正常持久化时升级。
228
274
  - Legacy `cx模式` remains supported.
229
275
  - Existing durable runs do not need migration: Orbit reads the same
230
276
  `.cx/state.json`, including historical `CX_*` error strings.
package/lib/activation.js CHANGED
@@ -118,6 +118,13 @@ export function registerOrbitToggleCommand(ctx) {
118
118
  export function installOrbitGestureBoundary(ctx, options = {}) {
119
119
  ctx.on('agent/pre-step', async (payload, next) => {
120
120
  const { agent, messages, signal } = payload;
121
+ const blocked = options.competingMutationBlock?.(agent, messages);
122
+ if (blocked !== undefined) {
123
+ for (const message of messages)
124
+ agent.session.append('user/message', message, { surfaceOp: 'append' });
125
+ options.onBlocked?.(agent, blocked);
126
+ return { kind: 'enter', messages: [] };
127
+ }
121
128
  const decision = await next();
122
129
  if (decision.kind === 'reject')
123
130
  return decision;