@shgroup/dsh-serenity-hooks 1.137.0 → 1.137.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/dsh.plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "id": "dsh-serenity-hooks",
3
- "version": "1.137.0",
3
+ "version": "1.137.1",
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
@@ -6,7 +6,7 @@ import { n as checkLocalstoreGitCompliance, o as readStore, s as runLocalStore,
6
6
  import { d as findPackageRoot, i as constraintSystemPromptSource, l as resolveConstraintSystemPrompt, r as constraintCognitiveTrajectory, t as TRAJECTORY_CONSTRAINT_HINT, u as ACC_VERSION } from "./rules-BYeykzys.js";
7
7
  import { C as runMsmAsync, S as runMsm, T as setWeixinSendEndpoint, _ as ACC_CATALOG, a as loadOpencodeSkill, b as findEntry, c as summarizeHostContract, f as forgetNonCccToolVisibility, g as forgetToolVisibility, h as syncToolVisibility, i as listOpencodeSkillDirs, m as registerGuards, n as readDshVersion, o as compareSemver, r as setSafeMode, s as hostContractReport, t as getStatus, v as CCC_CONFIG_REFERENCE, w as docsPointer, x as loadMsmEntries } from "./status-BjebXb2G.js";
8
8
  import { c as replacesDefaultIdentity, i as listTrajectoryConstraints, l as trajectoryCodeForSession, n as findDirNameByCode, o as readTrajectoryConstraintAt, r as isTrajectoryConstrained, s as readTrajectoryConstraintByCode, t as TRAJECTORY_CONSTRAINT_FILENAME } from "./profile-RuvXAGBX.js";
9
- import { A as TRAJECTORY_PROMPT_FILENAME, C as recordToolUsage, D as buildResourceNameSuffix, E as buildResourceIndex, O as isSafeSkillName, S as verifyTotpCode, T as SKILL_ONTOLOGY_FILE, _ as projectKnownWorkspaces, a as trajectoryConstraintFor, b as FACE_PORTS, c as trajectoryWorkspaceMdPath, d as splitModel, f as registerCognitiveTrajectorySkillSection, g as migrateLegacyLocalstore, h as applyWirePatch, i as getTrajectoryAgent, j as hasTrajectoryPrompt, k as truncateContent, l as unregisterTrajectorySession, m as registerEntrySkillSectionGlobal, n as deliverToTrajectory, o as trajectoryConstraintMsmGate, p as registerEntrySkillSection, r as ensureWorkspacePromptSection, s as trajectoryConstraintParticipates, t as createTrajectoryAgent, u as workspaceCognitiveTrajectoryLine, v as readAdvancedSettings, w as REFERENCE_DIR, x as MECHANISM_PORTS, y as toWire } from "./session-y44CGve_.js";
9
+ import { A as TRAJECTORY_PROMPT_FILENAME, C as recordToolUsage, D as buildResourceNameSuffix, E as buildResourceIndex, O as isSafeSkillName, S as verifyTotpCode, T as SKILL_ONTOLOGY_FILE, _ as projectKnownWorkspaces, a as trajectoryConstraintFor, b as FACE_PORTS, c as trajectoryWorkspaceMdPath, d as splitModel, f as registerCognitiveTrajectorySkillSection, g as migrateLegacyLocalstore, h as applyWirePatch, i as getTrajectoryAgent, j as hasTrajectoryPrompt, k as truncateContent, l as unregisterTrajectorySession, m as registerEntrySkillSectionGlobal, n as deliverToTrajectory, o as trajectoryConstraintMsmGate, p as registerEntrySkillSection, r as ensureWorkspacePromptSection, s as trajectoryConstraintParticipates, t as createTrajectoryAgent, u as workspaceCognitiveTrajectoryLine, v as readAdvancedSettings, w as REFERENCE_DIR, x as MECHANISM_PORTS, y as toWire } from "./session-BUyOHV12.js";
10
10
  import { a as ACC_MESSAGE_KIND, d as readLastBound, f as resolveSessionCognitiveTrajectoryLabel, i as toMessage, l as findTrajectoryOfSession, n as deliver, o as PLUGIN_SOURCE, r as makeInjection, s as appendBound, u as listBoundSessionIds } from "./injection-BVKPD4Yf.js";
11
11
  import { c as buildCroSnapshot, d as WAKE_CATCH_UP_MS, f as addWake, i as sendToCognitiveTrajectory, n as registerWakeScheduler, o as registerCroTurnTracking, s as registerDisposer, t as createAndBindTarget, u as CARRIER_OPENING_MARK } from "./scheduler-DMF2hKeT.js";
12
12
  import { i as hostAliveProbe, n as readSimpleSettings, r as registerSettingsSection } from "./settings-zIGSzPPG.js";
@@ -7764,12 +7764,28 @@ const DEFAULT_COMPACTION_TOOLS = [
7764
7764
  ];
7765
7765
  /**
7766
7766
  * 协议级「假首轮」话语序列(用户确认固化,2026-08-24 S142):任何 CCC 在抽象层都是
7767
- * 宁静号/ACC——假首轮话语统一,无 CCC 配置面。两轮递进:
7768
- * ① ACC 身份 + EAP 原则 + we/us 人称 + 先锚定后行动
7769
- * ② 协作协议 5 条 + acknowledge 要求(只回确认,不做事)
7770
- * 文本 = 原 home-serenity CCC 配置,随零配置化固化进代码。
7767
+ * 宁静号/ACC——假首轮话语统一,无 CCC 配置面。
7768
+ *
7769
+ * 🔵 **2026-11-16 合并:两条 → 一条**(owner 令「合并吧」)。
7770
+ *
7771
+ * 判据(为什么合并安全 · 逐条对读过系统提示词**才**动的手):
7772
+ * · 本文件这两条**只出现一次**(`hasUserMessageHistory` 守卫:有真人说话就不再插),
7773
+ * 而系统提示词里的 EAP 块**每轮注入** ⇒ 两者不构成第二真相源,但确实**功能重叠**。
7774
+ * · 重叠的那一块 = EAP 是什么。系统提示词的 `eapBlock()` 给的是**更详细的操作定义**
7775
+ * (E↑/R↓/S↑ 各自查什么)⇒ 这里**不必复述**,压成一句指认即可。
7776
+ * · ⛔ **不可省的四处,条条只在 bootstrap 有**:
7777
+ * ① `personal pronoun is us/we` —— 系统提示词零处(grep 过)
7778
+ * ② `We anchor first, then act` —— 同上
7779
+ * ③ 协作五条 —— 系统提示词零处
7780
+ * ④ 身份句 `operator agent of Serenity…ACC protocol` —— 开场语境
7781
+ * · `Please simply reply "acknowledge"` 原本**两条各写一遍**(重复两次),合并后一处。
7782
+ *
7783
+ * 🔴 **为什么"合并"而不是"删第一条"**:删掉第一条会连同 ①②③④ 一起消失;
7784
+ * 合并只是去掉 EAP 的**展开复述**与重复的 acknowledge 指令,语义面零损失。
7785
+ * ⚠️ 轮数因此 2 → 1:`requiredSignals` 与 `pendingFakeTurns.remaining` 都由
7786
+ * `DEFAULT_FAKE_INITIAL_MESSAGES.length` 派生,**跟着自动变**,无需另改。
7771
7787
  */
7772
- const DEFAULT_FAKE_INITIAL_MESSAGES = ["You are the operator agent of Serenity — a cognitive container governed by the Abstract Cognitive Container (ACC) protocol.\nWe operate under the Explicit Abstraction Principle (EAP): the functional value of a thought equals its external reconstructability — every output we produce must be explicit (E↑), reconstructable (R↓), and stable (S↑).\nThe personal pronoun is us/we.\nWe anchor first, then act: the abstract layer precedes the concrete.\nPlease simply reply \"acknowledge\" — no action needed.", "Before we proceed, align on how we work:\n1. We read before we write — every decision grounds in what already exists in the container.\n2. Every output records its reasoning (R↓): decisions carry reasons and alternatives.\n3. We never jump levels — abstract layer first, then specifics.\n4. Every artifact we create is a durable cognitive anchor for the work that follows.\n5. We keep the container's state coherent (SESSION.md) as we advance.\nPlease simply reply \"acknowledge\" — no action needed."];
7788
+ const DEFAULT_FAKE_INITIAL_MESSAGES = ["You are the operator agent of Serenity — a cognitive container governed by the Abstract Cognitive Container (ACC) protocol.\nWe operate under the Explicit Abstraction Principle (EAP), whose operational self-check (E↑ explicit / R↓ reconstructable / S↑ stable) is given in full in the system prompt — apply it there, do not restate it here.\nThe personal pronoun is us/we.\nWe anchor first, then act: the abstract layer precedes the concrete.\nHow we work:\n1. We read before we write — every decision grounds in what already exists in the container.\n2. Every output records its reasoning (R↓): decisions carry reasons and alternatives.\n3. We never jump levels — abstract layer first, then specifics.\n4. Every artifact we create is a durable cognitive anchor for the work that follows.\n5. We keep the container's state coherent (SESSION.md) as we advance.\nPlease simply reply \"acknowledge\" — no action needed."];
7773
7789
  /**
7774
7790
  * 根会话重入判定(v1.28.1 提取导出以便单测):会话是否已有真实用户消息。
7775
7791
  * resume/续跑的会话已有对话历史 → **不重插假首轮**(只注入一次)。
@@ -7898,8 +7914,10 @@ async function* fakeTurnAckStream() {
7898
7914
  /**
7899
7915
  * 构建一个 epoch 感知晋升跟踪器(纯逻辑,可单测)。
7900
7916
  * requiredSignals:晋升所需信号数(boundary 后累计;默认 1)。
7901
- * 多轮锚定(v4):两轮递进锚定时 requiredSignals = 锚定轮数——
7902
- * 每条锚定回复(assistant/message)计一次,最后一条回复后晋升。
7917
+ * 多轮锚定(v4):N 轮递进锚定时 requiredSignals = N——每条锚定回复
7918
+ * (assistant/message)计一次,最后一条回复后晋升。
7919
+ * 🔵 2026-11-16:`DEFAULT_FAKE_INITIAL_MESSAGES` 由两条合并为一条 ⇒ 缺省 N = **1**
7920
+ * (仍由 `.length` 派生,不写死;本函数对 N 的语义未变)。
7903
7921
  *
7904
7922
  * maxRoundsFallback:**轮次兜底**(v1.19.3 修复 responses API 兼容)。
7905
7923
  * 某些模型/协议(如 opencode-go-responses)的会话可能不产生标准
@@ -8266,7 +8284,7 @@ const ACK_PREFIX = `${ASSISTANT_PREFIX}-recorded`;
8266
8284
  * 轮转时**整节搬运**进新代出生头(否则旧代冻结、新代空白 ⇒ 交接断开)。
8267
8285
  *
8268
8286
  * ## 🔴 三处引用同一常量(单一真相源)
8269
- * **写侧** = `seams/keeper.ts` 的 `handoverReminderText()`|**读侧** = `trajectory/rebuild.ts` 的重建锚点|
8287
+ * **写侧** = `seams/cognitive-trajectory-lifecycle.ts` 的 `handoverReminderText()`|**读侧** = `trajectory/rebuild.ts` 的重建锚点|
8270
8288
  * **搬运** = `trajectory/carrier-log.ts` 的 `rotateCarrierLog()`。
8271
8289
  * 节名一旦漂移,写侧写的东西读侧就找不到,**且没有任何机械信号会报警**。
8272
8290
  */
@@ -8801,7 +8819,7 @@ const RECONSTRUCT_TOKEN_THRESHOLD = 1e9;
8801
8819
  *
8802
8820
  * ⚠️ **必须显式给 keys**(`snapshot(session, ['tokenUsage'])`):`tokenUsage` 的 `wire`
8803
8821
  * **没有** `summary: false`(而 `contextPressure` 有)⇒ 走"摘要集"读法拿不到它。
8804
- * 这里直接点名要它,与 `keeper.ts` 的 `readContextPressure`(不传 keys)**走法不同**,不是笔误。
8822
+ * 这里直接点名要它,与 `cognitive-trajectory-lifecycle.ts` 的 `readContextPressure`(不传 keys)**走法不同**,不是笔误。
8805
8823
  *
8806
8824
  * @returns 读不到(投影未装配 / 会话无该格)⇒ `null`,**不回报 0**
8807
8825
  */
@@ -9157,7 +9175,7 @@ function registerReconstructTurnHook(ctx) {
9157
9175
  });
