@shgroup/dsh-serenity-hooks 1.96.0 → 1.97.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/dsh.plugin.json +1 -1
- package/lib/index.js +22 -6
- package/lib/trajectory/interrupted.d.ts +16 -0
- package/package.json +1 -1
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-serenity-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.97.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"description": "宁静号 ACC harness(Native Cordis 插件):给 DSH 装一个「AI 工作区」——14 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/cheap-worker/localstore/container_admin;另三个 im-bridge/acc-diag/diagram 按配置条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表。轨迹声明 = 轨迹目录下的 trajectory.json(约束面 + 旧标识 uid + CRO 机器绑定 cro.host;旧名 trajectory-constraint.json / skiff.json 仍在读取族里);轨迹提示词 = 轨迹目录下的 PROMPT.md(一条轨迹「是谁、按什么章程工作」,所有轨迹通用,追加在容器层与质量层之后,不替换它们)。适配 DSH 0.1.7-rc.1 / 0.2.0-rc.1 / 0.2.1-rc.1(三档,deepseek-ai/deepseek-harness)。",
|
|
6
6
|
"engines": {
|
package/lib/index.js
CHANGED
|
@@ -9314,7 +9314,8 @@ function scanInterruptedSessions(projectDir, options = {}) {
|
|
|
9314
9314
|
scanned: 0,
|
|
9315
9315
|
skipped: 0,
|
|
9316
9316
|
errors: [],
|
|
9317
|
-
elapsedMs: 0
|
|
9317
|
+
elapsedMs: 0,
|
|
9318
|
+
excluded: []
|
|
9318
9319
|
};
|
|
9319
9320
|
if (!existsSync(projectDir)) {
|
|
9320
9321
|
result.elapsedMs = Date.now() - t0;
|
|
@@ -9332,7 +9333,13 @@ function scanInterruptedSessions(projectDir, options = {}) {
|
|
|
9332
9333
|
return result;
|
|
9333
9334
|
}
|
|
9334
9335
|
for (const sessionId of entries) {
|
|
9335
|
-
if (liveIds.has(sessionId))
|
|
9336
|
+
if (liveIds.has(sessionId)) {
|
|
9337
|
+
const lp = findSessionLog(join(projectDir, sessionId));
|
|
9338
|
+
if (lp !== null) try {
|
|
9339
|
+
if (statSync(lp).mtimeMs >= cutoff) result.excluded.push(sessionId);
|
|
9340
|
+
} catch {}
|
|
9341
|
+
continue;
|
|
9342
|
+
}
|
|
9336
9343
|
const dirPath = join(projectDir, sessionId);
|
|
9337
9344
|
const logPath = findSessionLog(dirPath);
|
|
9338
9345
|
if (logPath === null) continue;
|
|
@@ -11134,12 +11141,19 @@ function collectRunningSessionIds(nowMs) {
|
|
|
11134
11141
|
function renderInterruptedScan(input) {
|
|
11135
11142
|
const { projectDir, lookbackHours, scan } = input;
|
|
11136
11143
|
const lines = [];
|
|
11144
|
+
const excludedCount = scan.excluded.length;
|
|
11137
11145
|
lines.push(`═══ 末轮未跑完的 dsh 会话(回看 ${lookbackHours}h)═══`);
|
|
11138
11146
|
lines.push(` 扫描域: ${projectDir}`);
|
|
11139
|
-
lines.push(` 检查 ${scan.scanned} 个 · 命中 ${scan.sessions.length} · 跳过 ${scan.skipped} · 耗时 ${scan.elapsedMs}ms${scan.errors.length > 0 ? ` · 读取失败 ${scan.errors.length}` : ""}`);
|
|
11147
|
+
lines.push(` 检查 ${scan.scanned} 个 · 命中 ${scan.sessions.length} · 跳过 ${scan.skipped}` + (excludedCount > 0 ? ` · 排除在跑 ${excludedCount} 个` : "") + ` · 耗时 ${scan.elapsedMs}ms${scan.errors.length > 0 ? ` · 读取失败 ${scan.errors.length}` : ""}`);
|
|
11148
|
+
if (excludedCount > 0) {
|
|
11149
|
+
lines.push(` ⓘ 窗口内共 ${scan.scanned + excludedCount} 个会话,其中 ${excludedCount} 个**此刻有轮次在跑**,按「正在跑的不该被判为待续」的纪律被排除:`);
|
|
11150
|
+
for (const id of scan.excluded) lines.push(` - ${id}`);
|
|
11151
|
+
lines.push(" ⚠️ 这些**没有**被检查过。若你认为其中某个其实已死(进程重启后残留的\"在跑\"标记),");
|
|
11152
|
+
lines.push(" 请告知 ACC 维护方 —— 那是「在跑」表的判据问题,不是扫描的问题。");
|
|
11153
|
+
}
|
|
11140
11154
|
if (scan.sessions.length === 0) {
|
|
11141
11155
|
lines.push("");
|
|
11142
|
-
lines.push("✓ 没有末轮未跑完的会话 —— 无需处理。");
|
|
11156
|
+
lines.push(excludedCount > 0 ? `✓ 被检查的 ${scan.scanned} 个里没有末轮未跑完的 —— 另有 ${excludedCount} 个在跑,未检查(见上)。` : "✓ 没有末轮未跑完的会话 —— 无需处理。");
|
|
11143
11157
|
return lines.join("\n");
|
|
11144
11158
|
}
|
|
11145
11159
|
lines.push("");
|
|
@@ -11179,13 +11193,15 @@ function renderInterruptedScan(input) {
|
|
|
11179
11193
|
function renderContinueResult(input) {
|
|
11180
11194
|
const { projectDir, lookbackHours, scan, outcomes, dryRun } = input;
|
|
11181
11195
|
const lines = [];
|
|
11196
|
+
const excludedCount = scan.excluded.length;
|
|
11182
11197
|
const head = dryRun ? "续跑预告(dryRun,未注入任何消息)" : "中断续跑结果";
|
|
11183
11198
|
lines.push(`═══ ${head}(回看 ${lookbackHours}h)═══`);
|
|
11184
11199
|
lines.push(` 扫描域: ${projectDir}`);
|
|
11185
|
-
lines.push(` 检查 ${scan.scanned} 个 · 命中 ${scan.sessions.length} · 跳过 ${scan.skipped} · 耗时 ${scan.elapsedMs}ms`);
|
|
11200
|
+
lines.push(` 检查 ${scan.scanned} 个 · 命中 ${scan.sessions.length} · 跳过 ${scan.skipped}` + (excludedCount > 0 ? ` · 排除在跑 ${excludedCount} 个` : "") + ` · 耗时 ${scan.elapsedMs}ms`);
|
|
11201
|
+
if (excludedCount > 0) lines.push(` ⓘ 另有 ${excludedCount} 个会话**此刻有轮次在跑**,未检查:${scan.excluded.join("、")}`);
|
|
11186
11202
|
if (scan.sessions.length === 0) {
|
|
11187
11203
|
lines.push("");
|
|
11188
|
-
lines.push("✓ 没有末轮未跑完的会话 —— 无需续跑。");
|
|
11204
|
+
lines.push(excludedCount > 0 ? `✓ 被检查的 ${scan.scanned} 个里没有末轮未跑完的 —— 另有 ${excludedCount} 个在跑,未续(见上)。` : "✓ 没有末轮未跑完的会话 —— 无需续跑。");
|
|
11189
11205
|
return lines.join("\n");
|
|
11190
11206
|
}
|
|
11191
11207
|
lines.push("");
|
|
@@ -122,6 +122,22 @@ export interface ScanResult {
|
|
|
122
122
|
}>;
|
|
123
123
|
/** 扫描耗时(ms) */
|
|
124
124
|
elapsedMs: number;
|
|
125
|
+
/**
|
|
126
|
+
* 🔴🔴 **D245(2026-10-24):被"在跑"排除掉的会话 id** —— 必须报告,不能静默跳过。
|
|
127
|
+
*
|
|
128
|
+
* **为什么这个字段是必需的**(真机实测,owner 报障「唤起了没有成功恢复」):
|
|
129
|
+
* 修前 `if (liveIds.has(sessionId)) continue` 是**静默**跳过 —— 既不计数也不报告。
|
|
130
|
+
* 于是同一次扫描出现两个读数:
|
|
131
|
+
* - 生产 tick 日志:`扫 11 个 · 排除在跑 4 个`(**知道**有 4 个被藏起来)
|
|
132
|
+
* - 工具输出(guard 查的那个):`检查 7 个 · 命中 0 · 跳过 7`(**完全看不到**那 4 个)
|
|
133
|
+
* ⇒ guard 判「没事」⇒ 该救的没人救。
|
|
134
|
+
*
|
|
135
|
+
* ⇒ **判据(D237 同族)**:`scanned + excluded.size` 才是**窗口内总数**;
|
|
136
|
+
* 只报 `scanned` 会让读者以为"就这么点会话"。
|
|
137
|
+
* ⚠️ 这不是"多给一个诊断字段"——**它是"排除"这个动作的可见性**:
|
|
138
|
+
* 任何"我替你把某些东西藏起来"的实现,都必须报告藏了几个、藏了谁。
|
|
139
|
+
*/
|
|
140
|
+
excluded: string[];
|
|
125
141
|
}
|
|
126
142
|
/**
|
|
127
143
|
* 尾部窗口里**最后一条 `turn/start` 的轮号**(D244 输出面,给调用方做 A108 的现场判断)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shgroup/dsh-serenity-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.97.0",
|
|
4
4
|
"description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:14 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/cheap-worker/localstore/container_admin;另三个 im-bridge/acc-diag/diagram 按配置条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫/对外输出守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表。轨迹声明 = 轨迹目录下的 trajectory.json(约束面 + 旧标识 uid + CRO 机器绑定 cro.host;旧名 trajectory-constraint.json / skiff.json 仍在读取族里);轨迹提示词 = 轨迹目录下的 PROMPT.md(一条轨迹「是谁、按什么章程工作」,所有轨迹通用,追加在容器层与质量层之后,不替换它们)。适配 DSH 0.1.7-rc.1 / 0.2.0-rc.1 / 0.2.1-rc.1(三档)。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|