@shgroup/dsh-serenity-hooks 1.64.0 → 1.65.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.
Files changed (38) hide show
  1. package/README.md +14 -14
  2. package/dsh.plugin.json +3 -3
  3. package/lib/{ccc-B0ZGL9lx.js → ccc-C33QWoWZ.js} +3 -3
  4. package/lib/{ccc-roots-GIJ3A_tw.js → ccc-roots-RMzGU-CJ.js} +2 -2
  5. package/lib/ccc.d.ts +15 -50
  6. package/lib/{trajectory-assistant.d.ts → cognitive-trajectory-assistant.d.ts} +9 -9
  7. package/lib/{trajectory-bound.d.ts → cognitive-trajectory-bound.d.ts} +10 -10
  8. package/lib/{trajectory-ops.d.ts → cognitive-trajectory-ops.d.ts} +6 -6
  9. package/lib/{trajectory-skills.d.ts → cognitive-trajectory-skills.d.ts} +8 -8
  10. package/lib/cro-log.d.ts +2 -2
  11. package/lib/cro.d.ts +1 -1
  12. package/lib/index.d.ts +1 -1
  13. package/lib/index.js +214 -213
  14. package/lib/invariant.d.ts +1 -1
  15. package/lib/invariant.js +1 -1
  16. package/lib/json.d.ts +1 -1
  17. package/lib/{localstore-ops-DMs_ovHo.js → localstore-ops-ylQoPz1Q.js} +1 -1
  18. package/lib/{message-source-B4P3Uw6D.js → message-source--2veY0JU.js} +17 -17
  19. package/lib/output-guard-seam.d.ts +1 -1
  20. package/lib/output-guard.d.ts +1 -1
  21. package/lib/rebuild.d.ts +2 -2
  22. package/lib/seams/keeper.d.ts +6 -6
  23. package/lib/seams/system-prompt.d.ts +1 -1
  24. package/lib/{settings-section-DN7g8K7Q.js → settings-section-B1YzjFz6.js} +1 -1
  25. package/lib/skiff-core.d.ts +10 -10
  26. package/lib/skiff-debug.d.ts +1 -1
  27. package/lib/{skiff-role-B615L9MV.js → skiff-role-Boc4SKct.js} +14 -14
  28. package/lib/skiff-role.d.ts +4 -4
  29. package/lib/skills/resource-index.d.ts +1 -1
  30. package/lib/skills-discovery.d.ts +1 -1
  31. package/lib/tools/{trajectory.d.ts → cognitive-trajectory.d.ts} +7 -7
  32. package/lib/tools/skiff-admin.d.ts +1 -1
  33. package/lib/usage-stats.d.ts +1 -1
  34. package/lib/wake-registry.d.ts +5 -5
  35. package/lib/wake-scheduler.d.ts +5 -5
  36. package/lib/weixin-bridge.d.ts +1 -1
  37. package/lib/{weixin-route-Aheyq3fN.js → weixin-route-BoSC-uPp.js} +2 -2
  38. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { c as hostInjected, d as hostSessions, f as hostSettings, h as hostWebServer, i as cccRootForExec, l as hostLlm, m as hostWeb, n as agentCwdFor, o as listCccs, p as hostSubagents, r as cccRootForCwd, s as hostAgents, t as NO_CCC_FROM_AGENT_CWD, u as hostService } from "./ccc-roots-GIJ3A_tw.js";
3
- import { _ as resolveInside, a as findSerenityRoot$1, c as matchBlacklist, d as readCccName$1, f as readCheapWorkerConfig, h as readTrajectorySkills, i as findGitRoot, l as pathInside, m as readSafeModeHiddenTools, n as SAFE_MODE_MARKER, o as isSafeModeOn, p as readExclusiveTools, r as classifyPath, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS, u as readBlacklist } from "./ccc-B0ZGL9lx.js";
4
- import { A as localIdStamp, C as setActiveSessionInfo, D as isoLocal, E as useSession, O as localFileStamp, S as sessionsRoot, T as summarize, _ as namingTitleFor, a as pruneMissingBindings, b as resolveSessionByTitle, c as setBindingStore, d as clearActiveSessionInfo, f as createSession, g as listSessions, h as getActiveSessionInfo, i as listBoundSessionIds, k as localHuman, l as DEFAULT_SESSION_SCOPE, m as findSession, n as PLUGIN_SOURCE, o as readLastBound, p as extractSessionMdPathFromText, r as appendBound, s as resolveSessionTrajectoryLabel, u as TRAJECTORY_ACTIONS, v as parseSessionContextFromEvents, w as showSession, x as sessionEvents$1, y as readActiveSessionMd } from "./message-source-B4P3Uw6D.js";
5
- import { a as readGitTrack, c as unsetEntry, i as localstorePath, l as writeEntry, n as checkLocalstoreGitCompliance, o as readStore, r as getEntry, s as runLocalStore, t as LOCALSTORE_SCOPES } from "./localstore-ops-DMs_ovHo.js";
6
- import { a as FACE_PORTS, c as MECHANISM_PORTS, d as registerSkiffSession$1, f as skiffRoleFor$1, h as ACC_VERSION, i as ACP_PORT, l as SKIFF_DEBUG_PORT, m as unregisterSkiffSession$1, n as readSimpleSettings, o as GATEWAY_PORT, p as skiffSessionInfo$1, r as registerSettingsSection, s as MAIN_WEB_PORT, u as WEIXIN_SEND_PORT } from "./settings-section-DN7g8K7Q.js";
7
- import { a as readSkiffRoles, c as roleMsmWhitelist, d as systemPromptSource, f as trajectorySubset, i as isSkiffSessionId, l as roleToolWhitelist, n as buildSkiffBasePrompt, o as resolveRoleSystemPrompt, r as createRolePromptReader, s as resolveSkiffKind } from "./skiff-role-B615L9MV.js";
2
+ import { c as hostInjected, d as hostSessions, f as hostSettings, h as hostWebServer, i as cccRootForExec, l as hostLlm, m as hostWeb, n as agentCwdFor, o as listCccs, p as hostSubagents, r as cccRootForCwd, s as hostAgents, t as NO_CCC_FROM_AGENT_CWD, u as hostService } from "./ccc-roots-RMzGU-CJ.js";
3
+ import { _ as resolveInside, a as findSerenityRoot$1, c as matchBlacklist, d as readCccName$1, f as readCheapWorkerConfig, h as readSafeModeHiddenTools, i as findGitRoot, l as pathInside, m as readExclusiveTools, n as SAFE_MODE_MARKER, o as isSafeModeOn, p as readCognitiveTrajectorySkills, r as classifyPath, s as loadSerenityConfig, t as DEFAULT_SERENITY_CONFIG_PATHS, u as readBlacklist } from "./ccc-C33QWoWZ.js";
4
+ import { A as localIdStamp, C as setActiveSessionInfo, D as isoLocal, E as useSession, O as localFileStamp, S as sessionsRoot, T as summarize, _ as namingTitleFor, a as pruneMissingBindings, b as resolveSessionByTitle, c as setBindingStore, d as clearActiveSessionInfo, f as createSession, g as listSessions, h as getActiveSessionInfo, i as listBoundSessionIds, k as localHuman, l as COGNITIVE_TRAJECTORY_ACTIONS, m as findSession, n as PLUGIN_SOURCE, o as readLastBound, p as extractSessionMdPathFromText, r as appendBound, s as resolveSessionCognitiveTrajectoryLabel, u as DEFAULT_SESSION_SCOPE, v as parseSessionContextFromEvents, w as showSession, x as sessionEvents$1, y as readActiveSessionMd } from "./message-source--2veY0JU.js";
5
+ import { a as readGitTrack, c as unsetEntry, i as localstorePath, l as writeEntry, n as checkLocalstoreGitCompliance, o as readStore, r as getEntry, s as runLocalStore, t as LOCALSTORE_SCOPES } from "./localstore-ops-ylQoPz1Q.js";
6
+ import { a as FACE_PORTS, c as MECHANISM_PORTS, d as registerSkiffSession$1, f as skiffRoleFor$1, h as ACC_VERSION, i as ACP_PORT, l as SKIFF_DEBUG_PORT, m as unregisterSkiffSession$1, n as readSimpleSettings, o as GATEWAY_PORT, p as skiffSessionInfo$1, r as registerSettingsSection, s as MAIN_WEB_PORT, u as WEIXIN_SEND_PORT } from "./settings-section-B1YzjFz6.js";
7
+ import { a as isSkiffSessionId, c as resolveSkiffKind, f as systemPromptSource, i as createRolePromptReader, l as roleMsmWhitelist, n as buildSkiffBasePrompt, o as readSkiffRoles, r as cognitiveTrajectorySubset, s as resolveRoleSystemPrompt, u as roleToolWhitelist } from "./skiff-role-Boc4SKct.js";
8
8
  import { REGISTERED_TOOLS } from "./invariant.js";
9
- import { a as readWeixinCredential, c as weixinInboundDir, i as matchWeixinRoute, l as weixinSessionIdFor, n as extractWeixinText, o as readWeixinSettings, r as hasVoiceItem, s as sanitizeFileName$1, t as extractWeixinMedia } from "./weixin-route-Aheyq3fN.js";
9
+ import { a as readWeixinCredential, c as weixinInboundDir, i as matchWeixinRoute, l as weixinSessionIdFor, n as extractWeixinText, o as readWeixinSettings, r as hasVoiceItem, s as sanitizeFileName$1, t as extractWeixinMedia } from "./weixin-route-BoSC-uPp.js";
10
10
  import { a as markdownToPlainText, c as sendTyping, i as getUpdates, l as sniffImageExt, n as downloadMedia, o as sendFileMessage, r as getConfig, s as sendTextMessage, t as TypingStatus } from "./weixin-api-BrRcPiQs.js";
11
11
  import { createRequire } from "node:module";
12
12
  import z from "@deepseek-ai/schemastery";
@@ -1073,7 +1073,7 @@ const NPX_BIN = process.platform === "win32" ? "npx.cmd" : "npx";
1073
1073
  const ACC_CATALOG = `═══ ACC Usage Catalog ═══
1074
1074
  Directory of ACC capabilities — each area lists where to go for details (guides live with their feature; this catalog only points).
1075
1075
 
1076
- ① 轨迹本体 → container_trajectory(list/show/create/use + rebuild 超限重建 + send-now 即时投递 + send-later 未来一次性唤醒
1076
+ ① 轨迹本体 → cognitive_trajectory(list/show/create/use + rebuild 超限重建 + send-now 即时投递 + send-later 未来一次性唤醒
1077
1077
  + cro-guide CRO 编写指南)
1078
1078
  原 logbook 已并入(v1.33 用户裁决:废除 logbook 词);close/archive 删(归档走 container_fs mv),
1079
1079
  health/qa/summary 分别并入 use / list,hook-develop-guide 并进 container_admin msm guide
@@ -1087,15 +1087,15 @@ Directory of ACC capabilities — each area lists where to go for details (guide
1087
1087
  ④ 角色与对外面 → container_admin role(Skiff 认知子集角色:guide/validate/apply/list——skiff_admin 已并入)
1088
1088
  3099 Skiff 调试问答页(人工调试面)。🔴 2026-10-15:自造 ACP 面已退役
1089
1089
  ⇒ 外部程序化接入改走官方 dsh --profile acp + 现成 ACP 客户端
1090
- ⑤ 自主与接入 → container_trajectory send-now(跨轨迹的**即时**递送,**不排队**:live 目标在跑就当场注入当前轮、空闲则立即起轮;非 live 冷载入——等效于直接 wake;**有同步回执**)
1091
- container_trajectory send-later(跨轨迹的"未来时刻 + 一条 message";fire-and-forget,无回执无回收)
1090
+ ⑤ 自主与接入 → cognitive_trajectory send-now(跨轨迹的**即时**递送,**不排队**:live 目标在跑就当场注入当前轮、空闲则立即起轮;非 live 冷载入——等效于直接 wake;**有同步回执**)
1091
+ cognitive_trajectory send-later(跨轨迹的"未来时刻 + 一条 message";fire-and-forget,无回执无回收)
1092
1092
  weixin 微信桥(配置/扫码/路由/消息 hook——CCC 侧 weixin-doctor MSM:msm("weixin-doctor", ["guide"]))
1093
- ⑥ CCC 配置总览 → container_admin msm ccc-config(9 段:cheap-worker/sessionKeeper/localstore/hooks/safeMode/skiff/trajectory/weixin/**exclusiveTools**)
1093
+ ⑥ CCC 配置总览 → container_admin msm ccc-config(9 段:cheap-worker/sessionKeeper/localstore/hooks/safeMode/skiff/cognitiveTrajectory/weixin/**exclusiveTools**)
1094
1094
  ⑦ 注册表与安全 → mech-registry.json 由 container_admin msm register/deregister 管理(写保护——不可直接编辑)
1095
1095
  dashboard health 输出 registry 完整性检查;损坏恢复指引见 health registry.issues
1096
1096
  CCC 级开关:exclusiveTools(声明专属工具)/ safeMode.blacklist(写路径黑名单)
1097
1097
  / safeMode.hiddenTools(**安全模式开启期间**额外隐藏的工具,v1.51.4)
1098
- CCC 级 skill 供给:trajectory.skills(v1.44.0——**本 CCC 每条轨迹都带**,含 skiff 会话;与轨迹自己的 frontmatter 声明取并集)
1098
+ CCC 级 skill 供给:cognitiveTrajectory.skills(v1.44.0——**本 CCC 每条轨迹都带**,含 skiff 会话;与轨迹自己的 frontmatter 声明取并集)
1099
1099
 
1100
1100
  每区:一句话定位 + 详细入口(工具名 / guide 子命令)。详情永远以对应工具的 guide/ccc-config 为单一真相源。
1101
1101
  `;
@@ -1181,7 +1181,7 @@ cheap-worker(杂工)工具可用模型白名单(provider/model 列表)
1181
1181
  { "cheap-worker": { "models": ["minimax-cn-coding-plan/MiniMax-M3"], "defaultModel": "minimax-cn-coding-plan/MiniMax-M3" } }
1182
1182
 
1183
1183
  ── 2. sessionKeeper.threshold / sessionKeeper.sessionMdMaxKB ──
1184
- trajectory-assistant(TRAJECTORY-ASSISTANT · CHECKPOINT)提醒机制的积分阈值(非 headless 主 agent)。
1184
+ cognitive-trajectory-assistant(COGNITIVE-TRAJECTORY-ASSISTANT · CHECKPOINT)提醒机制的积分阈值(非 headless 主 agent)。
1185
1185
  按工具调用加权 + 耗时计分;达到阈值注入提醒,要求模型回复 ACK 码。
1186
1186
 
1187
1187
  Config:
@@ -1191,7 +1191,7 @@ trajectory-assistant(TRAJECTORY-ASSISTANT · CHECKPOINT)提醒机制的积
1191
1191
  默认:150
1192
1192
 
1193
1193
  ▸ sessionMdMaxKB(v1.31.1 新增,v1.31.2 缺省 100→200):**活跃 SESSION.md 体积上限(KB,缺省 200;0 = 关闭)**。
1194
- 超过 → 注入 [TRAJECTORY-ASSISTANT · LOGBOOK COMPACTION] 提醒:暂停当前工作 →
1194
+ 超过 → 注入 [COGNITIVE-TRAJECTORY-ASSISTANT · LOGBOOK COMPACTION] 提醒:暂停当前工作 →
1195
1195
  加载 eap(praxis eap)→ 按 EAP 分层骨架重写 SESSION.md。四条原则(ACC 内嵌,随提醒给出):
1196
1196
  ① 保留 EAP 分层骨架(不压成时间流水账)② 内容可外移到 references 文件