9158
9176
  }
9159
9177
  //#endregion
9160
- //#region src/seams/keeper.ts
9178
+ //#region src/seams/cognitive-trajectory-lifecycle.ts
9161
9179
  const SCORES = {
9162
9180
  write: 3,
9163
9181
  edit: 3,
@@ -9244,7 +9262,7 @@ function reminderText(code) {
9244
9262
  * 让模型看见两条不同文案 ⇒ 它要判断"我该调哪个" ⇒ 把一个机械决定变成一次思考,
9245
9263
  * 既浪费注意力,又可能选错。
9246
9264
  *
9247
- * 选路由 `keeper.shouldHandover` 一侧机械完成,规则见那里的注释。
9265
+ * 选路由本文件的 `registerKeeper` 一侧机械完成(`selectHandoverPath` 只是纯函数),规则见那里的注释。
9248
9266
  *
9249
9267
  * ⚠️ 便签落点 = `LOG/LOG.md` 的 `## Handover note` 节(2026-11-16 裁定):
9250
9268
  * 它是**小步落盘的同一块地**,不另立文件;轮转时该节整节搬进新代出生头。
@@ -45,10 +45,26 @@ export declare const DEFAULT_SUPPRESSED_SOURCES: string[];
45
45
  export declare const DEFAULT_COMPACTION_TOOLS: string[];
46
46
  /**
47
47
  * 协议级「假首轮」话语序列(用户确认固化,2026-08-24 S142):任何 CCC 在抽象层都是
48
- * 宁静号/ACC——假首轮话语统一,无 CCC 配置面。两轮递进:
49
- * ① ACC 身份 + EAP 原则 + we/us 人称 + 先锚定后行动
50
- * ② 协作协议 5 条 + acknowledge 要求(只回确认,不做事)
51
- * 文本 = 原 home-serenity CCC 配置,随零配置化固化进代码。
48
+ * 宁静号/ACC——假首轮话语统一,无 CCC 配置面。
49
+ *
50
+ * 🔵 **2026-11-16 合并:两条 → 一条**(owner 令「合并吧」)。
51
+ *
52
+ * 判据(为什么合并安全 · 逐条对读过系统提示词**才**动的手):
53
+ * · 本文件这两条**只出现一次**(`hasUserMessageHistory` 守卫:有真人说话就不再插),
54
+ * 而系统提示词里的 EAP 块**每轮注入** ⇒ 两者不构成第二真相源,但确实**功能重叠**。
55
+ * · 重叠的那一块 = EAP 是什么。系统提示词的 `eapBlock()` 给的是**更详细的操作定义**
56
+ * (E↑/R↓/S↑ 各自查什么)⇒ 这里**不必复述**,压成一句指认即可。
57
+ * · ⛔ **不可省的四处,条条只在 bootstrap 有**:
58
+ * ① `personal pronoun is us/we` —— 系统提示词零处(grep 过)
59
+ * ② `We anchor first, then act` —— 同上
60
+ * ③ 协作五条 —— 系统提示词零处
61
+ * ④ 身份句 `operator agent of Serenity…ACC protocol` —— 开场语境
62
+ * · `Please simply reply "acknowledge"` 原本**两条各写一遍**(重复两次),合并后一处。
63
+ *
64
+ * 🔴 **为什么"合并"而不是"删第一条"**:删掉第一条会连同 ①②③④ 一起消失;
65
+ * 合并只是去掉 EAP 的**展开复述**与重复的 acknowledge 指令,语义面零损失。
66
+ * ⚠️ 轮数因此 2 → 1:`requiredSignals` 与 `pendingFakeTurns.remaining` 都由
67
+ * `DEFAULT_FAKE_INITIAL_MESSAGES.length` 派生,**跟着自动变**,无需另改。
52
68
  */
53
69
  export declare const DEFAULT_FAKE_INITIAL_MESSAGES: string[];
54
70
  /**
@@ -139,8 +155,10 @@ interface PromotionTracker {
139
155
  /**
140
156
  * 构建一个 epoch 感知晋升跟踪器(纯逻辑,可单测)。
141
157
  * requiredSignals:晋升所需信号数(boundary 后累计;默认 1)。
142
- * 多轮锚定(v4):两轮递进锚定时 requiredSignals = 锚定轮数——
143
- * 每条锚定回复(assistant/message)计一次,最后一条回复后晋升。
158
+ * 多轮锚定(v4):N 轮递进锚定时 requiredSignals = N——每条锚定回复
159
+ * (assistant/message)计一次,最后一条回复后晋升。
160
+ * 🔵 2026-11-16:`DEFAULT_FAKE_INITIAL_MESSAGES` 由两条合并为一条 ⇒ 缺省 N = **1**
161
+ * (仍由 `.length` 派生,不写死;本函数对 N 的语义未变)。
144
162
  *
145
163
  * maxRoundsFallback:**轮次兜底**(v1.19.3 修复 responses API 兼容)。
146
164
  * 某些模型/协议(如 opencode-go-responses)的会话可能不产生标准
@@ -1,5 +1,13 @@
1
1
  /**
2
- * keeper.ts — 拦截缝:session-keeper(DCP 提醒,post-execute observe-and-enrich)
2
+ * cognitive-trajectory-lifecycle.ts — 拦截缝:**认知轨迹生命周期**提醒(post-execute observe-and-enrich)
3
+ *
4
+ * 🔵 **2026-11-16 改名(原 `seams/keeper.ts`)**:本文件的职责在 v1.13x 后已经**只剩轨迹生命周期**——
5
+ * 计分 / 交接 / 上下文压缩 / rebuild 提醒,全部围绕"这条认知轨迹该怎么续下去"。
6
+ * `keeper` 是沿袭 opencode-serenity-plugin 的旧名(session-keeper),**名不副实** ⇒ 改成本名。
7
+ *
8
+ * 🔴 **改名边界(重要,别顺手改)**:只改**文件路径与模块 id**。
9
+ * ⛔ **不改** `cognitiveTrajectory.keeper`(配置键)与 `'keeper'`(轨迹约束子集维度)——
10
+ * 那两个是**外部契约**:用户 `trajectory-constraint.json` 里写着它们,改一名会让所有存量配置静默失效。
3
11
  *
4
12
  * 照 dsh-external/tool-failure-guard 模式:先检测计分,`next()` 委托,
5
13
  * 再把提醒折叠到返回决策的 additionalContexts(绝不 veto)。
@@ -65,7 +73,7 @@ export declare function reminderText(code: string): string;
65
73
  * 让模型看见两条不同文案 ⇒ 它要判断"我该调哪个" ⇒ 把一个机械决定变成一次思考,
66
74
  * 既浪费注意力,又可能选错。
67
75
  *
68
- * 选路由 `keeper.shouldHandover` 一侧机械完成,规则见那里的注释。
76
+ * 选路由本文件的 `registerKeeper` 一侧机械完成(`selectHandoverPath` 只是纯函数),规则见那里的注释。
69
77
  *
70
78
  * ⚠️ 便签落点 = `LOG/LOG.md` 的 `## Handover note` 节(2026-11-16 裁定):
71
79
  * 它是**小步落盘的同一块地**,不另立文件;轮转时该节整节搬进新代出生头。
@@ -2176,13 +2176,13 @@ function sessionBlock(root, scope = DEFAULT_SESSION_SCOPE) {
2176
2176
  `Active session: ${active.sessionId} — ${active.dirName} (this session is the rebuildable carrier of the cognitive trajectory)`,
2177
2177
  `SESSION.md path: ${active.mdPath} (the cognitive trajectory's persistent body — stays in place through rebuilds)`,
2178
2178
  "",
2179
- "Rules (SESSION.md is the cognitive trajectory log — keep its format & granularity fixed):",
2179
+ "Rules (SESSION.md is the cognitive trajectory BODY — judgement only; keep its format & granularity fixed):",
2180
2180
  " • Write only when a MILESTONE landed or a DECISION was made — not every round",
2181
2181
  " • One entry = one abstraction level, at the highest one that can express it:",
2182
2182
  " identity/anchors (rare) › decision (one line + rationale/rejected) › milestone",
2183
- " (one line + an evidence pointer, e.g. a commit id). Execution detail — test",
2184
- " counts, coverage decimals, per-file readings, step narration — belongs in the",
2185
- " COMMIT MESSAGE, not here",
2183
+ " (one line + an evidence pointer, e.g. a commit id). Process detail — attempts,",
2184
+ " dead ends, raw readings, step narration — belongs in LOG/LOG.md, written as it",
2185
+ " happens. Only the diff-level nitty-gritty goes in the COMMIT MESSAGE. Not here.",
2186
2186
  " • Never write a value that changes by the act of writing it (file size; the hash",
2187
2187
  " of the commit containing this edit)",
2188
2188
  " • Fixed sections, in this order: 身份与边界 / 权威锚点 / 工作纪律 / 决策 / 日志 /",
@@ -2204,7 +2204,7 @@ function sessionBlock(root, scope = DEFAULT_SESSION_SCOPE) {
2204
2204
  "task=10, read/grep/glob/msm=1, +1 per minute) and reminds you with a",
2205
2205
  "[COGNITIVE-TRAJECTORY-ASSISTANT · CHECKPOINT] message when the threshold is reached. On every such",
2206
2206
  "reminder you MUST reply with the exact ACK code:",
2207
- " [COGNITIVE-TRAJECTORY-ASSISTANT-recorded-{code}] — if you recorded progress to SESSION.md",
2207
+ " [COGNITIVE-TRAJECTORY-ASSISTANT-recorded-{code}] — if you recorded progress: SESSION.md for judgement, LOG/LOG.md for process",
2208
2208
  " [COGNITIVE-TRAJECTORY-ASSISTANT-skipped-{code}] — if nothing to record this round",
2209
2209
  "Do not ignore the reminder; do not stop ongoing work. Codes are single-use;",
2210
2210
  "never reuse a prior code.",
@@ -50,7 +50,7 @@ export declare const ACK_SKIP_PREFIX = "COGNITIVE-TRAJECTORY-ASSISTANT-skipped";
50
50
  * 轮转时**整节搬运**进新代出生头(否则旧代冻结、新代空白 ⇒ 交接断开)。
51
51
  *
52
52
  * ## 🔴 三处引用同一常量(单一真相源)
53
- * **写侧** = `seams/keeper.ts` 的 `handoverReminderText()`|**读侧** = `trajectory/rebuild.ts` 的重建锚点|
53
+ * **写侧** = `seams/cognitive-trajectory-lifecycle.ts` 的 `handoverReminderText()`|**读侧** = `trajectory/rebuild.ts` 的重建锚点|
54
54
  * **搬运** = `trajectory/carrier-log.ts` 的 `rotateCarrierLog()`。
55
55
  * 节名一旦漂移,写侧写的东西读侧就找不到,**且没有任何机械信号会报警**。
56
56
  */
@@ -12,7 +12,7 @@
12
12
  * |---|---|---|
13
13
  * | 1 | 累计输入 token > 1000m | 阈值 = **1e9**(owner 裁「我这有好几个十亿的」) |
14
14
  * | 2 | 隐藏 tool 自动出现 | **`ctx.tools.register(def, { when })`** —— 不是 restrict,见下 |
15
- * | 3 | 提示词注入 | `seams/keeper.ts` 每轮超阈值注入一句,指明会话 id 与动作 |
15
+ * | 3 | 提示词注入 | `seams/cognitive-trajectory-lifecycle.ts` 每轮超阈值注入一句,指明会话 id 与动作 |
16
16
  * | 4 | 与 rebuild 同语义、区别 = 先建新会话 → 绑轨迹 → 注入继续 → 归档旧的 | 本文件 |
17
17
  *
18
18
  * ## 🔴 「累计输入 token」到底是哪个量(**判错会让功能在最需要的会话上永不触发**)
@@ -98,7 +98,7 @@ export interface TokenTotals {
98
98
  *
99
99
  * ⚠️ **必须显式给 keys**(`snapshot(session, ['tokenUsage'])`):`tokenUsage` 的 `wire`
100
100
  * **没有** `summary: false`(而 `contextPressure` 有)⇒ 走"摘要集"读法拿不到它。
101
- * 这里直接点名要它,与 `keeper.ts` 的 `readContextPressure`(不传 keys)**走法不同**,不是笔误。
101
+ * 这里直接点名要它,与 `cognitive-trajectory-lifecycle.ts` 的 `readContextPressure`(不传 keys)**走法不同**,不是笔误。
102
102
  *
103
103
  * @returns 读不到(投影未装配 / 会话无该格)⇒ `null`,**不回报 0**
104
104
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shgroup/dsh-serenity-hooks",
3
- "version": "1.137.0",
3
+ "version": "1.137.1",
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": {