@shgroup/dsh-serenity-hooks 1.136.2 → 1.136.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-serenity-hooks",
3
- "version": "1.136.2",
3
+ "version": "1.136.3",
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/localstore/container_admin/browser_slot;另三个 im-bridge/diagram/reconstruct 按条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表 + 浏览器槽位管理(≤20 个独立 profile 的 Chrome 槽位,带占用归属与异常时向所属会话反向注入提醒)。轨迹声明 = 轨迹目录下的 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
@@ -5530,6 +5530,29 @@ function parseImports(explainStdout) {
5530
5530
  return out;
5531
5531
  }
5532
5532
  /**
5533
+ * 从引擎输出里抽出 `ERR [...]` 行(**读引擎自己的正文,不重造措辞**)。
5534
+ *
5535
+ * 🔴 为什么必须有这个(2026-11-15 butler 现场报障,已由我复现):
5536
+ * A1 失败时回执原先只有一句「结构校验未通过(引擎 ERR 行见报告)」——
5537
+ * **而"报告"根本不是一个可指的东西**:`check` 不落盘、不回传,操作者拿到的就是那一句。
5538
+ * 同一份内容交给 `ontology check` 会打印 `ERR [M8] Axiom #1 tokenization error: …` 等逐条错误。
5539
+ * ⇒ 信息一直在 `runOntologyCli` 的返回值里,是这一行把它丢了。
5540
+ *
5541
+ * ⚠️ 判据 = **引擎的原文**,⛔ 不是我重新写一句摘要(重写会漂,且丢掉 `[M8]` 这类可检索编号)。
5542
+ * @param out 引擎 stdout + stderr 的合并文本
5543
+ * @param max 最多带出几条(防一份烂文件把回执撑爆)
5544
+ */
5545
+ function extractEngineErrors(out, max = 5) {
5546
+ const hits = [];
5547
+ for (const line of out.split("\n")) {
5548
+ const t = line.trim();
5549
+ if (!/^ERR\s*\[M\d+\]/.test(t)) continue;
5550
+ hits.push(t);
5551
+ if (hits.length >= max) break;
5552
+ }
5553
+ return hits;
5554
+ }
5555
+ /**
5533
5556
  * 检查一个 skill 的预留口。
5534
5557
  *
5535
5558
  * @param skillDir skill 目录(绝对路径)
@@ -5554,10 +5577,22 @@ function inspectSkillOntology(skillDir, opts) {
5554
5577
  "--level",
5555
5578
  "strict"
5556
5579
  ], { cwd: opts.root });
5580
+ /**
5581
+ * 🔴 **失败必须把引擎的 ERR 行带出来**(2026-11-15 butler 报障 + 我复现)。
5582
+ *
5583
+ * 修前:`code === 1` ⇒ 只写「引擎 ERR 行见报告」。而 `check` 不落盘、不回传任何路径
5584
+ * ⇒ **"报告"在构造上不存在**,操作者被迫再跑一个工具(`ontology check`)才看得到
5585
+ * 「第几条公理、什么错」。同族判据:**报错要指路**(D262)—— 指一条不存在的路更坏。
5586
+ *
5587
+ * 这里的 ERR 行取自 `stdout + stderr`:引擎把校验错误打在 stdout 正文里、
5588
+ * 把 `[ONTO_VALIDATION_FAILED]` 的代码块打在 stderr,两者都要看。
5589
+ */
5590
+ const engineErrors = extractEngineErrors(`${c1.stdout}\n${c1.stderr}`);
5591
+ const errLine = engineErrors.length > 0 ? `\n ${engineErrors.join("\n ")}` : "";
5557
5592
  checks.push({
5558
5593
  id: "A1",
5559
5594
  ok: c1.code === 0,
5560
- detail: c1.code === 0 ? "strict 结构校验通过" : c1.code === 1 ? "结构校验未通过(引擎 ERR 行见报告)" : c1.code === 2 ? `解析失败/读不到文件(code 2)${c1.stderr.trim() !== "" ? `:${c1.stderr.trim().split("\n")[0]}` : ""}` : `引擎内部错误(code ${c1.code})`
5595
+ detail: c1.code === 0 ? "strict 结构校验通过" : c1.code === 1 ? `结构校验未通过(引擎 ${engineErrors.length} 条 ERR):${errLine}` : c1.code === 2 ? `解析失败/读不到文件(code 2)${c1.stderr.trim() !== "" ? `:${c1.stderr.trim().split("\n")[0]}` : ""}` : `引擎内部错误(code ${c1.code})`
5561
5596
  });
5562
5597
  const e1 = runOntologyCli(["explain", abs], { cwd: opts.root });
5563
5598
  const imports = e1.code === 0 ? parseImports(e1.stdout) : [];
@@ -49,6 +49,20 @@ export interface InspectOptions {
49
49
  /** CCC 根(引擎的解析基准) */
50
50
  root: string;
51
51
  }
52
+ /**
53
+ * 从引擎输出里抽出 `ERR [...]` 行(**读引擎自己的正文,不重造措辞**)。
54
+ *
55
+ * 🔴 为什么必须有这个(2026-11-15 butler 现场报障,已由我复现):
56
+ * A1 失败时回执原先只有一句「结构校验未通过(引擎 ERR 行见报告)」——
57
+ * **而"报告"根本不是一个可指的东西**:`check` 不落盘、不回传,操作者拿到的就是那一句。
58
+ * 同一份内容交给 `ontology check` 会打印 `ERR [M8] Axiom #1 tokenization error: …` 等逐条错误。
59
+ * ⇒ 信息一直在 `runOntologyCli` 的返回值里,是这一行把它丢了。
60
+ *
61
+ * ⚠️ 判据 = **引擎的原文**,⛔ 不是我重新写一句摘要(重写会漂,且丢掉 `[M8]` 这类可检索编号)。
62
+ * @param out 引擎 stdout + stderr 的合并文本
63
+ * @param max 最多带出几条(防一份烂文件把回执撑爆)
64
+ */
65
+ export declare function extractEngineErrors(out: string, max?: number): string[];
52
66
  /**
53
67
  * 检查一个 skill 的预留口。
54
68
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shgroup/dsh-serenity-hooks",
3
- "version": "1.136.2",
3
+ "version": "1.136.3",
4
4
  "description": "宁静号 ACC harness(Native Cordis 插件)——给 DeepSeek Harness 装一个「AI 工作区」:14 个工具(container_fs/cognitive_trajectory/dashboard/container_git/msm/praxis/ontology/serenity-skill-creator/localstore/container_admin/browser_slot;另三个 im-bridge/diagram/reconstruct 按条件出现)+ 机械约束(安全模式/工作区围墙/密钥守卫/对外输出守卫)+ 认知轨迹日志与原地重建 + 网页登录入口/IM 桥/认知轨迹唤醒注册表 + 浏览器槽位管理(≤20 个独立 profile 的 Chrome 槽位,带占用归属与异常时向所属会话反向注入提醒)。轨迹声明 = 轨迹目录下的 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": {