1197
1197
  (AGENT_SESSIONS/<会话>/references/*.md,SESSION.md 留链接)③ 允许整合/删除不重要事项
@@ -1229,9 +1229,9 @@ safe-mode 由 WebUI 开关控制(写 .serenity-safe-on 标记);黑名单
1229
1229
  { "safeMode": { "blacklist": [".secrets/"], "hiddenTools": ["workflow", "job_kill"] } }
1230
1230
 
1231
1231
  ── 6. skiff.roles(F4 认知子集角色)──
1232
- Skiff 角色 = 全知全能 trajectory 的任意子集(CCC 定义)。每角色独立模型 + 双白名单
1232
+ Skiff 角色 = 全知全能 cognitive trajectory 的任意子集(CCC 定义)。每角色独立模型 + 双白名单
1233
1233
  (MSM 白名单 msms[] 与非 MSM 工具白名单 tools[],白名单外全隐藏;skill 加载恒可用)。
1234
- trajectory 纪律子集(session/keeper/rebuild 参与项)默认全关 = 完全独立。
1234
+ cognitive trajectory 纪律子集(session/keeper/rebuild 参与项)默认全关 = 完全独立。
1235
1235
  systemPrompt 内联 或 systemPromptFile(.md 引用,推荐)——角色会话的完整人格/边界提示词。
1236
1236
  validate 校验 / apply 生效 / list 查看:container_admin role <guide|validate|apply|list>(skiff_admin 已并入)。
1237
1237
 
@@ -1244,31 +1244,31 @@ validate 校验 / apply 生效 / list 查看:container_admin role <guide|valid
1244
1244
  "systemPromptFile": ".opencode/skiff/qa.md"
1245
1245
  } } } }
1246
1246
 
1247
- ── 7. container_trajectory(轨迹 + 唤醒注册表,D58)──
1248
- CCC 的一条 trajectory = 持久身体(SESSION.md)+ 时间轴(AGENT_SESSIONS/ 目录 + 唤醒注册表)。
1247
+ ── 7. cognitive_trajectory(轨迹 + 唤醒注册表,D58)──
1248
+ CCC 的一条 cognitive trajectory = 持久身体(SESSION.md)+ 时间轴(AGENT_SESSIONS/ 目录 + 唤醒注册表)。
1249
1249
  一个 CCC 内可多条并行;条目全部由人类/agent 显式登记。
1250
1250
  ⚠️ ACC 不再提供**周期自唤醒**(原 autopilot,2026-09-15 整段退场:机制/时钟/container_admin autopilot
1251
1251
  域/面板区块一并删除)。自主巡航改由 CCC 自己驱动(home-serenity 侧 msm autopilot-round 每轮自排下一轮,
1252
- 真相源 = S151 SESSION.md §1/§1b/§1c)。**本轮的 trajectory.autopilot 配置段保留**(见下表)——
1252
+ 真相源 = S151 SESSION.md §1/§1b/§1c)。**本轮的 cognitiveTrajectory.autopilot 配置段保留**(见下表)——
1253
1253
  它现由 **CCC 侧脚本**读取,ACC 不再消费该段。
1254
- 唤醒注册表(container_trajectory send-later):唤醒 = 未来时刻 + 一条 message,可唤醒自己或别的 trajectory;
1254
+ 唤醒注册表(cognitive_trajectory send-later):唤醒 = 未来时刻 + 一条 message,可唤醒自己或别的 cognitive trajectory;
1255
1255
  落点 AGENT_SESSIONS/wake-registry.json,中心调度器到点投递(fire-and-forget;无回执、无回收)。
1256
1256
  运行态诊断(ACC 负责人专用):acc-diag(① live 运行态 / ①b 唤醒时钟 / ③ 唤醒注册表)。
1257
1257
 
1258
- ▸ trajectory.skills(v1.44.0,**CCC 级 skill 供给**;owner 令 2026-09-20「要求实现我的诉求……
1258
+ ▸ cognitiveTrajectory.skills(v1.44.0,**CCC 级 skill 供给**;owner 令 2026-09-20「要求实现我的诉求……
1259
1259
  注入是动态注入就行;create 先不触发吧;**skiff 也支持**」):
1260
1260
  **本 CCC 的每条轨迹都带这些 skill**——声明的 skill 全文在该轨迹**被绑定期间**注入系统提示词
1261
1261
  (**动态注入**:每请求重新求值、不缓存 ⇒ 改配置或改 frontmatter **即时生效**,无需重新 use、无需重启)。
1262
- 两条声明来源**并集**(不是二选一):本键 **trajectory.skills**(容器给的底座,**在前**)
1262
+ 两条声明来源**并集**(不是二选一):本键 **cognitiveTrajectory.skills**(容器给的底座,**在前**)
1263
1263
  + 轨迹自己 SESSION.md 顶部 frontmatter 的 skills:(这条轨迹额外的,**追加**;同名去重)。
1264
1264
  ✅ **含 skiff 角色会话**(旁路的是 ACC 身份与纪律;skill 是"工作资料",照给)。
1265
1265
  守卫:名字先过安全校验才用于拼路径(防穿越)|**合并后**统一 32 KB 上限截断|找不到响亮写 [缺失]。
1266
- ⚠️ 与 create **无关**(create 刻意不夺绑定,U6)⇒ 注入的门是"**存在绑定**"(container_trajectory use)。
1266
+ ⚠️ 与 create **无关**(create 刻意不夺绑定,U6)⇒ 注入的门是"**存在绑定**"(cognitive_trajectory use)。
1267
1267
  失败语义:未配置 / 字段缺失 / 配置损坏 ⇒ **空数组**(= 无 CCC 级供给;轨迹级声明照旧生效)。
1268
1268
  归属(D23):**机制在 ACC**(读取 + 合并 + 注入 + 守卫),**声明在 CCC**(本键)。
1269
1269
 
1270
1270
  Config:
1271
- { "trajectory": {
1271
+ { "cognitiveTrajectory": {
1272
1272
  "skills": ["acc-session", "cce"], // v1.44.0:本 CCC 的每条轨迹都带(含 skiff 会话)
1273
1273
  "autopilot": { // 原 autopilotTrajectory 段,字段不变(旧键仍回退读)
1274
1274
  "enabled": true,
@@ -2036,7 +2036,7 @@ function scanSerenityDirs(skillsRoot) {
2036
2036
  /**
2037
2037
  * 防穿越:skill 名必须是简单目录名(拒绝分隔符与 `..`/`.` 路径段)。
2038
2038
  * v1.34.1:导出——轨迹 skill 声明(CCC 数据)的名字也要**先过这一关**才能用于拼路径
2039
- * (规格 `docs/trajectory-skill-injection.md` §3「名字安全(必做)」)。
2039
+ * (规格 `docs/cognitive-trajectory-skill-injection.md` §3「名字安全(必做)」)。
2040
2040
  */
2041
2041
  function isSafeSkillName(name) {
2042
2042
  if (name.length === 0) return false;
@@ -2129,7 +2129,7 @@ function truncateContent(content, maxChars) {
2129
2129
  *
2130
2130
  * 🔴 **两个面,两个入口**(2026-10-12 增;owner 裁决 O2)—— 同源、但成本形态不同:
2131
2131
  * · **载入面** `buildResourceIndex()` —— 完整索引(名字 + 首标题 + 字节),带 `.md` 文件头读取;
2132
- * 在三条路径上各附一次:入口段(`system-prompt.ts` order −50)/轨迹段(`trajectory-skills.ts`
2132
+ * 在三条路径上各附一次:入口段(`system-prompt.ts` order −50)/轨迹段(`cognitive-trajectory-skills.ts`
2133
2133
  * order −45)/目录 provider 的 `get()`(`opencode-skills.ts`)。
2134
2134
  * · **目录面** `buildResourceNameSuffix()` —— **只有名字**,**不读任何正文**;只挂一处:
2135
2135
  * 目录 provider 的 `list()`(`available_skills` 的 `SkillSummary.description`)。
@@ -2390,24 +2390,24 @@ function buildResourceNameSuffix(skillDir, options = {}) {
2390
2390
  return `(参考件:${names.join(" / ")}${tail})`;
2391
2391
  }
2392
2392
  //#endregion
2393
- //#region src/trajectory-skills.ts
2393
+ //#region src/cognitive-trajectory-skills.ts
2394
2394
  /**
2395
- * trajectory-skills.ts — 轨迹 skill 声明解析 + 注入内容装配(纯逻辑,零 DSH 依赖)
2395
+ * cognitive-trajectory-skills.ts — 轨迹 skill 声明解析 + 注入内容装配(纯逻辑,零 DSH 依赖)
2396
2396
  *
2397
- * 接口真相源:`docs/trajectory-skill-injection.md` v1.0(§2 数据契约 / §3 注入契约)。
2397
+ * 接口真相源:`docs/cognitive-trajectory-skill-injection.md` v1.0(§2 数据契约 / §3 注入契约)。
2398
2398
  * 一句话:**轨迹自己声明它要挂哪些 skill**(`SESSION.md` 顶部 YAML frontmatter 的 `skills:`),
2399
2399
  * ACC 在**绑定期间**把这些 skill 的 `SKILL.md` 全文注入系统提示词。
2400
2400
  *
2401
2401
  * 分工(R↓:为什么解析与注册分开):
2402
2402
  * · 本模块 = **纯文本层**(解析 / 装配 / 安全判定)——可脱离 DSH 单测;
2403
- * · `seams/system-prompt.ts` 的 `registerTrajectorySkillSection` = **宿主接入层**
2403
+ * · `seams/system-prompt.ts` 的 `registerCognitiveTrajectorySkillSection` = **宿主接入层**
2404
2404
  * (per-agent `ctx.systemPrompt.section`),只做门与注册,不再解析文本。
2405
2405
  *
2406
2406
  * 边界(规格 §2.2):**不解析** `skills` 以外任何键的语义(CCC 可自由使用,ACC 视而不见);
2407
2407
  * **不改写** frontmatter(ACC 只读)。
2408
2408
  */
2409
2409
  /** 全文注入总长上限(字符数;规格 §3「缺省 32 KB」——防上下文爆炸) */
2410
- const TRAJECTORY_SKILLS_MAX_CHARS = 32768;
2410
+ const COGNITIVE_TRAJECTORY_SKILLS_MAX_CHARS = 32768;
2411
2411
  /** 缺失标记(规格 §3/§6-3 的验收锚点:任何"拿不到全文"的情况都必须带它,绝不静默)
2412
2412
  * 🔴 2026-09-25(S142 分批清死代码·第 1 批):**降为模块内常量**——全仓唯一消费者在本文件,
2413
2413
  * 导出只服务测试(测试用的是字面量 `'[缺失]'`)⇒ 导出面无意义。 */
@@ -2496,7 +2496,7 @@ function absoluteMdPath(root, mdPath) {
2496
2496
  * (规格 §6-6 要求"不静默";不注册就等于静默)
2497
2497
  * 其余(文件在但无 frontmatter / 无 `skills` 键 / 值为空)⇒ false,不注册、不产生噪声。
2498
2498
  */
2499
- function hasTrajectorySkillsDeclaration(root, mdPath) {
2499
+ function hasCognitiveTrajectorySkillsDeclaration(root, mdPath) {
2500
2500
  const abs = absoluteMdPath(root, mdPath);
2501
2501
  if (!existsSync(abs)) return true;
2502
2502
  try {
@@ -2521,7 +2521,7 @@ function normalizeNames(names) {
2521
2521
  * 合并两条声明来源(v1.44.0):**CCC 级在前,轨迹级追加**,同名去重取首次位置。
2522
2522
  *
2523
2523
  * 两条来源(owner 令 2026-09-20):
2524
- * · **CCC 级** = `.opencode/serenity.json` 的 `trajectory.skills`(本 CCC 所有轨迹共有的底座);
2524
+ * · **CCC 级** = `.opencode/serenity.json` 的 `cognitiveTrajectory.skills`(本 CCC 所有轨迹共有的底座);
2525
2525
  * · **轨迹级** = 该轨迹 `SESSION.md` frontmatter 的 `skills:`(这条轨迹额外的)。
2526
2526
  *
2527
2527
  * 为什么是**并集**而不是二选一(R↓):C1 设计当初否决"纯 CCC 全局"的理由是"会**丢掉
@@ -2545,14 +2545,14 @@ function mergeSkillNames(cccSkills, trajSkills) {
2545
2545
  * @param root CCC 根
2546
2546
  * @param mdPath 轨迹的 SESSION.md 路径(**来自绑定的 `mdPath`**,不用 label 拼)
2547
2547
  * @param maxChars 总长上限(字符)
2548
- * @param cccSkills CCC 级声明(`readTrajectorySkills`;缺省空 = 只有轨迹级,行为与 v1.43 一致)
2548
+ * @param cccSkills CCC 级声明(`readCognitiveTrajectorySkills`;缺省空 = 只有轨迹级,行为与 v1.43 一致)
2549
2549
  * @param onInjectedNames 观测回调(本次请求实际带上的 skill 名;**纯观测**,供用量统计用——
2550
2550
  * 回调抛错被吞,**不影响注入正文**)
2551
2551
  * @returns 注入正文;两条来源皆无声明 → `''`(空串 = 宿主不产出该 section 块);
2552
2552
  * SESSION.md 缺失/读失败 → 响亮提示(若同时有 CCC 级声明,则提示在前、正文随后——
2553
2553
  * **提示不因"别处有内容"而被吞掉**)
2554
2554
  */
2555
- function buildTrajectorySkillsSection(root, mdPath, maxChars = TRAJECTORY_SKILLS_MAX_CHARS, cccSkills = [], onInjectedNames) {
2555
+ function buildCognitiveTrajectorySkillsSection(root, mdPath, maxChars = COGNITIVE_TRAJECTORY_SKILLS_MAX_CHARS, cccSkills = [], onInjectedNames) {
2556
2556
  const abs = absoluteMdPath(root, mdPath);
2557
2557
  let trajNames = [];
2558
2558
  let notice = "";
@@ -2631,7 +2631,7 @@ function buildTrajectorySkillsSection(root, mdPath, maxChars = TRAJECTORY_SKILLS
2631
2631
  * | 字段 | 含义 | 喂它的地方 |
2632
2632
  * |---|---|---|
2633
2633
  * | `skill.loads` | 模型**主动**调宿主 `skill` 工具(把某 skill 的 `SKILL.md` 全文载入) | `tools/post-execute`(工具名 = `skill`) |
2634
- * | `skill.injections` | ACC **每请求注入**的 skill 段(`trajectory.skills` / 轨迹 frontmatter 声明) | `seams/system-prompt.ts` 的 trajectory-skills section 求值回调 |
2634
+ * | `skill.injections` | ACC **每请求注入**的 skill 段(`cognitiveTrajectory.skills` / 轨迹 frontmatter 声明) | `seams/system-prompt.ts` 的 cognitive-trajectory-skills section 求值回调 |
2635
2635
  * | `msm` | `msm` 工具的一次执行,按 **MSM 名**分桶 | `tools/post-execute`(工具名 = `msm`) |
2636
2636
  *
2637
2637
  * 🔴 **两者差好几个数量级**:`loads` 是模型的**动作**(稀疏),`injections` 是**请求的属性**(稠密)。
@@ -3220,7 +3220,7 @@ function toolsBlock() {
3220
3220
  "The ACC (this plugin) provides the following built-in tools:",
3221
3221
  "",
3222
3222
  " container_fs — container filesystem operations (15 subcommands: root/resolve/exists/list/tree/relative/mkdir/rm/mv/cp/touch/append/reveal/info/find)",
3223
- " container_trajectory — one trajectory: its persistent body (SESSION.md) + its timeline. Lifecycle: list (inventory + stats) / show / create / use (activate; inline integrity check — silent when fine) / rebuild (clear-and-rebuild this conversation in place, Ship of Theseus); delivery: send-now (deliver one message RIGHT NOW; live target injected immediately, non-live cold-resumed like a direct wake — returns a synchronous receipt) / send-later (one future instant + one message to any trajectory; fire-and-forget — no receipt, no recall) / cro-guide (the CRO programming guide: how to give THIS trajectory its own program that decides when it should be woken)",
3223
+ " cognitive_trajectory — one cognitive trajectory: its persistent body (SESSION.md) + its timeline. Lifecycle: list (inventory + stats) / show / create / use (activate; inline integrity check — silent when fine) / rebuild (clear-and-rebuild this conversation in place, Ship of Theseus); delivery: send-now (deliver one message RIGHT NOW; live target injected immediately, non-live cold-resumed like a direct wake — returns a synchronous receipt) / send-later (one future instant + one message to any cognitive trajectory; fire-and-forget — no receipt, no recall) / cro-guide (the CRO programming guide: how to give THIS cognitive trajectory its own program that decides when it should be woken)",
3224
3224
  " dashboard — always-on container instruments: health (CCC three-principle check + registry integrity) / time (now) / wait (N seconds)",
3225
3225
  " container_git— git operations (status/commit/push/log/pull/diff)",
3226
3226
  " msm — execute a registered CCC MSM: msm(name, args); partial name returns candidates; inspect=true shows usage",
@@ -3256,7 +3256,7 @@ function cceBlock() {
3256
3256
  "",
3257
3257
  "1. Continuity — every interaction modifies the container's future state. Before",
3258
3258
  " acting, consult what came before — prior decisions, abstractions, constraints.",
3259
- " You are part of a trajectory, not a fresh start.",
3259
+ " You are part of a cognitive trajectory, not a fresh start.",
3260
3260
  "",
3261
3261
  "2. Bounded Space — the container has boundaries. Respect them. Do not assume",
3262
3262
  " knowledge that has not been accumulated within this container.",
@@ -3307,10 +3307,10 @@ function principlesBlock(root, omitMsmPrinciples = false) {
3307
3307
  "fault to be hidden. Never disguise or excuse what you do not know;",
3308
3308
  "not-knowing is a state to be repaired, and reporting it is the first repair.",
3309
3309
  "",
3310
- "The session-trajectory relation: a session is the rebuildable carrier of a",
3311
- "trajectory. SESSION.md is the trajectory's persistent body — it never moves;",
3310
+ "The session–cognitive-trajectory relation: a session is the rebuildable carrier of a",
3311
+ "cognitive trajectory. SESSION.md is the cognitive trajectory's persistent body — it never moves;",
3312
3312
  "the current conversation is a temporary work copy that may be discarded and",
3313
- "rebuilt (container_trajectory rebuild). Identity belongs to the trajectory, not to any",
3313
+ "rebuilt (cognitive_trajectory rebuild). Identity belongs to the cognitive trajectory, not to any",
3314
3314
  "session.",
3315
3315
  ""
3316
3316
  ];
@@ -3409,15 +3409,16 @@ function metaphorBlock() {
3409
3409
  " ballast (constraints) before setting course. Verdict: skipping the",
3410
3410
  " inspection and launching directly = flying uninspected.",
3411
3411
  "",
3412
- "7. The Ship's Log → Trajectory Tracking. SESSION.md is the trajectory's log —",
3412
+ "7. The Ship's Log → Cognitive Trajectory Tracking. SESSION.md is the",
3413
+ " cognitive trajectory's log —",
3413
3414
  " the persistent body of the voyage; sessions are rebuildable carriers of",
3414
- " the trajectory. Discard the carrier, keep the log. Unrecorded =",
3415
+ " the cognitive trajectory. Discard the carrier, keep the log. Unrecorded =",
3415
3416
  " unvoyaged. Verdict: finishing multi-step work without a progress record",
3416
3417
  " = a missing page.",
3417
3418
  "",
3418
3419
  "8. The Ship of Theseus → Continuity. Planks may be replaced; the ship",
3419
3420
  " remains the same. The container can be rebuilt; identity persists.",
3420
- " You are part of a trajectory, not a new ship. Verdict: acting",
3421
+ " You are part of a cognitive trajectory, not a new ship. Verdict: acting",
3421
3422
  " without consulting precedent = a different ship.",
3422
3423
  "",
3423
3424
  "THE CREW — multi-agent collaboration",
@@ -3532,10 +3533,10 @@ function sessionBlock(root, scope = DEFAULT_SESSION_SCOPE) {
3532
3533
  return [
3533
3534
  "",
3534
3535
  "=== Serenity Session ===",
3535
- `Active session: ${active.sessionId} — ${active.dirName} (this session is the rebuildable carrier of the trajectory)`,
3536
- `SESSION.md path: ${active.mdPath} (the trajectory's persistent body — stays in place through rebuilds)`,
3536
+ `Active session: ${active.sessionId} — ${active.dirName} (this session is the rebuildable carrier of the cognitive trajectory)`,
3537
+ `SESSION.md path: ${active.mdPath} (the cognitive trajectory's persistent body — stays in place through rebuilds)`,
3537
3538
  "",
3538
- "Rules (SESSION.md is the trajectory log — keep its format & granularity fixed):",
3539
+ "Rules (SESSION.md is the cognitive trajectory log — keep its format & granularity fixed):",
3539
3540
  " • Write only when a MILESTONE landed or a DECISION was made — not every round",
3540
3541
  " • One entry = one abstraction level, at the highest one that can express it:",
3541
3542
  " identity/anchors (rare) › decision (one line + rationale/rejected) › milestone",
@@ -3559,12 +3560,12 @@ function sessionBlock(root, scope = DEFAULT_SESSION_SCOPE) {
3559
3560
  "This preserves the session context across todo updates.",
3560
3561
  "Do NOT remove or reorder this item — keep it at position 0.",
3561
3562
  "",
3562
- "TRAJECTORY-ASSISTANT: a background tracker scores your tool use (write/edit=3,",
3563
+ "COGNITIVE-TRAJECTORY-ASSISTANT: a background tracker scores your tool use (write/edit=3,",
3563
3564
  "task=10, read/grep/glob/msm=1, +1 per minute) and reminds you with a",
3564
- "[TRAJECTORY-ASSISTANT · CHECKPOINT] message when the threshold is reached. On every such",
3565
+ "[COGNITIVE-TRAJECTORY-ASSISTANT · CHECKPOINT] message when the threshold is reached. On every such",
3565
3566
  "reminder you MUST reply with the exact ACK code:",
3566
- " [TRAJECTORY-ASSISTANT-recorded-{code}] — if you recorded progress to SESSION.md",
3567
- " [TRAJECTORY-ASSISTANT-skipped-{code}] — if nothing to record this round",
3567
+ " [COGNITIVE-TRAJECTORY-ASSISTANT-recorded-{code}] — if you recorded progress to SESSION.md",
3568
+ " [COGNITIVE-TRAJECTORY-ASSISTANT-skipped-{code}] — if nothing to record this round",
3568
3569
  "Do not ignore the reminder; do not stop ongoing work. Codes are single-use;",
3569
3570
  "never reuse a prior code.",
3570
3571
  ""
@@ -3704,15 +3705,15 @@ function registerEntrySkillSection(agent, root) {
3704
3705
  }
3705
3706
  }
3706
3707
  /**
3707
- * 轨迹 skill 注入 section(规格 `docs/trajectory-skill-injection.md` §3,v1.34.1)。
3708
+ * 轨迹 skill 注入 section(规格 `docs/cognitive-trajectory-skill-injection.md` §3,v1.34.1)。
3708
3709
  *
3709
3710
  * **声明来源(两条,并集)**:
3710
- * · **CCC 级**(v1.44.0,owner 令)= `.opencode/serenity.json` 的 `trajectory.skills`
3711
+ * · **CCC 级**(v1.44.0,owner 令)= `.opencode/serenity.json` 的 `cognitiveTrajectory.skills`
3711
3712
  * ——**本 CCC 的每条轨迹都带**(含 skiff 角色会话),是容器给的底座;
3712
3713
  * · **轨迹级** = 该会话绑定的轨迹(`readLastBound(session).mdPath` = 它的 `SESSION.md`)
3713
3714
  * 顶部 frontmatter 的 `skills:`——这条轨迹额外的。
3714
- * 合并规则与顺序见 `trajectory-skills.mergeSkillNames`(CCC 级在前,同名去重)。
3715
- * 正文 = 合并清单里各 skill 的 `SKILL.md` 全文(本模块只注册,装配在 `trajectory-skills.ts`)。
3715
+ * 合并规则与顺序见 `cognitive-trajectory-skills.mergeSkillNames`(CCC 级在前,同名去重)。
3716
+ * 正文 = 合并清单里各 skill 的 `SKILL.md` 全文(本模块只注册,装配在 `cognitive-trajectory-skills.ts`)。
3716
3717
  *
3717
3718
  * 为什么是 **per-agent scoped section**(与 `registerEntrySkillSection` 同形):注入必须
3718
3719
  * **绑定期间持续存在**(a2)——一次性注入会随对话压缩消失,而 section 每次装配重新求值。
@@ -3723,21 +3724,21 @@ function registerEntrySkillSection(agent, root) {
3723
3724
  * 自动跟上(**动态注入,不缓存**),且绑定消失时返回 `''`
3724
3725
  * (宿主 renderSections **丢弃空 section**,不残留噪声)。
3725
3726
  *
3726
- * ⚠️ 路径取自绑定的 `mdPath`(权威记录),**不用** `resolveSessionTrajectoryLabel` 的显示 label
3727
+ * ⚠️ 路径取自绑定的 `mdPath`(权威记录),**不用** `resolveSessionCognitiveTrajectoryLabel` 的显示 label
3727
3728
  * 去拼路径——label 是模糊匹配的展示码,拼路径即模糊匹配当精确匹配用。
3728
3729
  *
3729
3730
  * @param agent 目标 agent(其 `session` 需有 `header.id` + `header.cwd`)
3730
3731
  * @param root 该 agent 的 CCC 根
3731
3732
  * @returns 是否**本次**完成注册(已注册过 / 门未过 → false)
3732
3733
  */
3733
- const trajectorySkillAgents = /* @__PURE__ */ new Set();
3734
- function registerTrajectorySkillSection(agent, root) {
3734
+ const cognitiveTrajectorySkillAgents = /* @__PURE__ */ new Set();
3735
+ function registerCognitiveTrajectorySkillSection(agent, root) {
3735
3736
  const session = agent.session;
3736
3737
  const key = session.id ?? "global";
3737
- if (trajectorySkillAgents.has(key)) return false;
3738
+ if (cognitiveTrajectorySkillAgents.has(key)) return false;
3738
3739
  const bound = readLastBound(session);
3739
3740
  if (!bound) return false;
3740
- if (readTrajectorySkills(root).length === 0 && !hasTrajectorySkillsDeclaration(root, bound.mdPath)) return false;
3741
+ if (readCognitiveTrajectorySkills(root).length === 0 && !hasCognitiveTrajectorySkillsDeclaration(root, bound.mdPath)) return false;
3741
3742
  try {
3742
3743
  agent.ctx.systemPrompt.section({
3743
3744
  name: "serenity-trajectory-skills",
@@ -3745,10 +3746,10 @@ function registerTrajectorySkillSection(agent, root) {
3745
3746
  text: () => {
3746
3747
  const current = readLastBound(session);
3747
3748
  if (!current) return "";
3748
- return buildTrajectorySkillsSection(root, current.mdPath, TRAJECTORY_SKILLS_MAX_CHARS, readTrajectorySkills(root), (names) => recordSkillInjections(root, names));
3749
+ return buildCognitiveTrajectorySkillsSection(root, current.mdPath, COGNITIVE_TRAJECTORY_SKILLS_MAX_CHARS, readCognitiveTrajectorySkills(root), (names) => recordSkillInjections(root, names));
3749
3750
  }
3750
3751
  });
3751
- trajectorySkillAgents.add(key);
3752
+ cognitiveTrajectorySkillAgents.add(key);
3752
3753
  return true;
3753
3754
  } catch {
3754
3755
  return false;
@@ -3783,7 +3784,7 @@ const AUTO_BOUND_NOTE_PREFIX = "auto-created for skiff role";
3783
3784
  * 系统提示词中的**工作台纪律块**(v1.30.4 升级:从单行路径 → 完整 ACC 层约束)。
3784
3785
  * 用户点破(S142):只给路径 LLM 不会主动用——需注入「已绑定 + 使用纪律 + 动作指引」。
3785
3786
  * SESSION = 工作台——skiff 与主舱同一套机制(零特调,用户拍板):
3786
- * 自动绑定已生效(无需 container_trajectory use)、SESSION.md 是持久记忆载体、rebuild 自动从本 SESSION 续接。
3787
+ * 自动绑定已生效(无需 cognitive_trajectory use)、SESSION.md 是持久记忆载体、rebuild 自动从本 SESSION 续接。
3787
3788
  * 注入 agent 系统提示词(用户对话面不可见)。
3788
3789
  *
3789
3790
  * v1.30.13(S142 诊断 D5):写入纪律**不点名具体工具**。旧文案写死 "with write/edit",
@@ -3793,10 +3794,10 @@ const AUTO_BOUND_NOTE_PREFIX = "auto-created for skiff role";
3793
3794
  * 具体通道由 CCC 的角色配置与角色提示词决定(ACC/CCC 归属二分;也不把某个 CCC 的
3794
3795
  * MSM 名硬编码进 ACC 源码)。
3795
3796
  */
3796
- function workspaceTrajectoryLine(mdPath) {
3797
+ function workspaceCognitiveTrajectoryLine(mdPath) {
3797
3798
  return [
3798
3799
  "── Serenity Session Workspace ──",
3799
- "This role session is AUTO-BOUND to a trajectory workspace SESSION (no container_trajectory use needed):",
3800
+ "This role session is AUTO-BOUND to a cognitive trajectory workspace SESSION (no cognitive_trajectory use needed):",
3800
3801
  ` SESSION.md: ${mdPath}`,
3801
3802
  "",
3802
3803
  "Rules of the workspace:",
@@ -3809,7 +3810,7 @@ function workspaceTrajectoryLine(mdPath) {
3809
3810
  " Keep entries at milestone level (one line + evidence pointer); execution detail",
3810
3811
  " belongs in commit messages. Keep it current — it is",
3811
3812
  " what a rebuild resumes from.",
3812
- " 3. When context pressure is high, run container_trajectory rebuild — it auto-resumes from THIS SESSION.md",
3813
+ " 3. When context pressure is high, run cognitive_trajectory rebuild — it auto-resumes from THIS SESSION.md",
3813
3814
  " (no manual use; do not switch to or read other SESSIONs unless the user explicitly asks).",
3814
3815
  " 4. Never expose this internal path in user-facing replies (chat stays clean).",
3815
3816
  "── ──"
@@ -3826,7 +3827,7 @@ const workspaceSectionAgents = /* @__PURE__ */ new WeakSet();
3826
3827
  * 用户原话(S142,2026-09-08):"微信桥的注入机制,每个用户消息都会注入,skiff 本身也会注入,
3827
3828
  * 这样就重复,能否微信桥情况下,注入内容直接取 skiff 的,这样不用配两遍"。
3828
3829
  *
3829
- * 现状(改前):`createSkiffAgent` 把 `workspaceTrajectoryLine(mdPath)` 塞进基础段
3830
+ * 现状(改前):`createSkiffAgent` 把 `workspaceCognitiveTrajectoryLine(mdPath)` 塞进基础段
3830
3831
  * (创建时一次快照),微信桥又**每条消息**把同一文本拼进 question(v1.30.4 为覆盖
3831
3832
  * "live/existing 快路径不重挂提示词"而加)→ 新建 agent 首轮起即重复,且每轮重复付 token。
3832
3833
  *
@@ -3849,7 +3850,7 @@ function ensureWorkspacePromptSection(agent, scope) {
3849
3850
  order: -55,
3850
3851
  text: () => {
3851
3852
  const mdPath = getActiveSessionInfo(scope)?.mdPath;
3852
- return mdPath ? workspaceTrajectoryLine(mdPath) : "";
3853
+ return mdPath ? workspaceCognitiveTrajectoryLine(mdPath) : "";
3853
3854
  }
3854
3855
  });
3855
3856
  workspaceSectionAgents.add(agent);
@@ -3868,7 +3869,7 @@ function ensureWorkspacePromptSection(agent, scope) {
3868
3869
  * (调试页等**无固定会话 id**的临时 agent)→ null。理由(R↓):这些 agent 每次
3869
3870
  * 调用都是新 id、无身份延续,为其建 SESSION = 每次问答留一个永久空目录(无界熵增);
3870
3871
  * 用户模型「skiff 本质是临时会话机制」——工作台属于**持久身份**,不属于单次调用。
3871
- * ① 角色未启用 session 能力(trajectory.session !== true)→ null(现状零变化)
3872
+ * ① 角色未启用 session 能力(cognitiveTrajectory.session !== true)→ null(现状零变化)
3872
3873
  * ② 已有**本机制自动创建**的 bound(note 前缀 auto-created)→ 恢复(重启/续接记得)
3873
3874
  * ②b 内存活跃记录(同 scope)→ 恢复 + **自愈补写绑定**(防御纵深:绑定写失败/事件形态未落盘时
3874
3875
  * 仍复用同一 SESSION,而不是每条消息新建一个——v1.30.5 及更早"每条消息一个 SESSION"的放大效应)
@@ -3879,7 +3880,7 @@ function ensureWorkspacePromptSection(agent, scope) {
3879
3880
  * @returns 绑定后的 SESSION.md 绝对路径(供提示词注入);不适用/失败 → null
3880
3881
  */
3881
3882
  function ensureSkiffSession(root, agent, roleName, role, persistent = true) {
3882
- if (!trajectorySubset(role).session) return null;
3883
+ if (!cognitiveTrajectorySubset(role).session) return null;
3883
3884
  if (!persistent) return null;
3884
3885
  const session = agent.session;
3885
3886
  const scope = String(agent.session.id ?? agent.id);
@@ -3977,7 +3978,7 @@ async function createSkiffAgent(ctx, root, roleName, role, defaultModel, session
3977
3978
  console.warn(`[serenity-hooks] skiff 系统提示词注册失败: ${String(err?.message ?? err)}`);
3978
3979
  }
3979
3980
  if (agent?.session) try {
3980
- registerTrajectorySkillSection(agent, root);
3981
+ registerCognitiveTrajectorySkillSection(agent, root);
3981
3982
  } catch (err) {
3982
3983
  console.warn(`[serenity-hooks] skiff 轨迹 skill 注入注册失败(不影响 agent 创建): ${String(err?.message ?? err)}`);
3983
3984
  }
@@ -4078,7 +4079,7 @@ async function createOrResumeAgent(ctx, id, root, model, setup, fixedId) {
4078
4079
  /**
4079
4080
  * 会话事件读取(v1.28.0 适配 0.1.2-rc.1):rc.1 Session 移除 `.events` 属性 → `snapshotEvents()` 方法。
4080
4081
  * 兼容双形态(运行时 rc.1 snapshotEvents;测试替身 events)——同一函数两处语义,测试注入零侵入。
4081
- * 注:与 trajectory-ops.ts 导出的共享 `sessionEvents` 同构(v1.28.1 收敛基准)。本模块保留本地副本
4082
+ * 注:与 cognitive-trajectory-ops.ts 导出的共享 `sessionEvents` 同构(v1.28.1 收敛基准)。本模块保留本地副本
4082
4083
  * 以维持独立 import 面(零 DSH 依赖测试替身形态一致);若未来重构可统一 import 共享版。
4083
4084
  */
4084
4085
  function sessionEvents(session) {
@@ -4099,7 +4100,7 @@ function lastAssistantText$1(agent) {
4099
4100
  return "";
4100
4101
  }
4101
4102
  /** events → 可读轨迹(user/assistant 文本 + 工具调用 + 工具结果;单条解析失败跳过) */
4102
- function eventsToTrajectory(events) {
4103
+ function eventsToCognitiveTrajectory(events) {
4103
4104
  const out = [];
4104
4105
  for (const raw of events) try {
4105
4106
  const ev = raw;
@@ -4148,7 +4149,7 @@ function truncate(s, n) {
4148
4149
  * 提问一轮:followup → 等 idle → 读答案 + 轨迹。
4149
4150
  * @param eventsStart 轨迹起点:显式传 0 = 全量轨迹(会话追问时页面重绘完整时间线,
4150
4151
  * v1.25.10 用户拍板);不传(undefined)= 本轮增量(followup 前 events 之后)
4151
- * @param options.includeTrajectory 是否计算轨迹(v1.26.10 起供**对外面**传 false 跳过计算——
4152
+ * @param options.includeCognitiveTrajectory 是否计算轨迹(v1.26.10 起供**对外面**传 false 跳过计算——
4152
4153
  * 原消费方 = 3100 公开问答页 / ACP JSON-RPC,**该面已于 2026-10-15 退役** ⇒ 现无生产调用方传 false;
4153
4154
  * 3099 调试页默认 true 保留)
4154
4155
  */
@@ -4163,24 +4164,24 @@ async function askSkiff(ctx, agent, question, eventsStart, options) {
4163
4164
  }));
4164
4165
  await waitAgentIdle(ctx, agent);
4165
4166
  const answer = lastAssistantText$1(agent);
4166
- const trajectory = options?.includeTrajectory === false ? [] : eventsToTrajectory(sessionEvents(agent.session).slice(before));
4167
+ const cognitiveTrajectory = options?.includeCognitiveTrajectory === false ? [] : eventsToCognitiveTrajectory(sessionEvents(agent.session).slice(before));
4167
4168
  return {
4168
4169
  answer,
4169
4170
  sessionId: String(agent.session.id ?? ""),
4170
- trajectory
4171
+ cognitiveTrajectory
4171
4172
  };
4172
4173
  }
4173
4174
  /**
4174
4175
  * Skiff 会话的轨迹纪律参与判定:非 skiff 会话恒 true(正常参与);
4175
- * skiff 会话按角色 trajectory 子集(session/keeper/rebuild)决定;
4176
+ * skiff 会话按角色 cognitiveTrajectory 子集(session/keeper/rebuild)决定;
4176
4177
  * 注册表缺失(进程重启遗留等)→ 保守旁路(false,完全独立)。
4177
4178
  */
4178
- function skiffTrajectoryEnabled(root, sessionId, key) {
4179
+ function skiffCognitiveTrajectoryEnabled(root, sessionId, key) {
4179
4180
  if (!isSkiffSessionId(sessionId)) return true;
4180
4181
  const roleName = sessionId ? skiffRoleFor(sessionId) : null;
4181
4182
  if (!roleName) return false;
4182
4183
  const role = readSkiffRoles(root).get(roleName);
4183
- return trajectorySubset(role)[key];
4184
+ return cognitiveTrajectorySubset(role)[key];
4184
4185
  }
4185
4186
  /**
4186
4187
  * msm 工具的 Skiff 门控:非 skiff 会话恒放行;skiff 会话——
@@ -9626,9 +9627,9 @@ function cutoffDaysAgo(days, nowMs = Date.now()) {
9626
9627
  //#endregion
9627
9628
  //#region src/wake-registry.ts
9628
9629
  /**
9629
- * wake-registry.ts — trajectory 唤醒注册表(D58,S142 2026-09-13)
9630
+ * wake-registry.ts — 认知轨迹唤醒注册表(D58,S142 2026-09-13)
9630
9631
  *
9631
- * 需求(用户原话):一个 CCC 内允许多个 trajectory 任意形态并行;某个 trajectory 可以
9632
+ * 需求(用户原话):一个 CCC 内允许多个认知轨迹任意形态并行;某个认知轨迹可以
9632
9633
  * **预定未来唤醒自己或别人**,本质上是一次「未来时刻 + 一条 message」的投递;「周期自唤醒」
9633
9634
  * 曾是它的特例(原 ACC autopilot / D59,该机制已于 2026-09-15 整段退场)。协作边界:
9634
9635
  * 互相可见、**无阻塞无等待**。
@@ -9774,7 +9775,7 @@ function parseWakeAt(input, nowMs) {
9774
9775
  /**
9775
9776
  * 登记一条唤醒。
9776
9777
  * @param root CCC 根
9777
- * @param input 目标 trajectory / 时刻串 / message / 发起者 / 当前时刻
9778
+ * @param input 目标认知轨迹 / 时刻串 / message / 发起者 / 当前时刻
9778
9779
  * @returns 成功返回条目,失败返回稳定错误文案(不抛错)
9779
9780
  */
9780
9781
  function addWake(root, input) {
@@ -10042,7 +10043,7 @@ const CRO_TIMEOUT_MS = 6e4;
10042
10043
  const CRO_STDOUT_MAX = 65536;
10043
10044
  /** 绑定文件体积上限(它只是个机器名 ⇒ 超过这个数一定是写错了,不读) */
10044
10045
  const CRO_HOST_FILE_MAX = 1024;
10045
- /** SESSION.md 文件名(与 `trajectory-ops.ts` 同值;此处本地常量避免反向依赖) */
10046
+ /** SESSION.md 文件名(与 `cognitive-trajectory-ops.ts` 同值;此处本地常量避免反向依赖) */
10046
10047
  const SESSION_MD = "SESSION.md";
10047
10048
  /**
10048
10049
  * 展示码派生(**只用于展示**,不作识别依据 —— §0I U4:锚永远是 `dirName`)。
@@ -10323,7 +10324,7 @@ function parseCroHostBinding(raw) {
10323
10324
  * @param root CCC 根
10324
10325
  * @returns 启用了 CRO 的轨迹目录名(**排序后**,保证同 tick 顺序稳定、便于日志比对)
10325
10326
  */
10326
- function listCroTrajectories(root) {
10327
+ function listCroCognitiveTrajectories(root) {
10327
10328
  const rootDir = sessionsRoot(root);
10328
10329
  let entries;
10329
10330
  try {
@@ -10788,10 +10789,10 @@ function registerCroTurnTracking(ctx) {
10788
10789
  *
10789
10790
  * ## 所有者令(本模块的存在理由)
10790
10791
  *
10791
- * 「S151 和 S185 的验证都说明,trajectory 倾向于自己做个结构化记录来记录自身 CRO 的执行情况,
10792
+ * 「S151 和 S185 的验证都说明,认知轨迹倾向于自己做个结构化记录来记录自身 CRO 的执行情况,
10792
10793
  * 这是个结构化流水账;**我们 ACC 有必要进行 CRO 唤醒的日志记录**,当 CRO 存在时,每次**成功唤醒**
10793
10794
  * 写相关信息,但是保留数量要少,**只保留仅两日**的记录即可,**这个时间是程序化的**」
10794
- * +「**这个日志写结构化文件到 trajectory 目录,文件名固定即可**」
10795
+ * +「**这个日志写结构化文件到认知轨迹目录,文件名固定即可**」
10795
10796
  * +「**失败成功都记录**」。
10796
10797
  *
10797
10798
  * ## 它解决什么麻烦(白话)
@@ -11196,10 +11197,10 @@ function createClock(opts) {
11196
11197
  //#endregion
11197
11198
  //#region src/wake-scheduler.ts
11198
11199
  /**
11199
- * wake-scheduler.ts — trajectory 唤醒调度器(D58/D59/D60;S142 2026-09-13)
11200
+ * wake-scheduler.ts — 认知轨迹唤醒调度器(D58/D59/D60;S142 2026-09-13)
11200
11201
  *
11201
11202
  * 一个**中心调度器**(5min tick,复用 autopilot 的节律常量),处理 CCC 唤醒注册表里
11202
- * 到期的条目:把「未来时刻 + 一条 message」投递给目标 trajectory,**fire-and-forget**
11203
+ * 到期的条目:把「未来时刻 + 一条 message」投递给目标认知轨迹,**fire-and-forget**
11203
11204
  * (无阻塞、无等待、无回执——发起方不 await,调度器不替模型结果负责)。
11204
11205
  *
11205
11206
  * 与 autopilot 的关系(D59):**两个 tick 各自独立**。autopilot 是每 CCC 单例的
@@ -11251,7 +11252,7 @@ function resolveWakeTarget(root, target) {
11251
11252
  *
11252
11253
  * 历史(勿误读):v1.34 S-1 曾把两闸解耦(周期自唤醒 `autopilotWakeEnabled` / 本钟 `wakeSchedulerEnabled`),
11253
11254
  * 理由是"关 auto-trajectory 不得连带关一次性唤醒";随 ACC 侧 autopilot 于 v1.35.0 整段退场,
11254
- * 两闸只剩本钟一座 ⇒ 现已整座移除。详见 `docs/trajectory-scheduling.md` §S-1 与 v1.44 CHANGELOG。
11255
+ * 两闸只剩本钟一座 ⇒ 现已整座移除。详见 `docs/cognitive-trajectory-scheduling.md` §S-1 与 v1.44 CHANGELOG。
11255
11256
  */
11256
11257
  /**
11257
11258
  * 🔴 **本钟的串行域**(C6b 硬约束):`clock.chain` 是**本实例私有**的——
@@ -11265,15 +11266,15 @@ function resolveWakeTarget(root, target) {
11265
11266
  */
11266
11267
  /** 本钟的装配项(`ctx` 由 {@link registerWakeScheduler} 在装配点填入) */
11267
11268
  const clockOpts = {
11268
- label: "trajectory 唤醒调度器",
11269
+ label: "认知轨迹唤醒调度器",
11269
11270
  ctx: void 0,
11270
11271
  events: ["session/created", "serenity/settings-changed"],
11271
11272
  body: () => runWakeTick(clockOpts.ctx),
11272
11273
  logFrom: {
11273
- prefix: "[serenity-hooks] trajectory 唤醒 ",
11274
+ prefix: "[serenity-hooks] 认知轨迹唤醒 ",
11274
11275
  lines: (lines) => lines
11275
11276
  },
11276
- startLog: () => "[serenity-hooks] ✓ trajectory 唤醒调度器启动(5min tick)"
11277
+ startLog: () => "[serenity-hooks] ✓ 认知轨迹唤醒调度器启动(5min tick)"
11277
11278
  };
11278
11279
  const clock = createClock(clockOpts);
11279
11280
  /** 调度器进程态快照(只读)。
@@ -11286,7 +11287,7 @@ function wakeSchedulerState() {
11286
11287
  * 取目标 agent:live 优先 → 冷会话走 sessionController.resolveAgent → 标题回退。
11287
11288
  * @param ctx 插件上下文
11288
11289
  * @param root CCC 根
11289
- * @param dirName 目标 trajectory 目录名
11290
+ * @param dirName 目标认知轨迹目录名
11290
11291
  * @returns 命中返回 agent 与取得方式(how 进 lastResult,便于诊断);未命中返回原因
11291
11292
  * (原因带 `notReady` = **环境未就绪**而非投递失败,调用方**不得**据此记一次失败)
11292
11293
  *
@@ -11331,17 +11332,17 @@ async function acquireWakeAgent(ctx, root, dirName) {
11331
11332
  }
11332
11333
  }
11333
11334
  return {
11334
- error: `无绑定会话记录(AGENT_SESSIONS/.bindings.json 中无 ${dirName})——目标轨迹需先被 container_trajectory use 激活过`,
11335
+ error: `无绑定会话记录(AGENT_SESSIONS/.bindings.json 中无 ${dirName})——目标轨迹需先被 cognitive_trajectory use 激活过`,
11335
11336
  noBinding: true
11336
11337
  };
11337
11338
  }
11338
11339
  /** 唤醒消息(唤起即投递正文:身份锚定 + 唤醒信息 + 任务) */
11339
11340
  function buildWakeText(entry, target) {
11340
11341
  return [
11341
- `[trajectory 唤醒] 到点(登记于 ${entry.createdAt},发起者 ${entry.createdBy || "未知"},id ${entry.id})。`,
11342
+ `[认知轨迹唤醒] 到点(登记于 ${entry.createdAt},发起者 ${entry.createdBy || "未知"},id ${entry.id})。`,
11342
11343
  `当前时间:${localHuman()}(当地时区)。`,
11343
11344
  "",
11344
- `身份锚定:继续 ${target.dirName} 的 trajectory(SESSION.md: ${target.mdPath})。`,
11345
+ `身份锚定:继续 ${target.dirName} 的认知轨迹(SESSION.md: ${target.mdPath})。`,
11345
11346
  "",
11346
11347
  "唤醒信息:",
11347
11348
  entry.message,
@@ -11360,7 +11361,7 @@ async function deliverWake(ctx, root, entry) {
11360
11361
  const target = resolveWakeTarget(root, entry.target);
11361
11362
  if (!target) return {
11362
11363
  ok: false,
11363
- detail: `目标 trajectory 未命中(${entry.target})`
11364
+ detail: `目标认知轨迹未命中(${entry.target})`
11364
11365
  };
11365
11366
  const acquired = await acquireWakeAgent(ctx, root, target.dirName);
11366
11367
  if ("error" in acquired) return {
@@ -11403,7 +11404,7 @@ function buildSendText(target, message, sender) {
11403
11404
  return [
11404
11405
  `[即时消息] 来自 ${sender || "未知轨迹"}。当前时间:${localHuman()}(当地时区)。`,
11405
11406
  "",
11406
- `身份锚定:继续 ${target.dirName} 的 trajectory(SESSION.md: ${target.mdPath})。`,
11407
+ `身份锚定:继续 ${target.dirName} 的认知轨迹(SESSION.md: ${target.mdPath})。`,
11407
11408
  "",
11408
11409
  "消息:",
11409
11410
  message,
@@ -11412,7 +11413,7 @@ function buildSendText(target, message, sender) {
11412
11413
  ].join("\n");
11413
11414
  }
11414
11415
  /**
11415
- * 即时投递(`container_trajectory send-now`)——与 `send-later`(预约)**共用取用通路**(`acquireWakeAgent`),
11416
+ * 即时投递(`cognitive_trajectory send-now`)——与 `send-later`(预约)**共用取用通路**(`acquireWakeAgent`),
11416
11417
  * 区别只在**时刻**(现在 vs 未来)与**回执**(有 vs 无):
11417
11418
  * · `send-later`(原 `wake-later`):未来时刻 + 一条 message → 落注册表 → 本文件的调度器到点投递(**fire-and-forget,无回执**)
11418
11419
  * · `send-now`(原 `send-message`):**此刻**把一条 message 递给目标 → **同步回执** → **不落注册表**
@@ -11439,7 +11440,7 @@ function buildSendText(target, message, sender) {
11439
11440
  * 预约的本职是"到点唤起",且在跑时排队不打断是它被实证验收过的行为,不顺手动它。
11440
11441
  *
11441
11442
  * **归属**:本函数放在调度器侧而非工具侧 —— "怎么把一句话送到一条轨迹"是**调度器的知识**,
11442
- * 工具只该知道"有这个动作"。这样 `trajectory.ts` 完全不碰调度器内部(v1.35.0 硬约束①:
11443
+ * 工具只该知道"有这个动作"。这样 `cognitive-trajectory.ts` 完全不碰调度器内部(v1.35.0 硬约束①:
11443
11444
  * `send-later` 链路**一行为不动**,本次改动 = **纯新增**)。
11444
11445
  *
11445
11446
  * @param ctx 插件上下文
@@ -11449,11 +11450,11 @@ function buildSendText(target, message, sender) {
11449
11450
  * @param sender 发起者轨迹标识
11450
11451
  * @returns 投递结果(**同步**返回给调用方)
11451
11452
  */
11452
- async function sendToTrajectory(ctx, root, target, message, sender) {
11453
+ async function sendToCognitiveTrajectory(ctx, root, target, message, sender) {
11453
11454
  const t = resolveWakeTarget(root, target);
11454
11455
  if (!t) return {
11455
11456
  ok: false,
11456
- detail: `目标 trajectory 未命中(${target})`
11457
+ detail: `目标认知轨迹未命中(${target})`
11457
11458
  };
11458
11459
  let acquired = await acquireWakeAgent(ctx, root, t.dirName);
11459
11460
  let createdNote = "";
@@ -11558,7 +11559,7 @@ async function createAndBindTarget(ctx, root, dirName) {
11558
11559
  const sc = hostService(ctx, "sessionController");
11559
11560
  const create = sc?.create;
11560
11561
  if (typeof create !== "function") return {
11561
- error: "目标无活跃 dsh 会话,且 sessionController.create 不可用(绑定 id: 无)——无法就地创建载体;请先对该轨迹执行一次 container_trajectory use",
11562
+ error: "目标无活跃 dsh 会话,且 sessionController.create 不可用(绑定 id: 无)——无法就地创建载体;请先对该轨迹执行一次 cognitive_trajectory use",
11562
11563
  notReady: true
11563
11564
  };
11564
11565
  const ws = findWorkspaceByPath(listWorkspaces(ctx) ?? [], root);
@@ -11693,7 +11694,7 @@ function findWorkspaceByPath(workspaces, root) {
11693
11694
  * (工作区注册表 ∪ 持久化会话 ∪ live 会话):**没有 live 会话的 CCC 也会被扫到**。
11694
11695
  *
11695
11696
  * ⚠️ 边界(本步**只**改"枚举哪些 CCC",**不改**"怎么找到要交付的 agent"):
11696
- * 把 message 交给某条 trajectory 仍必须靠 **live 会话**解析(见本文件
11697
+ * 把 message 交给某条认知轨迹仍必须靠 **live 会话**解析(见本文件
11697
11698
  * `acquireWakeAgent`);无 live 会话时该 CCC 只是**被扫到、
11698
11699
  * 无交付对象** ⇒ `deliverWake` 返回 `无绑定会话记录…`,条目回 `pending` 并留痕。
11699
11700
  * 因此本函数**不得**让 tick 抛错(异常一律由调用方 tick 兜住,见 `runWakeTick` 的 try)。
@@ -11726,7 +11727,7 @@ function buildCroWakeText(dirName, mdPath, prompt, reason) {
11726
11727
  `[CRO 唤起] ${dirName} 自带的 continuous-re-occurrence.ts 判定:现在该唤起。`,
11727
11728
  `当前时间:${localHuman()}(当地时区)。`,
11728
11729
  "",
11729
- `身份锚定:继续 ${dirName} 的 trajectory(SESSION.md: ${mdPath})。`,
11730
+ `身份锚定:继续 ${dirName} 的认知轨迹(SESSION.md: ${mdPath})。`,
11730
11731
  "",
11731
11732
  `判定理由:${reason ?? "(程序未提供 reason —— 见 CRO 编写指南 §7 坑 3)"}`,
11732
11733
  "",
@@ -11808,7 +11809,7 @@ async function runCroPhase(ctx, root, registry, log) {
11808
11809
  }
11809
11810
  let dirs;
11810
11811
  try {
11811
- dirs = listCroTrajectories(root);
11812
+ dirs = listCroCognitiveTrajectories(root);
11812
11813
  } catch {
11813
11814
  return;
11814
11815
  }
@@ -11940,7 +11941,7 @@ async function runWakeTick(ctx) {
11940
11941
  function registerWakeScheduler(ctx) {
11941
11942
  clockOpts.ctx = ctx;
11942
11943
  clock.start();
11943
- registerDisposer(ctx, "trajectory 唤醒调度器", () => clock.dispose());
11944
+ registerDisposer(ctx, "认知轨迹唤醒调度器", () => clock.dispose());
11944
11945
  }
11945
11946
  //#endregion
11946
11947
  //#region src/cro-guide.ts
@@ -11973,10 +11974,10 @@ function registerWakeScheduler(ctx) {
11973
11974
  * 不写任何真实机器路径或私有会话名 —— 本文件随 npm 包发布(2026-10-14 隐私核查)。
11974
11975
  */
11975
11976
  const CRO_SAMPLE_SNAPSHOT_INPUT = {
11976
- dirName: "2026-01-01--S001--example-trajectory",
11977
+ dirName: "2026-01-01--S001--example-cognitive-trajectory",
11977
11978
  cccRoot: "/home/user/workspace",
11978
11979
  nowMs: 17898e8,
11979
- sessionMdPath: "/home/user/workspace/AGENT_SESSIONS/2026-01-01--S001--example-trajectory/SESSION.md",
11980
+ sessionMdPath: "/home/user/workspace/AGENT_SESSIONS/2026-01-01--S001--example-cognitive-trajectory/SESSION.md",
11980
11981
  sessionMdBytes: 182e3,
11981
11982
  sessionMdMtimeMs: 1789799e6,
11982
11983
  references: [{
@@ -12181,18 +12182,18 @@ ${renderCroSampleSnapshot()}
12181
12182
  **吃一份快照,吐一行决策。先自测,绿了再改名。**
12182
12183
  `;
12183
12184
  //#endregion
12184
- //#region src/tools/trajectory.ts
12185
+ //#region src/tools/cognitive-trajectory.ts
12185
12186
  /**
12186
- * trajectory.ts — `container_trajectory` 真实 DSH 工具定义(defineTool)
12187
+ * trajectory.ts — `cognitive_trajectory` 真实 DSH 工具定义(defineTool)
12187
12188
  *
12188
12189
  * v1.33(S142 §32 用户裁决):由 `logbook` **更名并收敛为 `trajectory`**(v1.34:工具名再硬切为
12189
- * `container_trajectory`,无别名)——trajectory 是一等概念
12190
+ * `container_trajectory`,无别名)——cognitive trajectory 是一等概念
12190
12191
  * (SESSION.md 是它的持久身体),本工具管它的**载体生命周期 + 一次性时间安排**。
12191
12192
  * 动作面现行 **8 个**:list / show / create / use / rebuild / **`send-now`** / **`send-later`** / **`cro-guide`**。
12192
12193
  * 🔴 2026-09-16(所有者裁决):**第 7 个动作 `send-message`(即时投递)**
12193
12194
  * ——与 `wake-later` 共用取用通路,差别只在**时刻**(现在 vs 未来)与**回执**(有 vs 无);
12194
12195
  * 实现落在 `wake-scheduler.ts` 的 `sendToTrajectory()`("怎么把一句话送到一条轨迹"是调度器的知识)。
12195
- * 设计稿 = `docs/trajectory-send-message-design.md`(v0.2 定稿)。
12196
+ * 设计稿 = `docs/cognitive-trajectory-send-message-design.md`(v0.2 定稿)。
12196
12197
  * 🔴 2026-09-17(所有者裁决 · **命名 A 案**):**两个投递动作更名** —— `wake-later` → **`send-later`**、
12197
12198
  * `send-message` → **`send-now`**。判据(R↓):两者本是**同一条投递通路**(同取用机制 / 同载荷 /
12198
12199
  * 同落点语义),只差**时刻**;而「唤醒(冷载入)」是**两条路径共有**的属性,不配做区分
@@ -12211,7 +12212,7 @@ ${renderCroSampleSnapshot()}
12211
12212
  * 归档能力由 `container_fs mv → _archived/` 承担
12212
12213
  * · `hook-develop-guide` → **淘汰**(v1.34.1:SEP 整体废除——「能落 harness 已有原语,
12213
12214
  * 就不要自造协议 + 脚本管道」;轨迹挂哪些 skill 改由 SESSION.md frontmatter 声明 +
12214
- * `systemPrompt.section` 注入,见 `docs/trajectory-skill-injection.md`)
12215
+ * `systemPrompt.section` 注入,见 `docs/cognitive-trajectory-skill-injection.md`)
12215
12216
  * · autopilot 面(all/init/random/diag/doc/check/status/guide)→ `container_admin` 的 autopilot 域
12216
12217
  * · `wake-add`/`wake-list`/`wake-rm` → **`wake-later`**(v1.33 收敛;**2026-09-17 更名 `send-later`**)
12217
12218
  * · 2026-09-20(CRO 落地):新增 **`cro-guide`** —— CRO 编写指南的出口(纯读)。
@@ -12319,40 +12320,40 @@ function renderText$3(value) {
12319
12320
  }];
12320
12321
  }
12321
12322
  /**
12322
- * 创建 trajectory 工具(原 logbook;v1.33 S142 §32 更名 + 动作收敛)。
12323
+ * 创建 cognitive trajectory 工具(原 logbook;v1.33 S142 §32 更名 + 动作收敛)。
12323
12324
  * 闭包捕获插件 ctx → use 后可调 ctx.sessionTitle.rename。
12324
12325
  */
12325
- function createTrajectoryTool(ctx) {
12326
+ function createCognitiveTrajectoryTool(ctx) {
12326
12327
  return defineTool({
12327
- name: "container_trajectory",
12328
+ name: "cognitive_trajectory",
12328
12329
  description: [
12329
- "container_trajectory — one trajectory: its persistent body (SESSION.md) + its timeline.",
12330
- "A trajectory is NOT the conversation: SESSION.md is the durable body and never moves;",
12331
- "the dsh conversation is only its rebuildable carrier (Ship of Theseus — the carrier is replaced, the trajectory continues).",
12330
+ "cognitive_trajectory — one cognitive trajectory: its persistent body (SESSION.md) + its timeline.",
12331
+ "A cognitive trajectory is NOT the conversation: SESSION.md is the durable body and never moves;",
12332
+ "the dsh conversation is only its rebuildable carrier (Ship of Theseus — the carrier is replaced, the cognitive trajectory continues).",
12332
12333
  "ACTIONS, grouped by EFFECT (read the grouping before picking one):",
12333
- "(A) LIFECYCLE — changes which trajectory THIS conversation is bound to:",
12334
- "list (inventory + stats + anomaly marks) / show (read one SESSION.md) / create (make a NEW trajectory) /",
12335
- "use (bind THIS conversation to an existing trajectory; inline integrity check — silent when fine, problems reported as hints, never errors) /",
12334
+ "(A) LIFECYCLE — changes which cognitive trajectory THIS conversation is bound to:",
12335
+ "list (inventory + stats + anomaly marks) / show (read one SESSION.md) / create (make a NEW cognitive trajectory) /",
12336
+ "use (bind THIS conversation to an existing cognitive trajectory; inline integrity check — silent when fine, problems reported as hints, never errors) /",
12336
12337
  "rebuild (clear-and-rebuild THIS conversation in place).",
12337
- "(B) DELIVERY — sends ONE message to ANOTHER trajectory; your own binding is unchanged:",
12338
+ "(B) DELIVERY — sends ONE message to ANOTHER cognitive trajectory; your own binding is unchanged:",
12338
12339
  "send-now (deliver RIGHT NOW) / send-later (deliver at ONE future instant).",
12339
- "(C) REFERENCE — cro-guide (how to give THIS trajectory its own program that decides when it should be woken).",
12340
+ "(C) REFERENCE — cro-guide (how to give THIS cognitive trajectory its own program that decides when it should be woken).",
12340
12341
  "HOW TO CHOOSE (a rule, not a guess):",
12341
- "not yet bound + starting new work ⇒ create — with no prior binding it activates immediately, so the new trajectory has a carrier at once.",
12342
- "already bound + recording a separate future line ⇒ create — it does NOT steal your binding (you stay on the current trajectory);",
12342
+ "not yet bound + starting new work ⇒ create — with no prior binding it activates immediately, so the new cognitive trajectory has a carrier at once.",
12343
+ "already bound + recording a separate future line ⇒ create — it does NOT steal your binding (you stay on the current cognitive trajectory);",
12343
12344
  "activate the new one when you want it by sending it a message.",
12344
- "want THIS conversation to move to another trajectory ⇒ use (refuses when it would orphan the current binding; --force overrides).",
12345
- "want to poke another trajectory ⇒ send-now. Its target needs NO prior setup:",
12345
+ "want THIS conversation to move to another cognitive trajectory ⇒ use (refuses when it would orphan the current binding; --force overrides).",
12346
+ "want to poke another cognitive trajectory ⇒ send-now. Its target needs NO prior setup:",
12346
12347
  "if the target has no live dsh session, one is created and bound automatically, and your message is injected into it.",
12347
12348
  "RECEIPTS (read no more than is written): send-now returns a synchronous receipt meaning exactly \"injected / turn started\" —",
12348
12349
  "NEVER \"the target ran or replied\"; to prove the target actually moved, read its SESSION.md.",
12349
12350
  "It never queues behind the current turn: a busy target is steered mid-turn (read in the CURRENT turn), an idle target starts a turn at once.",
12350
12351
  "send-later is fire-and-forget by design: no receipt, no recall, no panel.",
12351
12352
  "ASYMMETRY (deliberate — the two differ in whether a missing target is normal): send-now creates a target on demand,",
12352
- "because sending to a never-used trajectory is a legitimate intent; send-later does NOT,",
12353
- "because scheduling for a trajectory that has never existed is almost always a mistyped name — auto-creating would hide that error behind an empty trajectory.",
12353
+ "because sending to a never-used cognitive trajectory is a legitimate intent; send-later does NOT,",
12354
+ "because scheduling for a cognitive trajectory that has never existed is almost always a mistyped name — auto-creating would hide that error behind an empty cognitive trajectory.",
12354
12355
  "PARAMETERS: create requires --desc <desc> [--goal] or --issue <ticket> (exactly one) plus --summary (≤20 chars).",
12355
- "use requires --summary (≤20 chars) and may pass --force to switch away from the currently-bound trajectory.",
12356
+ "use requires --summary (≤20 chars) and may pass --force to switch away from the currently-bound cognitive trajectory.",
12356
12357
  "rebuild requires --summary (next-phase summary ≤20 chars) + optional --note (task focus for the rebuilt self).",
12357
12358
  "send-later requires target (S### or AGENT_SESSIONS dir name) + at (RFC3339 or +30m/+2h) + message.",
12358
12359
  "send-now requires target + message.",
@@ -12361,16 +12362,16 @@ function createTrajectoryTool(ctx) {
12361
12362
  parameters: {
12362
12363
  action: {
12363
12364
  type: "string",
12364
- enum: [...TRAJECTORY_ACTIONS],
12365
+ enum: [...COGNITIVE_TRAJECTORY_ACTIONS],
12365
12366
  required: true,
12366
12367
  description: [
12367
12368
  "Subcommand — grouped by effect.",
12368
12369
  "LIFECYCLE (changes THIS conversation's binding):",
12369
12370
  "list (inventory + stats + anomaly marks) / show (S### or dir name or fuzzy keyword) /",
12370
- "create (new trajectory; activates itself when you have no binding, otherwise leaves your binding untouched and tells you how to activate it) /",
12371
+ "create (new cognitive trajectory; activates itself when you have no binding, otherwise leaves your binding untouched and tells you how to activate it) /",
12371
12372
  "use (activate context for THIS conversation; inline integrity check — pass silent, problems reported as hints, not errors) /",
12372
12373
  "rebuild (clear-and-rebuild current conversation — requires --summary + optional --note).",
12373
- "DELIVERY (sends one message to ANOTHER trajectory; your binding is unchanged):",
12374
+ "DELIVERY (sends one message to ANOTHER cognitive trajectory; your binding is unchanged):",
12374
12375
  "send-now (deliver RIGHT NOW; the target needs no prior setup — if it has no live session, one is created and bound automatically) /",
12375
12376
  "send-later (one future instant + one message; fire-and-forget, and it does NOT auto-create a target).",
12376
12377
  "REFERENCE: cro-guide (no parameters: prints the CRO programming guide, including a ready-to-use sample snapshot)"
@@ -12402,7 +12403,7 @@ function createTrajectoryTool(ctx) {
12402
12403
  },
12403
12404
  force: {
12404
12405
  type: "boolean",
12405
- description: "use: allow switching away from the currently-bound trajectory (binding guard override)"
12406
+ description: "use: allow switching away from the currently-bound cognitive trajectory (binding guard override)"
12406
12407
  },
12407
12408
  dryRun: {
12408
12409
  type: "boolean",
@@ -12410,7 +12411,7 @@ function createTrajectoryTool(ctx) {
12410
12411
  },
12411
12412
  target: {
12412
12413
  type: "string",
12413
- description: "send-later/send-now: target trajectory (S### or AGENT_SESSIONS directory name)"
12414
+ description: "send-later/send-now: target cognitive trajectory (S### or AGENT_SESSIONS directory name)"
12414
12415
  },
12415
12416
  at: {
12416
12417
  type: "string",
@@ -12418,7 +12419,7 @@ function createTrajectoryTool(ctx) {
12418
12419
  },
12419
12420
  message: {
12420
12421
  type: "string",
12421
- description: "send-later/send-now: the single message delivered to the target trajectory"
12422
+ description: "send-later/send-now: the single message delivered to the target cognitive trajectory"
12422
12423
  }
12423
12424
  },
12424
12425
  output: {
@@ -12468,7 +12469,7 @@ function createTrajectoryTool(ctx) {
12468
12469
  return [
12469
12470
  message,
12470
12471
  `⚠ 本轨迹【未】被激活 —— 当前已绑定 ${priorBound},保绑定优先(不夺走你正在用的轨迹)。`,
12471
- ` 要激活它(并在它名下开一条会话):用 container_trajectory send-now 向 ${result.dirName} 投一条消息 ——`,
12472
+ ` 要激活它(并在它名下开一条会话):用 cognitive_trajectory send-now 向 ${result.dirName} 投一条消息 ——`,
12472
12473
  ` 目标若没有活跃 dsh 会话,会自动创建一条并把「使用提示词 + 你的消息」一并注入。`
12473
12474
  ].join("\n");
12474
12475
  }
@@ -12482,7 +12483,7 @@ function createTrajectoryTool(ctx) {
12482
12483
  const currentDir = currentBoundDirName(exec, scope);
12483
12484
  const switching = currentDir !== null && targetDirName !== currentDir;
12484
12485
  const force = args.force === true;
12485
- if (switching && !force) throw new Error(`Session is bound to ${currentDir}. Switching to ${targetDirName} would orphan the current trajectory. Re-run with --force to switch (or close the current session first).`);
12486
+ if (switching && !force) throw new Error(`Session is bound to ${currentDir}. Switching to ${targetDirName} would orphan the current cognitive trajectory. Re-run with --force to switch (or close the current session first).`);
12486
12487
  const active = useSession(root, args.name, scope);
12487
12488
  const info = getActiveSessionInfo(scope);
12488
12489
  if (info) renameDshSessionForActive(ctx, exec, info, args.summary);
@@ -12536,7 +12537,7 @@ function createTrajectoryTool(ctx) {
12536
12537
  target: args.target,
12537
12538
  at: args.at,
12538
12539
  message: args.message,
12539
- createdBy: resolveSessionTrajectoryLabel(exec.agent?.session, wakeScope === "default" ? "" : wakeScope),
12540
+ createdBy: resolveSessionCognitiveTrajectoryLabel(exec.agent?.session, wakeScope === "default" ? "" : wakeScope),
12540
12541
  nowMs: Date.now()
12541
12542
  });
12542
12543
  if (!res.ok) return {
@@ -12551,7 +12552,7 @@ function createTrajectoryTool(ctx) {
12551
12552
  case "send-now": {
12552
12553
  if (!args.target || !args.message) throw new Error("send-now requires target (S### or dir name) + message");
12553
12554
  const sendScope = agentScope$1(exec);
12554
- const res = await sendToTrajectory(ctx, root, args.target, args.message, resolveSessionTrajectoryLabel(exec.agent?.session, sendScope === "default" ? "" : sendScope));
12555
+ const res = await sendToCognitiveTrajectory(ctx, root, args.target, args.message, resolveSessionCognitiveTrajectoryLabel(exec.agent?.session, sendScope === "default" ? "" : sendScope));
12555
12556
  if (!res.ok) return {
12556
12557
  ok: false,
12557
12558
  error: res.detail
@@ -12579,7 +12580,7 @@ function createTrajectoryTool(ctx) {
12579
12580
  */
12580
12581
  function renderWakeEntry(e) {
12581
12582
  return [
12582
- "═══ trajectory 唤醒(1 条)═══",
12583
+ "═══ cognitive trajectory 唤醒(1 条)═══",
12583
12584
  ` · ${e.id} [${e.state}] at=${e.at} target=${e.target} by=${e.createdBy || "?"}`,
12584
12585
  ` message: ${e.message.length > 120 ? `${e.message.slice(0, 120)}…` : e.message}`,
12585
12586
  "",
@@ -12672,7 +12673,7 @@ const localstoreTool = defineTool({
12672
12673
  /** Skiff 定义教程(核心):概念 / schema / 认知 MSM 写法 / 双白名单 / 轨迹纪律 / 示例角色 */
12673
12674
  const SKIFF_GUIDE = `═══ Skiff Definition Guide (F4, experimental) ═══
12674
12675
 
12675
- Skiff = 宁静号放出的独立小艇——完整 trajectory(在宁静号内全知全能)的**任意子集角色**。
12676
+ Skiff = 宁静号放出的独立小艇——完整 cognitive trajectory(在宁静号内全知全能)的**任意子集角色**。
12676
12677
  由本 CCC(.opencode/serenity.json skiff.roles)定义:能力面(双白名单)+ 轨迹纪律子集 + 系统提示词。
12677
12678
  dsp 只提供机制(双白名单强制 + 基础提示词 + 调试问答页);角色内容完全由 CCC 发挥。
12678
12679
 
@@ -12682,7 +12683,7 @@ dsp 只提供机制(双白名单强制 + 基础提示词 + 调试问答页)
12682
12683
  "model": "provider/model", // 角色模型(CCC 直接指定,无白名单校验;缺省回退 cheap-worker.defaultModel)
12683
12684
  "msms": ["msm-a", "msm-b"], // MSM 白名单(独立):msm 工具只能执行这些;register/deregister 必拒
12684
12685
  "tools": ["read","grep","glob",...], // 非 MSM 工具白名单(独立):白名单外工具一律不可用(guard 强制)
12685
- "trajectory": { "session": false, "keeper": false, "rebuild": false }, // 轨迹纪律子集(缺省全关 = 完全独立)
12686
+ "cognitiveTrajectory": { "session": false, "keeper": false, "rebuild": false }, // 轨迹纪律子集(缺省全关 = 完全独立)
12686
12687
  // 角色人格/认知边界/风格(CCC 完整定义;dsp 只给基础提示词)
12687
12688
  "systemPromptFile": ".opencode/skiff/<role>.md" // ★ 推荐:引用 md 文件(相对 CCC 根;超长提示词在 JSON 内嵌不可读)
12688
12689
  // "systemPrompt": "..." // 兼容:内嵌字符串仍可用;两者都设时 systemPromptFile 优先
@@ -12700,14 +12701,14 @@ dsp 只提供机制(双白名单强制 + 基础提示词 + 调试问答页)
12700
12701
  - 例:cognitive-qa(读 docs/references 回答)、review-scan(读代码出审查意见)、review-fix(写修复)
12701
12702
  - 注意:MSM 在脚本层执行(bun),文件访问不受 agent 工具面约束——"只读"语义靠 CCC 自写 MSM 自觉
12702
12703
 
12703
- ── 轨迹纪律子集(trajectory)──
12704
+ ── 轨迹纪律子集(cognitiveTrajectory)──
12704
12705
  - session/keeper/rebuild 默认 false:Skiff 完全独立(不建 SESSION.md、无 keeper 提醒、无 rebuild 压力检测)
12705
12706
  - 开启某项 = 该角色参与对应轨迹机制(如 keeper=true 计分提醒按角色生效)
12706
12707
 
12707
12708
  ── 示例角色 ──
12708
- qa-readonly: { "msms": ["cognitive-qa"], "tools": [], "trajectory": {} }
12709
+ qa-readonly: { "msms": ["cognitive-qa"], "tools": [], "cognitiveTrajectory": {} }
12709
12710
  → 认知问答(仅 MSM 通道,无直接工具,完全独立)
12710
- code-review: { "msms": ["review-scan","review-fix"], "tools": ["read","grep","glob","write","edit"], "trajectory": { "keeper": true } }
12711
+ code-review: { "msms": ["review-scan","review-fix"], "tools": ["read","grep","glob","write","edit"], "cognitiveTrajectory": { "keeper": true } }
12711
12712
  → 有操作能力(可写修复),参与 keeper 轨迹机制
12712
12713
 
12713
12714
  ── 运行 ──
@@ -12762,10 +12763,10 @@ function listSkiffRoles(root) {
12762
12763
  model: role.model ?? "(cheap-worker default)",
12763
12764
  msms: role.msms ?? [],
12764
12765
  tools: role.tools ?? [],
12765
- trajectory: {
12766
- session: role.trajectory?.session === true,
12767
- keeper: role.trajectory?.keeper === true,
12768
- rebuild: role.trajectory?.rebuild === true
12766
+ cognitiveTrajectory: {
12767
+ session: role.cognitiveTrajectory?.session === true,
12768
+ keeper: role.cognitiveTrajectory?.keeper === true,
12769
+ rebuild: role.cognitiveTrajectory?.rebuild === true
12769
12770
  },
12770
12771
  promptSource: systemPromptSource(role),
12771
12772
  ...role.systemPromptFile ? { systemPromptFile: role.systemPromptFile } : {}
@@ -13444,7 +13445,7 @@ function forgetImBridgeVisibility(sessionId) {
13444
13445
  *
13445
13446
  * 🔴 **为什么要在 CCC 内屏蔽(owner 原话:「这和 CRO 冲突,要求在宁静号激活情况下屏蔽掉」)**:
13446
13447
  * 宿主从 `0.2.1-rc.2` 起自带一套**模型可见的定时器工具**(`ctx.schedule` 服务 + 这 4 个工具)。
13447
- * 而宁静号的唤醒/巡航走的是**另一套**机制:`container_trajectory send-later` → 落 CCC 的
13448
+ * 而宁静号的唤醒/巡航走的是**另一套**机制:`cognitive_trajectory send-later` → 落 CCC 的
13448
13449
  * `AGENT_SESSIONS/wake-registry.json` → 由**中心调度器 5min tick 统一投递**(D58)。
13449
13450
  * 两套并存会产生**三个具体问题**(不是"重复功能"这种审美问题):
13450
13451
  * ① **两处真相源**:宿主的 schedule 状态在宿主域、我们的在 CCC 文件里,**谁在跑说不清**;
@@ -14104,12 +14105,12 @@ function registerBootstrap(ctx) {
14104
14105
  }, { prepend: true });
14105
14106
  }
14106
14107
  //#endregion
14107
- //#region src/trajectory-assistant.ts
14108
+ //#region src/cognitive-trajectory-assistant.ts
14108
14109
  /**
14109
- * trajectory-assistant.ts — 关卡化注入的统一命名与风格门面(v0.3,S142)
14110
+ * cognitive-trajectory-assistant.ts — 关卡化注入的统一命名与风格门面(v0.3,S142)
14110
14111
  *
14111
14112
  * 概念(用户拍板 2026-09-05):dsp 全部"过程中动态提示注入"统一命名为
14112
- * trajectory-assistant(轨迹助航员)。关卡设计思想塑造**结构与时机**
14113
+ * cognitive-trajectory-assistant(轨迹助航员)。关卡设计思想塑造**结构与时机**
14113
14114
  * (何时/何地注入),**不用于提示词用词**(D8 词法原则)——纯游戏黑话
14114
14115
  * (BOSS/XP/level-up)禁止出现在提示词文本;CHECKPOINT/LIMIT/TUTORIAL 等
14115
14116
  * 跨领域自然通用词允许。
@@ -14122,7 +14123,7 @@ function registerBootstrap(ctx) {
14122
14123
  * L6 结算)仅在本模块注释与内部文档出现,永不浮现在提示词文本。
14123
14124
  *
14124
14125
  * 结算(settlement)挂点:D6 用户拍板——若 CCC 有标准 SESSION 复盘仪式,
14125
- * 结算视图归 trajectory-assistant。当前 close/archive 无复盘摘要 ⇒ 机制延后。
14126
+ * 结算视图归 cognitive-trajectory-assistant。当前 close/archive 无复盘摘要 ⇒ 机制延后。
14126
14127
  * 🔴 2026-09-25(S142 分批清死代码·第 1 批):原先那个 `onSettlement(cb)` **空 seam 已删**
14127
14128
  * (零调用者、无触发器、空实现)——仪式真落地时按当时的信号重新设计,**不再靠空占位**。
14128
14129
  */
@@ -14147,8 +14148,8 @@ const EVENT_LABEL = {
14147
14148
  scratchPrune: "SCRATCH PRUNE"
14148
14149
  };
14149
14150
  /** 家族标识(所有动态注入统一前缀) */
14150
- const ASSISTANT_PREFIX = "TRAJECTORY-ASSISTANT";
14151
- /** 完整 token:`[TRAJECTORY-ASSISTANT · <LABEL>]` */
14151
+ const ASSISTANT_PREFIX = "COGNITIVE-TRAJECTORY-ASSISTANT";
14152
+ /** 完整 token:`[COGNITIVE-TRAJECTORY-ASSISTANT · <LABEL>]` */
14152
14153
  function eventToken(event) {
14153
14154
  return `[${ASSISTANT_PREFIX} · ${EVENT_LABEL[event]}]`;
14154
14155
  }
@@ -14233,7 +14234,7 @@ function reminderText(code) {
14233
14234
  * 简短留自由度(不提"加载 eap 工具",模型自知;只说修订 skill + 新建 skill 落 SESSION)。
14234
14235
  *
14235
14236
  * escalated=true(v1.23.3):连续多轮超阈值仍未 rebuild → 升级强制语气
14236
- * (STOP and rebuild now,持续注入直到调用 container_trajectory rebuild)。
14237
+ * (STOP and rebuild now,持续注入直到调用 cognitive_trajectory rebuild)。
14237
14238
  *
14238
14239
  * 需求①(S142 用户拍板,v1.28.0):百分比比例 → K 数值——**判定**改为绝对
14239
14240
  * `projectedTokens ≥ thresholdK*1000`(触发语义,未变)。
@@ -14246,16 +14247,16 @@ function reminderText(code) {
14246
14247
  *
14247
14248
  * v1.31.1 交接协议(S142 用户需求"要求 LLM 将当前手头事项写在 SESSION.md 尾部,并要求
14248
14249
  * rebuild 后去读并处理"):**写侧** = 这里;**读侧** = rebuild 锚点(rebuild.ts)。
14249
- * 两侧共用 trajectory-assistant 的常量(单一真相源)。
14250
+ * 两侧共用 cognitive-trajectory-assistant 的常量(单一真相源)。
14250
14251
  *
14251
14252
  * 🔴 **v1.49.0(owner 2026-09-26 裁决:"砍掉 in-flight,这正是目的")**:写侧**不再**指向
14252
14253
  * SESSION.md 末尾的段,改指**独立便签文件** `REBUILD-TODO_FILENAME`(轨迹目录下)——
14253
14254
  * 理由见该常量的头注(持久文件 vs 只用一次的交界材料必须分家)。
14254
14255
  */
14255
14256
  function rebuildReminderText(escalated = false) {
14256
- const handover = ` Before rebuilding, write your current in-flight items (the exact step you are in the middle of, what is not finished yet, and what the next action is) into "${REBUILD_TODO_FILENAME}" in this trajectory's directory — create it if it does not exist. That file is a scratch note for the handover only: no format obligation, no archival duty, safe to discard at any time. The rebuilt conversation reads it first and continues from it.`;
14257
- if (escalated) return `${eventToken("limitMandatory")} Context usage has reached the configured rebuild threshold — you have been reminded repeatedly and have NOT called the container_trajectory rebuild action. This is now mandatory: STOP at the current task step, preserve valuable cognition into the CCC skills (or write a new-skill proposal into SESSION.md), then call container_trajectory rebuild immediately, passing --summary "<content summary ≤20 chars>" (required; the dsh session title is renamed to S###-YYYY-MM-DD-<summary> after rebuild).${handover} The conversation will be cleared and rebuilt in place; SESSION.md is the persistent trajectory and stays in place — identity continues from it. Do not continue working without rebuilding; this reminder persists until you call container_trajectory rebuild.`;
14258
- return `${eventToken("limit")} Context usage has reached the configured rebuild threshold. This session is the rebuildable carrier of the trajectory: SESSION.md is the persistent body, this conversation is only a temporary work copy. Before rebuilding: if this conversation produced valuable cognition, revise the relevant existing skill of this CCC (structure it with eap); if a new skill is warranted, write a short proposal into SESSION.md for the user to review — do not create it yourself.${handover} ACT NOW: at the next natural pause (end of the current task step), call the container_trajectory rebuild action — passing --summary "<content summary ≤20 chars>" describing the next work phase (required; the dsh session title is renamed to S###-YYYY-MM-DD-<summary> after rebuild) — to clear and rebuild this conversation: the current copy is discarded, identity continues from SESSION.md. If you are in the middle of an unbreakable step, continue it, then rebuild at its end. Do not ignore this; rebuild is the expected action, not an option.`;
14257
+ const handover = ` Before rebuilding, write your current in-flight items (the exact step you are in the middle of, what is not finished yet, and what the next action is) into "${REBUILD_TODO_FILENAME}" in this cognitive trajectory's directory — create it if it does not exist. That file is a scratch note for the handover only: no format obligation, no archival duty, safe to discard at any time. The rebuilt conversation reads it first and continues from it.`;
14258
+ if (escalated) return `${eventToken("limitMandatory")} Context usage has reached the configured rebuild threshold — you have been reminded repeatedly and have NOT called the cognitive_trajectory rebuild action. This is now mandatory: STOP at the current task step, preserve valuable cognition into the CCC skills (or write a new-skill proposal into SESSION.md), then call cognitive_trajectory rebuild immediately, passing --summary "<content summary ≤20 chars>" (required; the dsh session title is renamed to S###-YYYY-MM-DD-<summary> after rebuild).${handover} The conversation will be cleared and rebuilt in place; SESSION.md is the persistent cognitive trajectory and stays in place — identity continues from it. Do not continue working without rebuilding; this reminder persists until you call cognitive_trajectory rebuild.`;
14259
+ return `${eventToken("limit")} Context usage has reached the configured rebuild threshold. This session is the rebuildable carrier of the cognitive trajectory: SESSION.md is the persistent body, this conversation is only a temporary work copy. Before rebuilding: if this conversation produced valuable cognition, revise the relevant existing skill of this CCC (structure it with eap); if a new skill is warranted, write a short proposal into SESSION.md for the user to review — do not create it yourself.${handover} ACT NOW: at the next natural pause (end of the current task step), call the cognitive_trajectory rebuild action — passing --summary "<content summary ≤20 chars>" describing the next work phase (required; the dsh session title is renamed to S###-YYYY-MM-DD-<summary> after rebuild) — to clear and rebuild this conversation: the current copy is discarded, identity continues from SESSION.md. If you are in the middle of an unbreakable step, continue it, then rebuild at its end. Do not ignore this; rebuild is the expected action, not an option.`;
14259
14260
  }
14260
14261
  /** 读取会话 contextPressure 投影(sessionProjections 可选服务;未装配返回 null) */
14261
14262
  function readContextPressure(ctx, session) {
@@ -14288,7 +14289,7 @@ function forgetLogbookCompactionState(scope) {
14288
14289
  * 解析**活跃** SESSION.md 绝对路径(缓存 60s)。
14289
14290
  *
14290
14291
  * 候选链(刻意比 rebuild 的完整链短——这里每个工具调用都要跑,贵候选不划算):
14291
- * ① `getActiveSessionInfo(scope).mdPath`(`container_trajectory use` / skiff 绑定 / 重启恢复都会写)
14292
+ * ① `getActiveSessionInfo(scope).mdPath`(`cognitive_trajectory use` / skiff 绑定 / 重启恢复都会写)
14292
14293
  * ② `readLastBound(session).mdPath`(`.bindings.json` 权威绑定——重启后内存空时兜底)
14293
14294
  * 两者都拿不到 → null(**不猜**:宁可不提醒,也不去猜别的轨迹——对齐 v1.30.13 D4 的教训)。
14294
14295
  */
@@ -14355,13 +14356,13 @@ function readSessionMdMaxKB(root, configPaths, now = Date.now) {
14355
14356
  * ③ 允许整合不重要事项(被取代的决策 / 已解决问题 / 中间态)
14356
14357
  * ④ 自主裁量权充分允许(唯一硬要求 = 骨架 + 未决项/决策理由/下一步仍可重建)
14357
14358
  */
14358
- function trajectoryCompactionReminderText(input) {
14359
+ function cognitiveTrajectoryCompactionReminderText(input) {
14359
14360
  const { sizeKB, limitKB, mdPath, escalated = false } = input;
14360
14361
  const facts = `SESSION.md is ${sizeKB} KB (limit ${limitKB} KB): ${mdPath}`;
14361
14362
  const principles = "Load eap (praxis eap) first, then rewrite SESSION.md under these principles: (1) keep the EAP layered skeleton — a stable section structure, not a chronological dump; (2) move detail out — long evidence chains, logs and reference material belong in separate files (e.g. AGENT_SESSIONS/<session>/references/*.md) linked from SESSION.md; (3) merge or drop what no longer matters — superseded decisions, resolved issues, intermediate states; (4) you have full discretion on how far to go: the only hard requirements are the skeleton and that every still-open item, decision rationale and next step stays recoverable (reconstruction over preservation).";
14362
- const frontmatterGuard = "Keep the YAML frontmatter at the top of the file exactly as it is — it carries this trajectory's skill declarations.";
14363
+ const frontmatterGuard = "Keep the YAML frontmatter at the top of the file exactly as it is — it carries this cognitive trajectory's skill declarations.";
14363
14364
  if (escalated) return `${eventToken("compaction")} ${facts} — you have been reminded repeatedly and have NOT compacted SESSION.md. This is now mandatory: STOP the current task step, load eap (praxis eap), rewrite SESSION.md, then resume. ${principles} ${frontmatterGuard} This reminder persists until the file is under the limit.`;
14364
- return `${eventToken("compaction")} ${facts}. Pause the current work and compact this trajectory's log (SESSION.md) before continuing — that log is the persistent body of this trajectory, and its size is operational entropy (H_op) the container pays on every read. ${principles} ${frontmatterGuard} After rewriting, resume the paused work; this reminder stops once the file is under the limit.`;
14365
+ return `${eventToken("compaction")} ${facts}. Pause the current work and compact this cognitive trajectory's log (SESSION.md) before continuing — that log is the persistent body of this cognitive trajectory, and its size is operational entropy (H_op) the container pays on every read. ${principles} ${frontmatterGuard} After rewriting, resume the paused work; this reminder stops once the file is under the limit.`;
14365
14366
  }
14366
14367
  /** 连续超限轮数达此值 → 语气升级(对齐 COMPACTION_ESCALATE_AFTER / REBUILD_ESCALATE_AFTER) */
14367
14368
  const REBUILD_TODO_ESCALATE_AFTER = 3;
@@ -14371,7 +14372,7 @@ const rebuildTodoStates = /* @__PURE__ */ new Map();
14371
14372
  *
14372
14373
  * ## 与 SESSION.md 档的**语义差别**(刻意,不是疏漏)
14373
14374
  *
14374
- * | | SESSION.md 超限(`trajectoryCompactionReminderText`) | 便签超限(本条) |
14375
+ * | | SESSION.md 超限(`cognitiveTrajectoryCompactionReminderText`) | 便签超限(本条) |
14375
14376
  * |---|---|---|
14376
14377
  * | 动作 | **重写**(compaction) | **清理/丢弃**(prune) |
14377
14378
  * | 结构义务 | 保 EAP 骨架 + 4 条重写原则 + frontmatter 护栏 | **无** |
@@ -14390,7 +14391,7 @@ const rebuildTodoStates = /* @__PURE__ */ new Map();
14390
14391
  function rebuildTodoReminderText(input) {
14391
14392
  const { sizeKB, limitKB, mdPath, escalated = false } = input;
14392
14393
  const facts = `${REBUILD_TODO_FILENAME} is ${sizeKB} KB (limit ${limitKB} KB): ${mdPath}`;
14393
- const action = "This file is a scratch note for the rebuild handover — it carries no archival duty and you may discard it wholesale at any time. Prune it now, writing in the spirit of eap (praxis eap): (1) delete what is already done; (2) delete what has been superseded; (3) delete what is already recorded in SESSION.md — that file is the trajectory's persistent body, this one only carries what the next self needs once. Do not restructure it into a formal document: the only mechanical constraint on this file is its size.";
14394
+ const action = "This file is a scratch note for the rebuild handover — it carries no archival duty and you may discard it wholesale at any time. Prune it now, writing in the spirit of eap (praxis eap): (1) delete what is already done; (2) delete what has been superseded; (3) delete what is already recorded in SESSION.md — that file is the cognitive trajectory's persistent body, this one only carries what the next self needs once. Do not restructure it into a formal document: the only mechanical constraint on this file is its size.";
14394
14395
  if (escalated) return `${eventToken("scratchPrune")} ${facts} — you have been reminded repeatedly and have NOT pruned it. Prune it now. ${action} This reminder persists until the file is under the limit.`;
14395
14396
  return `${eventToken("scratchPrune")} ${facts}. ${action} This reminder stops once the file is under the limit.`;
14396
14397
  }
@@ -14417,8 +14418,8 @@ function registerKeeper(ctx, opts = {}) {
14417
14418
  const root = cccRootForCwd(cwd);
14418
14419
  if (!root) return next();
14419
14420
  const sessionId = exec.agent?.session?.id;
14420
- const skiffKeeper = skiffTrajectoryEnabled(root, sessionId, "keeper");
14421
- const skiffRebuild = skiffTrajectoryEnabled(root, sessionId, "rebuild");
14421
+ const skiffKeeper = skiffCognitiveTrajectoryEnabled(root, sessionId, "keeper");
14422
+ const skiffRebuild = skiffCognitiveTrajectoryEnabled(root, sessionId, "rebuild");
14422
14423
  const tracker = trackerFor(exec);
14423
14424
  const shouldRemind = skiffKeeper ? tracker.step(exec.name) : false;
14424
14425
  const downstream = await next();
@@ -14453,7 +14454,7 @@ function registerKeeper(ctx, opts = {}) {
14453
14454
  }
14454
14455
  }
14455
14456
  }
14456
- if (skiffTrajectoryEnabled(root, sessionId, "session")) {
14457
+ if (skiffCognitiveTrajectoryEnabled(root, sessionId, "session")) {
14457
14458
  const limitKB = readSessionMdMaxKB(root, opts.configPaths);
14458
14459
  if (limitKB > 0) {
14459
14460
  const scope = sessionId ?? "global";
@@ -14465,7 +14466,7 @@ function registerKeeper(ctx, opts = {}) {
14465
14466
  st.consecutive += 1;
14466
14467
  blocks.push({
14467
14468
  type: "text",
14468
- text: trajectoryCompactionReminderText({
14469
+ text: cognitiveTrajectoryCompactionReminderText({
14469
14470
  sizeKB: Math.round(size / 1024),
14470
14471
  limitKB,
14471
14472
  mdPath,
@@ -14476,7 +14477,7 @@ function registerKeeper(ctx, opts = {}) {
14476
14477
  } else compactionStates.delete(scope);
14477
14478
  }
14478
14479
  }
14479
- if (skiffTrajectoryEnabled(root, sessionId, "session")) {
14480
+ if (skiffCognitiveTrajectoryEnabled(root, sessionId, "session")) {
14480
14481
  const scope = sessionId ?? "global";
14481
14482
  const session = exec.agent?.session;
14482
14483
  const mdPath = resolveActiveSessionMdPath(root, scope, session);
@@ -14608,7 +14609,7 @@ function registerContext(ctx, opts = {}) {
14608
14609
  const key = agentKey(agent);
14609
14610
  if (isSkiffSessionId(key)) return;
14610
14611
  registerEntrySkillSection(agent, root);
14611
- registerTrajectorySkillSection(agent, root);
14612
+ registerCognitiveTrajectorySkillSection(agent, root);
14612
14613
  const scope = agentScope(agent);
14613
14614
  if (shouldRestoreActive(agent) && getActiveSessionInfo(scope) === null) try {
14614
14615
  if (loadSerenityConfig(root, configPaths).hooks?.autoRestoreSession ?? true) {
@@ -14707,7 +14708,7 @@ function registerContext(ctx, opts = {}) {
14707
14708
  syncHostScheduleToolHiding(agent, root);
14708
14709
  } catch {}
14709
14710
  registerEntrySkillSection(agent, root);
14710
- registerTrajectorySkillSection(agent, root);
14711
+ registerCognitiveTrajectorySkillSection(agent, root);
14711
14712
  }
14712
14713
  if (!root || injected.has(key) || downstream.kind !== "enter") return downstream;
14713
14714
  injected.add(key);
@@ -15185,11 +15186,11 @@ function registerStatusApi(ctx, opts = {}) {
15185
15186
  sendJson$3(res, 400, { error: chk.error });
15186
15187
  return;
15187
15188
  }
15188
- const { readWeixinSettings } = await import("./weixin-route-Aheyq3fN.js").then((n) => n.u);
15189
+ const { readWeixinSettings } = await import("./weixin-route-BoSC-uPp.js").then((n) => n.u);
15189
15190
  const { weixinBridgeStatus } = await Promise.resolve().then(() => weixin_bridge_exports);
15190
15191
  const settings = readWeixinSettings(chk.root);
15191
15192
  const bridge = weixinBridgeStatus().find((b) => b.ccc === chk.root);
15192
- const { readWeixinCredential } = await import("./weixin-route-Aheyq3fN.js").then((n) => n.u);
15193
+ const { readWeixinCredential } = await import("./weixin-route-BoSC-uPp.js").then((n) => n.u);
15193
15194
  const accounts = (settings.accounts ?? []).map((a) => ({
15194
15195
  accountId: a.accountId,
15195
15196
  name: a.name ?? void 0,
@@ -15221,7 +15222,7 @@ function registerStatusApi(ctx, opts = {}) {
15221
15222
  const { fetchQRCode } = await import("./weixin-api-BrRcPiQs.js").then((n) => n.u);
15222
15223
  const { randomUUID } = await import("node:crypto");
15223
15224
  for (const [key, v] of weixinLogins) if (Date.now() - v.startedAt > WEIXIN_LOGIN_TTL_MS) weixinLogins.delete(key);
15224
- const { readWeixinSettings } = await import("./weixin-route-Aheyq3fN.js").then((n) => n.u);
15225
+ const { readWeixinSettings } = await import("./weixin-route-BoSC-uPp.js").then((n) => n.u);
15225
15226
  const qr = await fetchQRCode({ botType: readWeixinSettings(root).botType ?? void 0 });
15226
15227
  const loginKey = randomUUID();
15227
15228
  weixinLogins.set(loginKey, {
@@ -15242,7 +15243,7 @@ function registerStatusApi(ctx, opts = {}) {
15242
15243
  sendJson$3(res, 400, { error: "missing accountId" });
15243
15244
  return;
15244
15245
  }
15245
- const { removeWeixinAccount } = await import("./weixin-route-Aheyq3fN.js").then((n) => n.u);
15246
+ const { removeWeixinAccount } = await import("./weixin-route-BoSC-uPp.js").then((n) => n.u);
15246
15247
  const { syncCccBridge } = await Promise.resolve().then(() => weixin_bridge_exports);
15247
15248
  removeWeixinAccount(root, body.accountId);
15248
15249
  syncCccBridge(ctx, root);
@@ -15255,8 +15256,8 @@ function registerStatusApi(ctx, opts = {}) {
15255
15256
  sendJson$3(res, 400, { error: "invalid routes (expected [{user, role}, ...])" });
15256
15257
  return;
15257
15258
  }
15258
- const { saveWeixinRoutes } = await import("./weixin-route-Aheyq3fN.js").then((n) => n.u);
15259
- const { readSkiffRoles } = await import("./skiff-role-B615L9MV.js").then((n) => n.u);
15259
+ const { saveWeixinRoutes } = await import("./weixin-route-BoSC-uPp.js").then((n) => n.u);
15260
+ const { readSkiffRoles } = await import("./skiff-role-Boc4SKct.js").then((n) => n.d);
15260
15261
  const roles = readSkiffRoles(root);
15261
15262
  for (const r of routes) if (!roles.has(r.role)) {
15262
15263
  sendJson$3(res, 400, { error: `unknown role: ${r.role} (not in ${root} skiff.roles)` });
@@ -15268,7 +15269,7 @@ function registerStatusApi(ctx, opts = {}) {
15268
15269
  }
15269
15270
  if (body.action === "set-enabled") {
15270
15271
  const enabled = body.enabled === true;
15271
- const { readWeixinSettings, setWeixinEnabled } = await import("./weixin-route-Aheyq3fN.js").then((n) => n.u);
15272
+ const { readWeixinSettings, setWeixinEnabled } = await import("./weixin-route-BoSC-uPp.js").then((n) => n.u);
15272
15273
  const { syncCccBridge } = await Promise.resolve().then(() => weixin_bridge_exports);
15273
15274
  const settings = readWeixinSettings(root);
15274
15275
  if (enabled && (settings.accounts ?? []).length === 0) {
@@ -15312,7 +15313,7 @@ function registerStatusApi(ctx, opts = {}) {
15312
15313
  return;
15313
15314
  }
15314
15315
  const { pollQRStatus } = await import("./weixin-api-BrRcPiQs.js").then((n) => n.u);
15315
- const { readWeixinSettings } = await import("./weixin-route-Aheyq3fN.js").then((n) => n.u);
15316
+ const { readWeixinSettings } = await import("./weixin-route-BoSC-uPp.js").then((n) => n.u);
15316
15317
  const settings = readWeixinSettings(login.root);
15317
15318
  const status = await pollQRStatus({
15318
15319
  baseUrl: void 0,
@@ -15327,7 +15328,7 @@ function registerStatusApi(ctx, opts = {}) {
15327
15328
  });
15328
15329
  return;
15329
15330
  }
15330
- const { upsertWeixinAccount, writeWeixinCredential, nextWeixinAccountId } = await import("./weixin-route-Aheyq3fN.js").then((n) => n.u);
15331
+ const { upsertWeixinAccount, writeWeixinCredential, nextWeixinAccountId } = await import("./weixin-route-BoSC-uPp.js").then((n) => n.u);
15331
15332
  const { syncCccBridge } = await Promise.resolve().then(() => weixin_bridge_exports);
15332
15333
  const accountId = nextWeixinAccountId(settings);
15333
15334
  upsertWeixinAccount(login.root, {
@@ -15448,7 +15449,7 @@ function registerAcpAccountsApi(ctx) {
15448
15449
  return;
15449
15450
  }
15450
15451
  const { acpChannelStatus, listAcpRoots } = await Promise.resolve().then(() => acp_auth_exports);
15451
- const { listCccs } = await import("./ccc-roots-GIJ3A_tw.js").then((n) => n.a);
15452
+ const { listCccs } = await import("./ccc-roots-RMzGU-CJ.js").then((n) => n.a);
15452
15453
  const st = acpChannelStatus(chk.root);
15453
15454
  const all = (await listCccs(ctx)).map((e) => e.root);
15454
15455
  sendJson$3(res, 200, {
@@ -15478,7 +15479,7 @@ function registerAcpAccountsApi(ctx) {
15478
15479
  sendJson$3(res, 400, { error: "invalid account (accountId 与 role 均必填)" });
15479
15480
  return;
15480
15481
  }
15481
- const { readSkiffRoles } = await import("./skiff-role-B615L9MV.js").then((n) => n.u);
15482
+ const { readSkiffRoles } = await import("./skiff-role-Boc4SKct.js").then((n) => n.d);
15482
15483
  const roles = readSkiffRoles(root);
15483
15484
  if (!roles.has(account.role)) {
15484
15485
  sendJson$3(res, 400, { error: `role "${account.role}" 不在该 CCC 的 skiff.roles 里(现有:${[...roles.keys()].join(", ") || "无"})` });
@@ -15938,7 +15939,7 @@ const HOST_SERVICES = [
15938
15939
  name: "resolveAgent",
15939
15940
  kind: "function"
15940
15941
  }],
15941
- impact: "trajectory 冷会话唤醒不可用(只能唤醒已加载的 live 会话)——唤醒注册表投递降级",
15942
+ impact: "cognitive trajectory 冷会话唤醒不可用(只能唤醒已加载的 live 会话)——唤醒注册表投递降级",
15942
15943
  required: false
15943
15944
  },
15944
15945
  {
@@ -17331,13 +17332,13 @@ function buildRebuildAnchor(root, sessionName, activeMdPath, anchorMessages = DE
17331
17332
  const sessionLine = sessionDir !== "AGENT_SESSIONS" ? `- Serenity session: ${sessionName !== "" ? `${sessionName} (${sessionDir})` : sessionDir}` : null;
17332
17333
  const focusLine = sanitizeFocusLine(focus);
17333
17334
  return [
17334
- `${eventToken("rebuild")} The conversation has been cleared and rebuilt (Ship of Theseus: the carrier is replaced, the trajectory continues).`,
17335
+ `${eventToken("rebuild")} The conversation has been cleared and rebuilt (Ship of Theseus: the carrier is replaced, the cognitive trajectory continues).`,
17335
17336
  "",
17336
17337
  ...anchorMessages.flatMap((text) => [stripAckSuffix(text), ""]),
17337
17338
  sessionName !== "" ? `Continue the work of ${sessionName}.` : "Continue the current work.",
17338
17339
  ...sessionLine ? [sessionLine] : [],
17339
- `- Persistent trajectory — SESSION.md path: ${rel}`,
17340
- ` (the trajectory's persistent body — stays in place through rebuilds)`,
17340
+ `- Persistent cognitive trajectory — SESSION.md path: ${rel}`,
17341
+ ` (the cognitive trajectory's persistent body — stays in place through rebuilds)`,
17341
17342
  `- Read that SESSION.md first (goal/decisions/progress/unresolved), then continue from the last checkpoint.`,
17342
17343
  `- Then read the handover scratch note: ${todoRel} (path: ${todoAbs}) — the previous self paused mid-task and left its in-flight items there. That file carries no format obligation and may be discarded at any time; it is NOT the authoritative state. If it is missing, infer the in-flight items from SESSION.md's latest progress entries.`,
17343
17344
  ...focusLine ? [`- Task focus: ${focusLine}`] : []
@@ -17389,7 +17390,7 @@ function sessionNameFromMdPath(mdPath) {
17389
17390
  * 它会把 rebuild 静默接到 AGENT_SESSIONS 里最新的另一个会话(临时 skiff 会话 persistent=false、
17390
17391
  * 重启后首条消息前、新会话首条消息都命中该形态),而"接错轨迹"比重建失败危险得多
17391
17392
  * (错误轨迹被继续写入 + 正确轨迹静默丢失)。现在全部候选失败 → 返回 null → 调用方
17392
- * 报错引导用户显式 `container_trajectory use`(响亮失败优于静默接错)。
17393
+ * 报错引导用户显式 `cognitive_trajectory use`(响亮失败优于静默接错)。
17393
17394
  * 备选:④ 仅在"同 scope 确无绑定"时兜底——同样会接错轨迹,故不采纳。
17394
17395
  *
17395
17396
  * 每候选 resolve 后 existsSync 校验(相对路径按 root 解析);全部失败返回 null → 调用方报错引导。
@@ -17449,7 +17450,7 @@ async function queueRebuild(ctx, opts) {
17449
17450
  const session = ctx.sessions?.get?.(dshSessionId);
17450
17451
  if (!session) throw new Error(`Unable to locate dsh session ${dshSessionId} (session may be closed)`);
17451
17452
  const mdPath = resolveSessionMdPath(root, dshSessionId, session);
17452
- if (!mdPath) throw new Error("Unable to determine the active SESSION.md for this session — checked (in order): in-memory activation (container_trajectory use in this process), [SESSION CONTEXT] events in this conversation, AGENT_SESSIONS/.bindings.json (authoritative binding), rebuild anchor in the surface. None matched an existing SESSION.md. Run \"container_trajectory use <S###> --summary <内容概括 ≤20 字>\" to bind this conversation to a trajectory, then retry container_trajectory rebuild. (No global fallback is applied on purpose — guessing could resume a different trajectory.)");
17453
+ if (!mdPath) throw new Error("Unable to determine the active SESSION.md for this session — checked (in order): in-memory activation (cognitive_trajectory use in this process), [SESSION CONTEXT] events in this conversation, AGENT_SESSIONS/.bindings.json (authoritative binding), rebuild anchor in the surface. None matched an existing SESSION.md. Run \"cognitive_trajectory use <S###> --summary <内容概括 ≤20 字>\" to bind this conversation to a cognitive trajectory, then retry cognitive_trajectory rebuild. (No global fallback is applied on purpose — guessing could resume a different cognitive trajectory.)");
17453
17454
  const sessionName = getActiveSessionInfo(dshSessionId)?.sessionId ?? sessionNameFromMdPath(mdPath);
17454
17455
  const focus = note && note.trim() !== "" ? note : void 0;
17455
17456
  const anchor = buildRebuildAnchor(root, sessionName, mdPath, DEFAULT_ANCHOR_MESSAGES, focus);
@@ -17619,7 +17620,7 @@ function registerRebuildTurnHook(ctx) {
17619
17620
  agent.steer(createUserMessage({
17620
17621
  content: [{
17621
17622
  type: "text",
17622
- text: `${eventToken("rebuild")} The conversation has been cleared and rebuilt. Follow the anchor instructions above now: read the persistent trajectory (SESSION.md) and continue the work automatically from the last checkpoint.`
17623
+ text: `${eventToken("rebuild")} The conversation has been cleared and rebuilt. Follow the anchor instructions above now: read the persistent cognitive trajectory (SESSION.md) and continue the work automatically from the last checkpoint.`
17623
17624
  }],
17624
17625
  source: PLUGIN_SOURCE
17625
17626
  }));
@@ -17627,7 +17628,7 @@ function registerRebuildTurnHook(ctx) {
17627
17628
  sessionId: id,
17628
17629
  event: "rebuilt"
17629
17630
  });
17630
- console.log(`[serenity-hooks] container_trajectory rebuild executed with auto-continue (turn ${payload.turn ?? "?"} ended): ${id}`);
17631
+ console.log(`[serenity-hooks] cognitive_trajectory rebuild executed with auto-continue (turn ${payload.turn ?? "?"} ended): ${id}`);
17631
17632
  } else writeRebuildDiag(resolveSerenityRootFor(agent), {
17632
17633
  sessionId: id,
17633
17634
  event: "empty-surface"
@@ -17639,7 +17640,7 @@ function registerRebuildTurnHook(ctx) {
17639
17640
  event: "failed",
17640
17641
  detail: msg
17641
17642
  });
17642
- console.warn(`[serenity-hooks] container_trajectory rebuild failed: ${msg}`);
17643
+ console.warn(`[serenity-hooks] cognitive_trajectory rebuild failed: ${msg}`);
17643
17644
  }
17644
17645
  });
17645
17646
  }
@@ -19383,7 +19384,7 @@ function skiffDebugPage(cccs, defaultRoot, webPort) {
19383
19384
  details.think summary { cursor: pointer; padding: 6px 10px; font-size: 12px; color: #d29922; font-weight: 600; user-select: none; list-style-position: inside; }
19384
19385
  details.think summary:hover { opacity: .8; }
19385
19386
  details.think .think-body { padding: 2px 12px 10px; font-size: 13px; opacity: .78; white-space: normal; }
19386
- #trajectory { margin-top: 12px; font-size: 13px; }
19387
+ #cognitiveTrajectory { margin-top: 12px; font-size: 13px; }
19387
19388
  .t-entry { border-left: 2px solid #d0d7de; padding: 6px 10px; margin: 6px 0; border-radius: 0 6px 6px 0; background: rgba(127,127,127,.06); white-space: pre-wrap; word-break: break-word; }
19388
19389
  .t-user { border-left-color: #0ba875; }
19389
19390
  .t-tool { border-left-color: #d29922; opacity: .85; font-family: ui-monospace, monospace; font-size: 12px; }
@@ -19410,7 +19411,7 @@ function skiffDebugPage(cccs, defaultRoot, webPort) {
19410
19411
  <textarea id="q" placeholder="向该角色提问…(追问直接继续输入)"></textarea>
19411
19412
  <button id="ask">提问</button>
19412
19413
  <div id="answer" class="muted">等待提问…</div>
19413
- <div id="trajectory"></div>
19414
+ <div id="cognitiveTrajectory"></div>
19414
19415
  <p class="muted"><a href="${`http://127.0.0.1:${webPort}`}" target="_blank" rel="noopener">在 dsh WebUI 查看完整会话</a>(会话列表搜索 sessionId;WebUI 有完整交互)</p>
19415
19416
  </main>
19416
19417
  <script id="skiff-data" type="application/json" data-default="${escapeHtml(defaultRoot)}">${data}<\/script>
@@ -19424,7 +19425,7 @@ const sessionBadge = document.getElementById('sessionBadge')
19424
19425
  const newChatBtn = document.getElementById('newChat')
19425
19426
  const btn = document.getElementById('ask')
19426
19427
  const answer = document.getElementById('answer')
19427
- const traj = document.getElementById('trajectory')
19428
+ const traj = document.getElementById('cognitiveTrajectory')
19428
19429
  const esc = (s) => String(s ?? '').replace(/[&<>"']/g, (c) => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]))
19429
19430
  let sessionId = ''
19430
19431
  function shortId(id) { return id.length > 24 ? id.slice(0, 18) + '…' + id.slice(-6) : id }
@@ -19485,7 +19486,7 @@ btn.addEventListener('click', async () => {
19485
19486
  answer.innerHTML = data.answer_html || esc(data.answer || '') || '(空回答)'
19486
19487
  sessionId = data.sessionId || sessionId
19487
19488
  renderSessionBadge()
19488
- renderTrajectory(data.trajectory || [], data.sessionId || '')
19489
+ renderCognitiveTrajectory(data.cognitiveTrajectory || [], data.sessionId || '')
19489
19490
  } catch (err) {
19490
19491
  answer.className = 'err'
19491
19492
  answer.textContent = String(err.message || err)
@@ -19493,7 +19494,7 @@ btn.addEventListener('click', async () => {
19493
19494
  btn.disabled = false
19494
19495
  }
19495
19496
  })
19496
- function renderTrajectory(entries, sessionId) {
19497
+ function renderCognitiveTrajectory(entries, sessionId) {
19497
19498
  if (entries.length === 0) { traj.innerHTML = '<div class="muted">(本轮无轨迹)</div>'; return }
19498
19499
  traj.innerHTML = '<div class="sub">本轮轨迹 · ' + esc(sessionId) + '</div>' + entries.map((e) => {
19499
19500
  const cls = e.role === 'user' ? 't-user' : (e.role === 'tool' ? 't-tool' : '')
@@ -19735,7 +19736,7 @@ async function handle(ctx, defaultRoot, webPort, req, res) {
19735
19736
  answer_html: renderSkiffMarkdown(result.answer),
19736
19737
  sessionId: result.sessionId,
19737
19738
  continued,
19738
- trajectory: result.trajectory
19739
+ cognitiveTrajectory: result.cognitiveTrajectory
19739
19740
  });
19740
19741
  return;
19741
19742
  }
@@ -19778,9 +19779,9 @@ const MECHANISM_WORDS = [
19778
19779
  "agent/turn-stopping",
19779
19780
  "tools/pre-execute",
19780
19781
  "tools/post-execute",
19781
- "Trajectory Steward",
19782
- "TRAJECTORY-STEWARD",
19783
- "TRAJECTORY-ASSISTANT",
19782
+ "Cognitive Trajectory Steward",
19783
+ "COGNITIVE-TRAJECTORY-STEWARD",
19784
+ "COGNITIVE-TRAJECTORY-ASSISTANT",
19784
19785
  "first-anchor",
19785
19786
  "拦截缝",
19786
19787
  "装配层",
@@ -19872,7 +19873,7 @@ const CATEGORY_GUIDE = {
19872
19873
  * v1.26.10 只列裸词(如 "3080")模型仍不知道是什么/怎么规避;现在按类说明:
19873
19874
  * "3080" → 内部服务端口,不要提及内部端口/地址/端点)。
19874
19875
  * R↓ 安全性:命中词本就已在被拦截回复中进入会话(已暴露面),打回重复一次不扩大暴露;
19875
- * steer 是 plugin source 消息不回显给用户(3100 对外响应已不含 trajectory → 打回文本不达外部用户)。
19876
+ * steer 是 plugin source 消息不回显给用户(3100 对外响应已不含 cognitive trajectory → 打回文本不达外部用户)。
19876
19877
  */
19877
19878
  function buildRebuke(hits) {
19878
19879
  const count = hits.length;
@@ -20637,7 +20638,7 @@ function manualOutputFallbackNeeded(input) {
20637
20638
  */
20638
20639
  async function resolveCccRootByAlias(ctx, alias) {
20639
20640
  try {
20640
- const { listCccs } = await import("./ccc-roots-GIJ3A_tw.js").then((n) => n.a);
20641
+ const { listCccs } = await import("./ccc-roots-RMzGU-CJ.js").then((n) => n.a);
20641
20642
  const entries = await listCccs(ctx);
20642
20643
  const byName = entries.find((e) => e.name === alias);
20643
20644
  if (byName) return byName.root;
@@ -20855,7 +20856,7 @@ async function handleIncoming(ctx, root, accountId, cred, msg, preset) {
20855
20856
  const parts = [];
20856
20857
  const activeWorkspace = getActiveSessionInfo(sessionId);
20857
20858
  if (activeWorkspace?.mdPath) {
20858
- if (!ensureWorkspacePromptSection(ref.agent, sessionId)) parts.push(workspaceTrajectoryLine(activeWorkspace.mdPath));
20859
+ if (!ensureWorkspacePromptSection(ref.agent, sessionId)) parts.push(workspaceCognitiveTrajectoryLine(activeWorkspace.mdPath));
20859
20860
  }
20860
20861
  const manualOutput = settings.autoReplyWithLastMessage === false;
20861
20862
  if (text) parts.push(text);
@@ -20883,7 +20884,7 @@ async function handleIncoming(ctx, root, accountId, cred, msg, preset) {
20883
20884
  })).catch((err) => {
20884
20885
  console.log(`[serenity-hooks] weixin hook incoming error: ${err instanceof Error ? err.message : String(err)}`);
20885
20886
  });
20886
- const answer = (await askSkiff(ctx, ref.agent, question, void 0, { includeTrajectory: false })).answer ?? "";
20887
+ const answer = (await askSkiff(ctx, ref.agent, question, void 0, { includeCognitiveTrajectory: false })).answer ?? "";
20887
20888
  if (manualOutput) {
20888
20889
  if (!manualOutputFallbackNeeded({
20889
20890
  fallbackOnNoSend: settings.fallbackOnNoSend,
@@ -21136,7 +21137,7 @@ function syncHumanChannel(ctx) {
21136
21137
  (async () => {
21137
21138
  try {
21138
21139
  stopMachineLoops();
21139
- const { listCccs } = await import("./ccc-roots-GIJ3A_tw.js").then((n) => n.a);
21140
+ const { listCccs } = await import("./ccc-roots-RMzGU-CJ.js").then((n) => n.a);
21140
21141
  for (const entry of await listCccs(ctx)) syncCccBridge(ctx, entry.root);
21141
21142
  } catch {}
21142
21143
  })();
@@ -21372,7 +21373,7 @@ function matchCcc(input, candidates) {
21372
21373
  }
21373
21374
  /** 组装候选列表(`ccc-roots.listCccs` 投影 + `.serenity` 名;动态 import 保持本模块静态依赖轻量) */
21374
21375
  async function collectCandidates(ctx) {
21375
- const { listCccs } = await import("./ccc-roots-GIJ3A_tw.js").then((n) => n.a);
21376
+ const { listCccs } = await import("./ccc-roots-RMzGU-CJ.js").then((n) => n.a);
21376
21377
  const entries = await listCccs(ctx, { defaultRoot: process.cwd() });
21377
21378
  const seen = /* @__PURE__ */ new Set();
21378
21379
  const out = [];
@@ -25370,7 +25371,7 @@ function apply(ctx, config) {
25370
25371
  })();
25371
25372
  if (config.tools) {
25372
25373
  ctx.tools.register(ccFsTool);
25373
- ctx.tools.register(createTrajectoryTool(ctx));
25374
+ ctx.tools.register(createCognitiveTrajectoryTool(ctx));
25374
25375
  ctx.tools.register(createKitTool(ctx));
25375
25376
  ctx.tools.register(gitTool);
25376
25377
  ctx.tools.register(msmTool);