@feng0531/dsh-execution-bus 0.2.8 → 0.2.10
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 +3 -3
- package/dist/plugin.js +52 -13
- package/docs/releases/0.2.10.md +13 -0
- package/docs/releases/0.2.9.md +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
“萧何”是产品与模式显示名,执行总线是其技术功能;不新增人物 Agent,不进行角色扮演。仓库 dsh-execution-bus、npm 包名、execution_bus 工具名及 execution-bus-test 预设 ID 保持不变。历史版本发布说明保留当时名称。
|
|
6
6
|
|
|
7
|
-
DSH 独立插件:`@feng0531/dsh-execution-bus` · 当前版本 **0.2.
|
|
7
|
+
DSH 独立插件:`@feng0531/dsh-execution-bus` · 当前版本 **0.2.10**
|
|
8
8
|
|
|
9
9
|
> 当前是早期可运行版本,不是完整生产验收版。已验证真实 DSH 组件和脚本模型驱动的内存会话;真实模型、桌面界面和 PTC 完整链路尚未验收。**不支持重启后恢复任务。**
|
|
10
10
|
|
|
@@ -102,7 +102,7 @@ flowchart TD
|
|
|
102
102
|
2. 在你选定的隔离 DSH 配置依赖目录安装固定版本,不要在 DSH 程序安装目录执行:
|
|
103
103
|
|
|
104
104
|
```powershell
|
|
105
|
-
npm install --ignore-scripts @feng0531/dsh-execution-bus@0.2.
|
|
105
|
+
npm install --ignore-scripts @feng0531/dsh-execution-bus@0.2.10
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
这是 npm 目录示例。若目标配置使用 pnpm,应沿用其包管理器,不混用锁文件。遇到宿主 peer 版本冲突就停止,不用强制安装绕过。
|
|
@@ -231,7 +231,7 @@ npm run test:install # 临时目录安装,不操作日常 DSH
|
|
|
231
231
|
|
|
232
232
|
- [协议和投递语义](<docs/protocol.md>):字段、状态、重复处理与取消规则。
|
|
233
233
|
- [宿主兼容性与源码调用链](<docs/host-compatibility.md>):为什么可以等待,为什么不能跨重启恢复。
|
|
234
|
-
- [验证记录](<docs/validation.md>)、[0.2.
|
|
234
|
+
- [验证记录](<docs/validation.md>)、[0.2.10 发布说明](<docs/releases/0.2.10.md>):已验证与未验证范围。
|
|
235
235
|
- [维护者发布流程](<docs/RELEASING.md>):标签 CI、安装包校验与正式发布门禁。
|
|
236
236
|
|
|
237
237
|
## 许可
|
package/dist/plugin.js
CHANGED
|
@@ -86,6 +86,14 @@ export function apply(ctx) {
|
|
|
86
86
|
let settled = sharedJobs.get(jobKey);
|
|
87
87
|
if (!settled) {
|
|
88
88
|
try {
|
|
89
|
+
const outcome = attached.done.then((v) => ({
|
|
90
|
+
status: v.state === "succeeded"
|
|
91
|
+
? "completed"
|
|
92
|
+
: v.state === "cancelled"
|
|
93
|
+
? "killed"
|
|
94
|
+
: "failed",
|
|
95
|
+
detail: v.state,
|
|
96
|
+
}));
|
|
89
97
|
const job = ctx.jobs.start({
|
|
90
98
|
kind: "execution-bus",
|
|
91
99
|
label: "萧何 / Xiao He",
|
|
@@ -93,27 +101,58 @@ export function apply(ctx) {
|
|
|
93
101
|
run(h) {
|
|
94
102
|
handle = h;
|
|
95
103
|
return {
|
|
96
|
-
done:
|
|
97
|
-
status: v.state === "succeeded"
|
|
98
|
-
? "completed"
|
|
99
|
-
: v.state === "cancelled"
|
|
100
|
-
? "killed"
|
|
101
|
-
: "failed",
|
|
102
|
-
detail: v.state,
|
|
103
|
-
})),
|
|
104
|
+
done: outcome,
|
|
104
105
|
cancel: abort,
|
|
105
106
|
};
|
|
106
107
|
},
|
|
107
108
|
});
|
|
108
109
|
const ownerId = exec.agent.id;
|
|
110
|
+
let hostCommitted;
|
|
111
|
+
const hostSettlement = new Promise(resolve => { hostCommitted = resolve; });
|
|
112
|
+
const stopSettlementObserver = ctx.jobs.events.subscribe({ owner: ownerId }, event => {
|
|
113
|
+
if ((event.type === "settled" || event.type === "removed") && event.job.id === job && event.job.owner === ownerId)
|
|
114
|
+
hostCommitted();
|
|
115
|
+
});
|
|
109
116
|
// One registered host waiter suppresses extra completion messages for every attachment.
|
|
110
117
|
settled = (async () => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
try {
|
|
119
|
+
for (;;) {
|
|
120
|
+
const view = await ctx.jobs.wait(job, 60000, ownerId);
|
|
121
|
+
if (view.status !== "running" && view.status !== "stopping")
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
ctx.jobs.remove(job, ownerId);
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
// rc.2 has no typed not-found code. Match only this minted Job and
|
|
128
|
+
// confirm absence in the original owner scope; never swallow access/service errors.
|
|
129
|
+
let alreadyRemoved = false;
|
|
130
|
+
try {
|
|
131
|
+
alreadyRemoved =
|
|
132
|
+
error instanceof Error &&
|
|
133
|
+
error.message === `unknown job ${job}` &&
|
|
134
|
+
!ctx.jobs.list(ownerId).some((view) => view.id === job);
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
/* Preserve the original wait/cleanup error. */
|
|
138
|
+
}
|
|
139
|
+
// A broken wait channel does not terminate execution. Keep caller cancellation
|
|
140
|
+
// attached, drain both producer and host outcome, then attempt cleanup once.
|
|
141
|
+
await attached.done;
|
|
142
|
+
if (!alreadyRemoved) {
|
|
143
|
+
await hostSettlement;
|
|
144
|
+
try {
|
|
145
|
+
ctx.jobs.remove(job, ownerId);
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
/* Best effort cleanup must not replace the original service error. */
|
|
149
|
+
}
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
finally {
|
|
154
|
+
stopSettlementObserver();
|
|
115
155
|
}
|
|
116
|
-
ctx.jobs.remove(job, ownerId);
|
|
117
156
|
})();
|
|
118
157
|
sharedJobs.set(jobKey, settled);
|
|
119
158
|
void settled.then(() => sharedJobs.delete(jobKey), () => sharedJobs.delete(jobKey));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# 萧何 / Xiao He 0.2.10
|
|
2
|
+
|
|
3
|
+
## BUG 修复
|
|
4
|
+
|
|
5
|
+
Job 等待通道或清理服务异常时,不再在执行仍运行中提前结束原工具调用。保留调用方取消监听,等待原执行和宿主 outcome 达到终态,再尽力清理并返回原服务错误。不会因通信失败自动重跑或误记执行失败。
|
|
6
|
+
|
|
7
|
+
确切所属 Job 已被先行移除的幂等处理保持不变。其他异常仍明确失败;二次查询或清理失败不替换原错误。若清理服务持续不可用,记录仍可能保留至宿主所属生命周期清理,不声称保证删除。
|
|
8
|
+
|
|
9
|
+
## 验证与边界
|
|
10
|
+
|
|
11
|
+
新增两项真实宿主组件故障注入:等待立即失败时原调用返回前任务已达成功终态且 Job 已清理;等待与清理同时失败仍保留原始错误。用例修复前均失败。全量回归、标签四矩阵 CI 和发布包验证按既有门禁执行。
|
|
12
|
+
|
|
13
|
+
不合作的 Handler 仍可能阻碍排空。真实模型、GUI 与 PTC 完整链路未验收,不支持跨重启恢复。兼容 DSH 0.2.0-rc.2,非商业源码公开许可;不自动安装或重启 DSH。
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# 萧何 / Xiao He 0.2.9
|
|
2
|
+
|
|
3
|
+
## BUG 修复
|
|
4
|
+
|
|
5
|
+
修复终态 Job 被其他合法订阅者先行移除时,原工具调用错误返回 unknown job、无法交付已有执行结果的问题。等待及清理路径仅对当前调用创建的确切 Job 未找到错误、且同一 owner 查询确认已不存在时做幂等处理;继续等待原执行结果,不把记录移除当作成功。权限及其他服务异常仍明确失败,不一概吞掉。
|
|
6
|
+
|
|
7
|
+
宿主 0.2.0-rc.2 未提供类型化 not-found 错误码,因此此兼容处理限定精确错误消息与已创建 Job 身份,不能推广为所有宿主版本的错误协议。
|
|
8
|
+
|
|
9
|
+
## 验证与边界
|
|
10
|
+
|
|
11
|
+
新增真实 Cordis/ToolRuntime/LocalJobs 回归,覆盖先行清理不覆盖成功及失败结果、交付标记更新、清理服务异常仍报错。缺陷用例修复前失败。全量与标签四矩阵 CI、包校验及生产隔离安装按既有发布门禁执行。
|
|
12
|
+
|
|
13
|
+
DSH 0.2.0-rc.2,非商业源码公开许可。真实模型、GUI 和 PTC 完整链路未验收,不支持跨重启恢复;发布不自动安装或重启 DSH。
|